Class: Ikra::AST::UntilPostNode
- Defined in:
- lib/ast/nodes.rb,
lib/ast/printer.rb,
lib/ast/visitor.rb
Constant Summary
Constants inherited from TreeNode
Instance Attribute Summary collapse
-
#body_stmts ⇒ Object
readonly
Returns the value of attribute body_stmts.
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #clone ⇒ Object
-
#initialize(condition:, body_stmts:) ⇒ UntilPostNode
constructor
A new instance of UntilPostNode.
- #to_s ⇒ Object
Methods inherited from TreeNode
#==, #enclosing_class, #find_behavior_node, #get_type, #is_begin_node?, #merge_union_type, #register_type_change, #replace, #replace_child, #symbol_table
Methods inherited from Node
Constructor Details
#initialize(condition:, body_stmts:) ⇒ UntilPostNode
Returns a new instance of UntilPostNode.
524 525 526 527 528 529 530 |
# File 'lib/ast/nodes.rb', line 524 def initialize(condition:, body_stmts:) @condition = condition @body_stmts = body_stmts condition.parent = self body_stmts.parent = self end |
Instance Attribute Details
#body_stmts ⇒ Object (readonly)
Returns the value of attribute body_stmts.
522 523 524 |
# File 'lib/ast/nodes.rb', line 522 def body_stmts @body_stmts end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
521 522 523 |
# File 'lib/ast/nodes.rb', line 521 def condition @condition end |
Instance Method Details
#accept(visitor) ⇒ Object
152 153 154 |
# File 'lib/ast/visitor.rb', line 152 def accept(visitor) return visitor.visit_until_post_node(self) end |
#clone ⇒ Object
532 533 534 535 536 |
# File 'lib/ast/nodes.rb', line 532 def clone return UntilPostNode.new( condition: @condition.clone, body_stmts: @body_stmts.clone) end |
#to_s ⇒ Object
144 145 146 |
# File 'lib/ast/printer.rb', line 144 def to_s return "[UntilPostNode: #{condition.to_s}, #{body_stmts.to_s}]" end |