Class: Dhaka::CompiledLexer

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

Overview

Abstract base class of all compiled Lexers. It is only used by generated code.

Class Method Summary collapse

Class Method Details

.action_for_pattern(pattern) ⇒ Object

:nodoc:



15
16
17
# File 'lib/dhaka/lexer/compiled_lexer.rb', line 15

def action_for_pattern pattern #:nodoc:
  specification.items[pattern].action
end

.lex(input) ⇒ Object

Returns a LexerRun that tokenizes input.



7
8
9
# File 'lib/dhaka/lexer/compiled_lexer.rb', line 7

def lex input
  LexerRun.new(self, input)
end

.start_stateObject

:nodoc:



11
12
13
# File 'lib/dhaka/lexer/compiled_lexer.rb', line 11

def start_state #:nodoc:
  states[start_state_id]
end