Class: Ikra::AST::IVarReadNode

Inherits:
TreeNode show all
Defined in:
lib/ast/nodes.rb,
lib/ast/visitor.rb

Constant Summary

Constants inherited from TreeNode

TreeNode::TYPE_INFO_VARS

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

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

#==, #eql?, #hash, #to_s

Constructor Details

#initialize(identifier:) ⇒ IVarReadNode

Returns a new instance of IVarReadNode.



364
365
366
# File 'lib/ast/nodes.rb', line 364

def initialize(identifier:)
    @identifier = identifier
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



362
363
364
# File 'lib/ast/nodes.rb', line 362

def identifier
  @identifier
end

Instance Method Details

#accept(visitor) ⇒ Object



86
87
88
# File 'lib/ast/visitor.rb', line 86

def accept(visitor)
    visitor.visit_ivar_read_node(self)
end

#cloneObject



368
369
370
# File 'lib/ast/nodes.rb', line 368

def clone
    return IVarReadNode.new(identifier: @identifier)
end