Class: Ikra::AST::FloatLiteralNode

Inherits:
TreeNode show all
Defined in:
lib/ast/nodes.rb,
lib/ast/printer.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

Constructor Details

#initialize(value:) ⇒ FloatLiteralNode

Returns a new instance of FloatLiteralNode.



388
389
390
# File 'lib/ast/nodes.rb', line 388

def initialize(value:)
    @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



386
387
388
# File 'lib/ast/nodes.rb', line 386

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



98
99
100
# File 'lib/ast/visitor.rb', line 98

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

#cloneObject



392
393
394
# File 'lib/ast/nodes.rb', line 392

def clone
    return FloatLiteralNode.new(value: @value)
end

#to_sObject



90
91
92
# File 'lib/ast/printer.rb', line 90

def to_s
    return "<#{value.to_s}>"
end