Exception: ANTLR3::Error::MismatchedTreeNode
- Inherits:
-
RecognitionError
- Object
- StandardError
- RecognitionError
- ANTLR3::Error::MismatchedTreeNode
- Defined in:
- lib/antlr3/error.rb
Overview
- error
-
MismatchedTreeNode
- used by
-
tree parsers
- occurs when
-
A tree parser expects to match a tree node containing a specific type of token, but the current tree node’s token type does not match. It’s essentially the same as MismatchedToken, but used specifically for tree nodes.
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
Returns the value of attribute expecting.
-
#input ⇒ Object
Returns the value of attribute input.
Attributes inherited from RecognitionError
#column, #index, #line, #source_name, #symbol, #token
Instance Method Summary collapse
-
#initialize(expecting, input) ⇒ MismatchedTreeNode
constructor
A new instance of MismatchedTreeNode.
- #message ⇒ Object
Methods inherited from RecognitionError
#approximate_line_info?, #location, #unexpected_type
Constructor Details
#initialize(expecting, input) ⇒ MismatchedTreeNode
Returns a new instance of MismatchedTreeNode.
500 501 502 503 |
# File 'lib/antlr3/error.rb', line 500 def initialize( expecting, input ) @expecting = expecting super( input ) end |
Instance Attribute Details
#expecting ⇒ Object
Returns the value of attribute expecting.
499 500 501 |
# File 'lib/antlr3/error.rb', line 499 def expecting @expecting end |
#input ⇒ Object
Returns the value of attribute input.
499 500 501 |
# File 'lib/antlr3/error.rb', line 499 def input @input end |
Instance Method Details
#message ⇒ Object
505 506 507 508 |
# File 'lib/antlr3/error.rb', line 505 def '%s: %p != %p' % [ self.class, unexpected_type, @expecting ] end |