Class: Rley::Parser::PrematureInputEnd
- Inherits:
-
ExpectationNotMet
- Object
- ErrorReason
- ExpectationNotMet
- Rley::Parser::PrematureInputEnd
- Defined in:
- lib/rley/parser/error_reason.rb
Overview
This parse error occurs when all input tokens were consumed but the parser still expected one or more tokens from the input.
Instance Attribute Summary
Attributes inherited from ExpectationNotMet
#expected_terminals, #last_token
Attributes inherited from ErrorReason
Instance Method Summary collapse
-
#to_s ⇒ Object
Returns the reason's message.
Methods inherited from ExpectationNotMet
Methods inherited from ErrorReason
#initialize, #inspect, #message
Constructor Details
This class inherits a constructor from Rley::Parser::ExpectationNotMet
Instance Method Details
#to_s ⇒ Object
Returns the reason's message.
100 101 102 103 104 105 106 |
# File 'lib/rley/parser/error_reason.rb', line 100 def to_s err_msg = +"Premature end of input after '#{last_token.lexeme}'" err_msg << " at position #{position}\n" err_msg << "#{expectations}." return err_msg end |