Exception: EBNF::LL1::Parser::Error
- Inherits:
-
StandardError
- Object
- StandardError
- EBNF::LL1::Parser::Error
- Defined in:
- lib/ebnf/ll1/parser.rb
Overview
Raised for errors during parsing.
Instance Attribute Summary collapse
-
#lineno ⇒ Integer
readonly
The line number where the error occurred.
-
#production ⇒ Symbol
readonly
The current production.
-
#token ⇒ String
readonly
The invalid token which triggered the error.
Instance Method Summary collapse
-
#initialize(message, options = {}) ⇒ Error
constructor
Initializes a new lexer error instance.
Constructor Details
#initialize(message, options = {}) ⇒ Error
Initializes a new lexer error instance.
736 737 738 739 740 741 |
# File 'lib/ebnf/ll1/parser.rb', line 736 def initialize(, = {}) @production = [:production] @token = [:token] @lineno = [:lineno] || (@token.lineno if @token.respond_to?(:lineno)) super(.to_s) end |
Instance Attribute Details
#lineno ⇒ Integer (readonly)
The line number where the error occurred.
726 727 728 |
# File 'lib/ebnf/ll1/parser.rb', line 726 def lineno @lineno end |
#production ⇒ Symbol (readonly)
The current production.
714 715 716 |
# File 'lib/ebnf/ll1/parser.rb', line 714 def production @production end |
#token ⇒ String (readonly)
The invalid token which triggered the error.
720 721 722 |
# File 'lib/ebnf/ll1/parser.rb', line 720 def token @token end |