Class: CompoundExpression
- Inherits:
-
Expression
- Object
- Expression
- CompoundExpression
- Defined in:
- lib/glark/match/compound.rb
Overview
Associates a collection of expressions.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ops ⇒ Object
readonly
Returns the value of attribute ops.
Attributes inherited from Expression
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(*ops) ⇒ CompoundExpression
constructor
A new instance of CompoundExpression.
- #reset_file(file) ⇒ Object
- #start_position ⇒ Object
Methods inherited from Expression
#add_match, #end_position, #process, #to_s
Constructor Details
#initialize(*ops) ⇒ CompoundExpression
Returns a new instance of CompoundExpression.
15 16 17 18 |
# File 'lib/glark/match/compound.rb', line 15 def initialize(*ops) @ops = ops super() end |
Instance Attribute Details
#ops ⇒ Object (readonly)
Returns the value of attribute ops.
13 14 15 |
# File 'lib/glark/match/compound.rb', line 13 def ops @ops end |
Instance Method Details
#==(other) ⇒ Object
31 32 33 |
# File 'lib/glark/match/compound.rb', line 31 def == other self.class == other.class && @ops == other.ops end |
#reset_file(file) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/glark/match/compound.rb', line 20 def reset_file file @ops.each do |op| op.reset_file file end super end |
#start_position ⇒ Object
27 28 29 |
# File 'lib/glark/match/compound.rb', line 27 def start_position @last_start end |