Class: Ikra::AST::ConstNode
- Defined in:
- lib/ast/nodes.rb,
lib/ast/printer.rb,
lib/ast/visitor.rb
Constant Summary
Constants inherited from TreeNode
Instance Attribute Summary collapse
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #clone ⇒ Object
-
#initialize(identifier:) ⇒ ConstNode
constructor
A new instance of ConstNode.
- #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(identifier:) ⇒ ConstNode
Returns a new instance of ConstNode.
322 323 324 |
# File 'lib/ast/nodes.rb', line 322 def initialize(identifier:) @identifier = identifier end |
Instance Attribute Details
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
320 321 322 |
# File 'lib/ast/nodes.rb', line 320 def identifier @identifier end |
Instance Method Details
#accept(visitor) ⇒ Object
68 69 70 |
# File 'lib/ast/visitor.rb', line 68 def accept(visitor) visitor.visit_const_node(self) end |
#clone ⇒ Object
326 327 328 |
# File 'lib/ast/nodes.rb', line 326 def clone return ConstNode.new(identifier: @identifier) end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/ast/printer.rb', line 66 def to_s return "[ConstNode: #{identifier.to_s}]" end |