Exception: ANTLR3::Error::MismatchedToken
- Inherits:
-
RecognitionError
- Object
- StandardError
- RecognitionError
- ANTLR3::Error::MismatchedToken
- Defined in:
- lib/antlr3/error.rb
Overview
- type
-
MismatchedToken
- used by
-
lexers and parsers
- occurs when
-
The recognizer expected to match a symbol
x
at the current input position, but it saw a different symboly
instead.
Direct Known Subclasses
Constant Summary
Constants included from Constants
Constants::BUILT_IN_TOKEN_NAMES, Constants::DEFAULT, Constants::DOWN, Constants::EOF, Constants::EOF_TOKEN, Constants::EOR_TOKEN_TYPE, Constants::HIDDEN, Constants::INVALID, Constants::INVALID_NODE, Constants::INVALID_TOKEN, Constants::MEMO_RULE_FAILED, Constants::MEMO_RULE_UNKNOWN, Constants::MIN_TOKEN_TYPE, Constants::SKIP_TOKEN, Constants::UP
Instance Attribute Summary collapse
-
#expecting ⇒ Object
readonly
Returns the value of attribute expecting.
Attributes inherited from RecognitionError
#column, #index, #input, #line, #source_name, #symbol, #token
Instance Method Summary collapse
-
#initialize(expecting, input) ⇒ MismatchedToken
constructor
A new instance of MismatchedToken.
- #message ⇒ Object
Methods inherited from RecognitionError
#approximate_line_info?, #location, #unexpected_type
Constructor Details
#initialize(expecting, input) ⇒ MismatchedToken
Returns a new instance of MismatchedToken.
220 221 222 223 |
# File 'lib/antlr3/error.rb', line 220 def initialize( expecting, input ) @expecting = expecting super( input ) end |
Instance Attribute Details
#expecting ⇒ Object (readonly)
Returns the value of attribute expecting.
218 219 220 |
# File 'lib/antlr3/error.rb', line 218 def expecting @expecting end |
Instance Method Details
#message ⇒ Object
225 226 227 |
# File 'lib/antlr3/error.rb', line 225 def "%s: %p %p" % [ self.class, unexpected_type, @expecting.inspect ] end |