Class: Bison::Rule
- Inherits:
-
Object
- Object
- Bison::Rule
- Defined in:
- lib/bison/rule.rb
Instance Attribute Summary collapse
-
#components ⇒ Object
readonly
Returns the value of attribute components.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, components = []) ⇒ Rule
constructor
A new instance of Rule.
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
#components ⇒ Object (readonly)
Returns the value of attribute components.
3 4 5 |
# File 'lib/bison/rule.rb', line 3 def components @components end |
#location ⇒ Object
Returns the value of attribute location.
4 5 6 |
# File 'lib/bison/rule.rb', line 4 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/bison/rule.rb', line 3 def name @name end |