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.
794 795 796 797 798 799 |
# File 'lib/ebnf/ll1/parser.rb', line 794 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.
784 785 786 |
# File 'lib/ebnf/ll1/parser.rb', line 784 def lineno @lineno end |
#production ⇒ Symbol (readonly)
The current production.
772 773 774 |
# File 'lib/ebnf/ll1/parser.rb', line 772 def production @production end |
#token ⇒ String (readonly)
The invalid token which triggered the error.
778 779 780 |
# File 'lib/ebnf/ll1/parser.rb', line 778 def token @token end |