Class: Kanocc::LexicalMatch

Inherits:
Object
  • Object
show all
Defined in:
lib/kanocc/scanner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(terminals, regexps, start_pos, length) ⇒ LexicalMatch

Returns a new instance of LexicalMatch.



220
221
222
223
224
225
# File 'lib/kanocc/scanner.rb', line 220

def initialize(terminals, regexps, start_pos, length)
  @terminals = terminals
  @regexps = regexps
  @start_pos = start_pos
  @length = length
end

Instance Attribute Details

#lengthObject

Returns the value of attribute length.



218
219
220
# File 'lib/kanocc/scanner.rb', line 218

def length
  @length
end

#start_posObject

Returns the value of attribute start_pos.



218
219
220
# File 'lib/kanocc/scanner.rb', line 218

def start_pos
  @start_pos
end

#terminalsObject

Returns the value of attribute terminals.



218
219
220
# File 'lib/kanocc/scanner.rb', line 218

def terminals
  @terminals
end

Instance Method Details

#regexp(terminal) ⇒ Object



227
228
229
# File 'lib/kanocc/scanner.rb', line 227

def regexp(terminal)
  @regexps[terminal]
end