Class: RLTK::Lexer::Rule

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

Overview

The Rule class is used simply for data encapsulation.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Rule) initialize(pattern, action, state, flags)

Instantiates a new Rule object.



364
365
366
367
368
369
# File 'lib/rltk/lexer.rb', line 364

def initialize(pattern, action, state, flags)
	@pattern	= pattern
	@action	= action
	@state	= state
	@flags	= flags
end

Instance Attribute Details

- (Proc) action (readonly)



350
351
352
# File 'lib/rltk/lexer.rb', line 350

def action
  @action
end

- (Array<Symbol>) flags (readonly)



356
357
358
# File 'lib/rltk/lexer.rb', line 356

def flags
  @flags
end

- (Regexp) pattern (readonly)



353
354
355
# File 'lib/rltk/lexer.rb', line 353

def pattern
  @pattern
end