Class: LL::CompiledConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/ll/compiled_configuration.rb

Overview

Class for storing the compiled state/lookup/action tables and the likes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ CompiledConfiguration

Returns a new instance of CompiledConfiguration.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :name (String)
  • :namespace (Array)
  • :inner (String)
  • :header (String)
  • :terminals (Array)
  • :rules (Array)
  • :table (Array)
  • :actions (Array)
  • :action_bodies (Hash)


22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ll/compiled_configuration.rb', line 22

def initialize(options = {})
  options.each do |key, value|
    instance_variable_set("@#{key}", value) if respond_to?(key)
  end

  @namespace     ||= []
  @terminals     ||= []
  @rules         ||= []
  @table         ||= []
  @actions       ||= []
  @action_bodies ||= {}
end

Instance Attribute Details

#action_bodiesObject (readonly)

Returns the value of attribute action_bodies.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def action_bodies
  @action_bodies
end

#actionsObject (readonly)

Returns the value of attribute actions.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def actions
  @actions
end

#headerObject (readonly)

Returns the value of attribute header.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def header
  @header
end

#innerObject (readonly)

Returns the value of attribute inner.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def inner
  @inner
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def name
  @name
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def namespace
  @namespace
end

#rulesObject (readonly)

Returns the value of attribute rules.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def rules
  @rules
end

#tableObject (readonly)

Returns the value of attribute table.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def table
  @table
end

#terminalsObject (readonly)

Returns the value of attribute terminals.



6
7
8
# File 'lib/ll/compiled_configuration.rb', line 6

def terminals
  @terminals
end