Class: Rley::Parser::ErrorReason
- Inherits:
-
Object
- Object
- Rley::Parser::ErrorReason
- Defined in:
- lib/rley/parser/error_reason.rb
Overview
Abstract class. An instance represents an explanation describing the likely cause of a parse error detected by Rley.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#position ⇒ Object
readonly
The position of the offending input token.
-
#production ⇒ Object
readonly
The failing production.
Instance Method Summary collapse
-
#initialize(aPosition) ⇒ ErrorReason
constructor
A new instance of ErrorReason.
-
#inspect ⇒ Object
Return this reason's class name and message.
-
#message ⇒ Object
Returns the result of invoking reason.to_s.
Constructor Details
#initialize(aPosition) ⇒ ErrorReason
Returns a new instance of ErrorReason.
13 14 15 |
# File 'lib/rley/parser/error_reason.rb', line 13 def initialize(aPosition) @position = aPosition end |
Instance Attribute Details
#position ⇒ Object (readonly)
The position of the offending input token
8 9 10 |
# File 'lib/rley/parser/error_reason.rb', line 8 def position @position end |
#production ⇒ Object (readonly)
The failing production
11 12 13 |
# File 'lib/rley/parser/error_reason.rb', line 11 def production @production end |
Instance Method Details
#inspect ⇒ Object
Return this reason's class name and message
23 24 25 |
# File 'lib/rley/parser/error_reason.rb', line 23 def inspect "#{self.class.name}: #{}" end |
#message ⇒ Object
Returns the result of invoking reason.to_s.
18 19 20 |
# File 'lib/rley/parser/error_reason.rb', line 18 def () return self.to_s end |