class EBNF::LL1::Lexer::Error
Raised for errors during lexical analysis.
@example Raising a lexer error
raise EBNF::LL1::Lexer::Error.new( "invalid token '%' on line 10", input: query, token: '%', lineno: 9)
Attributes
input[R]
The input string associated with the error.
@return [String]
lineno[R]
The line number where the error occurred.
@return [Integer]
token[R]
The invalid token which triggered the error.
@return [String]
Public Class Methods
new(message, **options)
click to toggle source
Initializes a new lexer error instance.
@param [String, to_s] message @param [Hash{Symbol => Object}] options @option options [String] :input (nil) @option options [String] :token (nil) @option options [Integer] :lineno (nil)
Calls superclass method
# File lib/ebnf/ll1/lexer.rb, line 498 def initialize(message, **options) @input = options[:input] @token = options[:token] @lineno = options[:lineno] super(message.to_s) end