Class: Treetop::Runtime::TerminalParseFailure
- Inherits:
-
Object
- Object
- Treetop::Runtime::TerminalParseFailure
- Defined in:
- lib/treetop/runtime/terminal_parse_failure.rb
Instance Attribute Summary collapse
-
#expected_string ⇒ Object
readonly
Returns the value of attribute expected_string.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#unexpected ⇒ Object
readonly
Returns the value of attribute unexpected.
Instance Method Summary collapse
-
#initialize(index, expected_string, unexpected = false) ⇒ TerminalParseFailure
constructor
A new instance of TerminalParseFailure.
- #to_s ⇒ Object
Constructor Details
#initialize(index, expected_string, unexpected = false) ⇒ TerminalParseFailure
Returns a new instance of TerminalParseFailure.
6 7 8 9 10 |
# File 'lib/treetop/runtime/terminal_parse_failure.rb', line 6 def initialize(index, expected_string, unexpected = false) @index = index @expected_string = expected_string @unexpected = unexpected end |
Instance Attribute Details
#expected_string ⇒ Object (readonly)
Returns the value of attribute expected_string.
4 5 6 |
# File 'lib/treetop/runtime/terminal_parse_failure.rb', line 4 def expected_string @expected_string end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
4 5 6 |
# File 'lib/treetop/runtime/terminal_parse_failure.rb', line 4 def index @index end |
#unexpected ⇒ Object (readonly)
Returns the value of attribute unexpected.
4 5 6 |
# File 'lib/treetop/runtime/terminal_parse_failure.rb', line 4 def unexpected @unexpected end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/treetop/runtime/terminal_parse_failure.rb', line 12 def to_s "String matching #{expected_string} #{@unexpected ? 'not ' : ''}expected." end |