Class: Bison::Sequence
- Inherits:
-
Object
- Object
- Bison::Sequence
- Defined in:
- lib/bison/sequence.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
-
#index ⇒ Object
Returns the value of attribute index.
-
#rule ⇒ Object
Returns the value of attribute rule.
Instance Method Summary collapse
- #<<(element) ⇒ Object
-
#initialize ⇒ Sequence
constructor
A new instance of Sequence.
Constructor Details
#initialize ⇒ Sequence
Returns a new instance of Sequence.
6 7 8 |
# File 'lib/bison/sequence.rb', line 6 def initialize @elements = [] end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
4 5 6 |
# File 'lib/bison/sequence.rb', line 4 def elements @elements end |
#index ⇒ Object
Returns the value of attribute index.
3 4 5 |
# File 'lib/bison/sequence.rb', line 3 def index @index end |
#rule ⇒ Object
Returns the value of attribute rule.
3 4 5 |
# File 'lib/bison/sequence.rb', line 3 def rule @rule end |
Instance Method Details
#<<(element) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/bison/sequence.rb', line 10 def <<(element) if Bison::Action === element element.predecessors = elements.clone end element.sequence = self elements << element self end |