Class: Bison::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/bison/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, components = []) ⇒ Rule

Returns a new instance of Rule.



6
7
8
9
# File 'lib/bison/rule.rb', line 6

def initialize(name, components=[])
  @name, @components = name, components
  components.each_with_index{ |x, i| x.index = i; x.rule = self }
end

Instance Attribute Details

#componentsObject (readonly)

Returns the value of attribute components.



3
4
5
# File 'lib/bison/rule.rb', line 3

def components
  @components
end

#locationObject

Returns the value of attribute location.



4
5
6
# File 'lib/bison/rule.rb', line 4

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/bison/rule.rb', line 3

def name
  @name
end