changing predict() and sr_parser() to handle illegal parsing actions