Class: Treetop::Runtime::TerminalParseFailure

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_parse_failure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, expected_string) ⇒ TerminalParseFailure

Returns a new instance of TerminalParseFailure.



6
7
8
9
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_parse_failure.rb', line 6

def initialize(index, expected_string)
  @index = index
  @expected_string = expected_string
end

Instance Attribute Details

#expected_stringObject (readonly)

Returns the value of attribute expected_string.



4
5
6
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_parse_failure.rb', line 4

def expected_string
  @expected_string
end

#indexObject (readonly)

Returns the value of attribute index.



4
5
6
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_parse_failure.rb', line 4

def index
  @index
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/gems/treetop-1.2.4/lib/treetop/runtime/terminal_parse_failure.rb', line 11

def to_s
  "String matching #{expected_string} expected."
end