Class: Falluto::FaultDeclarationNode
- Inherits:
- 
      Treetop::Runtime::SyntaxNode
      
        - Object
- Treetop::Runtime::SyntaxNode
- Falluto::FaultDeclarationNode
 
- Defined in:
- lib/falluto/grammar/nodes.rb
Instance Method Summary collapse
- #each_effect {|first| ... } ⇒ Object
- #effect ⇒ Object
- #name ⇒ Object
- #precondition ⇒ Object
- #restores ⇒ Object
Instance Method Details
#each_effect {|first| ... } ⇒ Object
| 54 55 56 57 58 | # File 'lib/falluto/grammar/nodes.rb', line 54 def each_effect first = fault_effect.list.first yield first unless first.text.empty? fault_effect.list.rest.elements.each {|e| yield e.fault_effect_expression} end | 
#effect ⇒ Object
| 42 43 44 45 46 47 48 49 50 51 52 | # File 'lib/falluto/grammar/nodes.rb', line 42 def effect result = Hash.new each_effect do |effect_expression| var = effect_expression.var_id.stripped effect = effect_expression.simple_expression.stripped result[var] = effect end result end | 
#name ⇒ Object
| 30 31 32 | # File 'lib/falluto/grammar/nodes.rb', line 30 def name id.stripped end | 
#precondition ⇒ Object
| 34 35 36 | # File 'lib/falluto/grammar/nodes.rb', line 34 def precondition fault_pre.simple_expression.stripped end | 
#restores ⇒ Object
| 38 39 40 | # File 'lib/falluto/grammar/nodes.rb', line 38 def restores fault_restores.next_expression.stripped end |