Class: Rley::Parser::ExpectationNotMet
- Inherits:
-
ErrorReason
- Object
- ErrorReason
- Rley::Parser::ExpectationNotMet
- Defined in:
- lib/rley/parser/error_reason.rb
Overview
Abstract class and subclass of ErrorReason. This specialization represents errors in which the input didn't match one of the expected token.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expected_terminals ⇒ Object
readonly
The terminal symbols expected when error was occurred.
-
#last_token ⇒ Object
readonly
The last input token read when error was detected.
Attributes inherited from ErrorReason
Instance Method Summary collapse
-
#initialize(aPosition, lastToken, expectedTerminals) ⇒ ExpectationNotMet
constructor
A new instance of ExpectationNotMet.
Methods inherited from ErrorReason
Constructor Details
#initialize(aPosition, lastToken, expectedTerminals) ⇒ ExpectationNotMet
Returns a new instance of ExpectationNotMet.
52 53 54 55 56 |
# File 'lib/rley/parser/error_reason.rb', line 52 def initialize(aPosition, lastToken, expectedTerminals) super(aPosition) @last_token = lastToken.dup @expected_terminals = expectedTerminals.dup end |
Instance Attribute Details
#expected_terminals ⇒ Object (readonly)
The terminal symbols expected when error was occurred
50 51 52 |
# File 'lib/rley/parser/error_reason.rb', line 50 def expected_terminals @expected_terminals end |
#last_token ⇒ Object (readonly)
The last input token read when error was detected
47 48 49 |
# File 'lib/rley/parser/error_reason.rb', line 47 def last_token @last_token end |