Class: Ikra::AST::UntilNode
- 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:) ⇒ UntilNode
constructor
A new instance of UntilNode.
- #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:) ⇒ UntilNode
Returns a new instance of UntilNode.
505 506 507 508 509 510 511 |
# File 'lib/ast/nodes.rb', line 505 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.
503 504 505 |
# File 'lib/ast/nodes.rb', line 503 def body_stmts @body_stmts end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
502 503 504 |
# File 'lib/ast/nodes.rb', line 502 def condition @condition end |
Instance Method Details
#accept(visitor) ⇒ Object
146 147 148 |
# File 'lib/ast/visitor.rb', line 146 def accept(visitor) return visitor.visit_until_node(self) end |
#clone ⇒ Object
513 514 515 516 517 |
# File 'lib/ast/nodes.rb', line 513 def clone return UntilNode.new( condition: @condition.clone, body_stmts: @body_stmts.clone) end |
#to_s ⇒ Object
138 139 140 |
# File 'lib/ast/printer.rb', line 138 def to_s return "[UntilNode: #{condition.to_s}, #{body_stmts.to_s}]" end |