Class: Aurum::LexicalTableGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/aurum/lexical_table_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(specification) ⇒ LexicalTableGenerator

Returns a new instance of LexicalTableGenerator.



8
9
10
11
12
# File 'lib/aurum/lexical_table_generator.rb', line 8

def initialize specification
    @specification, @accept_states  = specification, {}
    @lexical_states = @specification.keys - [:all]
    @patterns_for_all = specification[:all] ? specification[:all] : {}
end

Instance Attribute Details

#lexical_statesObject (readonly)

Returns the value of attribute lexical_states.



7
8
9
# File 'lib/aurum/lexical_table_generator.rb', line 7

def lexical_states
  @lexical_states
end

Instance Method Details

#lexical_tableObject



14
15
16
17
18
19
# File 'lib/aurum/lexical_table_generator.rb', line 14

def lexical_table
    construct_automata			
    make_initial_partitions
    refine_partitions
    @partitions.size < @lexical_automata.table.size ? construct_minimize_automata : [@lexical_automata.table, @accept_states]
end