def on_error(t, val, vstack)
      raise ParseError, sprintf("\nparse error on value %s (%s)",
                                val.inspect, token_to_str(t) || '?')
    end
def on_error(t, val, vstack)
      raise ParseError, sprintf("\nparse error on value %s (%s)",
                                val.inspect, token_to_str(t) || '?')
    end
This method is called when a parse error is found.

 ERROR_TOKEN_ID is an internal ID of token which caused error.
 You can get string representation of this ID by calling
 #token_to_str.

 ERROR_VALUE is a value of error token.

 value_stack is a stack of symbol values.
 DO NOT MODIFY this object.

 This method raises ParseError by default.

 If this method returns, parsers enter "error recovering mode".