class Ikra::AST::LVarWriteNode

Attributes

identifier[R]
value[R]
variable_kind[RW]
variable_type[RW]

Public Class Methods

new(identifier:, value:) click to toggle source
# File lib/ast/nodes.rb, line 347
def initialize(identifier:, value:)
    @identifier = identifier
    @value = value

    value.parent = self
end

Public Instance Methods

accept(visitor) click to toggle source
# File lib/ast/visitor.rb, line 80
def accept(visitor)
    visitor.visit_lvar_write_node(self)
end
clone() click to toggle source
# File lib/ast/nodes.rb, line 354
def clone
    return LVarWriteNode.new(
        identifier: @identifier,
        value: @value.clone)
end
mangled_identifier() click to toggle source
# File lib/translator/variable_classifier_visitor.rb, line 22
def mangled_identifier
    if variable_kind == :lexical
        return Translator::Constants::LEXICAL_VAR_PREFIX + identifier.to_s
    else
        return identifier
    end
end
to_s() click to toggle source
# File lib/ast/printer.rb, line 78
def to_s
    return "[LVarWriteNode: #{identifier.to_s} := #{value.to_s}]"
end