Exception: RLTK::NotInLanguage

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rltk/parser.rb

Overview

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.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (NotInLanguage) initialize(seen, current, remaining)



45
46
47
48
49
# File 'lib/rltk/parser.rb', line 45

def initialize(seen, current, remaining)
	@seen      = seen
	@current   = current
	@remaining = remaining
end

Instance Attribute Details

- (Token) current (readonly)



37
38
39
# File 'lib/rltk/parser.rb', line 37

def current
  @current
end

- (Array<Token>) remaining (readonly)



40
41
42
# File 'lib/rltk/parser.rb', line 40

def remaining
  @remaining
end

- (Array<Token>) seen (readonly)



34
35
36
# File 'lib/rltk/parser.rb', line 34

def seen
  @seen
end

Instance Method Details

- (String) to_s



52
53
54
# 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