Exception: Kanocc::ParseException
- Inherits:
-
KanoccException
- Object
- Exception
- KanoccException
- Kanocc::ParseException
- Defined in:
- lib/kanocc.rb
Instance Attribute Summary collapse
-
#expectedTerminals ⇒ Object
readonly
Returns the value of attribute expectedTerminals.
-
#offendingInput ⇒ Object
readonly
Returns the value of attribute offendingInput.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
Instance Method Summary collapse
-
#initialize(expected_terminals, offending_input, pos) ⇒ ParseException
constructor
A new instance of ParseException.
Constructor Details
#initialize(expected_terminals, offending_input, pos) ⇒ ParseException
Returns a new instance of ParseException.
261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/kanocc.rb', line 261 def initialize(expected_terminals, offending_input, pos) @expected_terminals, @offending_input, @pos = expected_terminals, offending_input, pos error_msg = "\n Could not consume input: #{offending_input} at #{pos}" if expected_terminals.size > 0 error_msg += " - expected " + "#{expected_terminals.map {|t| t.inspect}.join(" or ")}" else error_msg += " - no input could be consumed at this point." end super(error_msg) end |
Instance Attribute Details
#expectedTerminals ⇒ Object (readonly)
Returns the value of attribute expectedTerminals.
260 261 262 |
# File 'lib/kanocc.rb', line 260 def expectedTerminals @expectedTerminals end |
#offendingInput ⇒ Object (readonly)
Returns the value of attribute offendingInput.
260 261 262 |
# File 'lib/kanocc.rb', line 260 def offendingInput @offendingInput end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
260 261 262 |
# File 'lib/kanocc.rb', line 260 def pos @pos end |