class RLTK::NotInLanguage

A NotInLanguage error is raised whenever there is no valid parse tree for a given token stream. In other words, the input string is not in the defined language.

Attributes

current[R]

@return [Token] Token that caused the parser to stop

remaining[R]

@return [Array<Token>] List of tokens that have yet to be seen

seen[R]

@return [Array<Token>] List of tokens that have been successfully parsed

Public Class Methods

new(seen, current, remaining) click to toggle source

@param [Array<Token>] seen Tokens that have been successfully parsed @param [Token] current Token that caused the parser to stop @param [Array<Token>] remaining Tokens that have yet to be seen

# File lib/rltk/parser.rb, line 45
def initialize(seen, current, remaining)
        @seen      = seen
        @current   = current
        @remaining = remaining
end

Public Instance Methods

to_s() click to toggle source

@return [String] String representation of the error.

# File lib/rltk/parser.rb, line 52
def to_s
        "String not in language.  Token info:\n\tSeen: #{@seen}\n\tCurrent: #{@current}\n\tRemaining: #{@remaining}"
end