class Ikra::AST::VarDefNode

Attributes

name[R]
read[RW]
written[RW]

Public Class Methods

new(name:, read: false, written: false) click to toggle source
# File lib/ast/nodes.rb, line 116
def initialize(name:, read: false, written: false)
    @name = name
    @read = read
    @written = written
end

Public Instance Methods

==(other) click to toggle source
Calls superclass method Ikra::AST::Node#==
# File lib/ast/nodes.rb, line 129
def ==(other)
    return super(other) &&
        name == other.name &&
        read == other.read &&
        written == other.written
end
accept(visitor) click to toggle source
# File lib/ast/visitor.rb, line 26
def accept(visitor)
    return visitor.visit_var_def_node(self)
end
clone() click to toggle source
# File lib/ast/nodes.rb, line 122
def clone
    return VarDefNode.new(
        name: @name,
        read: @read,
        written: @written)
end
to_s() click to toggle source
# File lib/ast/printer.rb, line 22
def to_s
    return "[VarDefNode: #{name}, read = #{read}, written = #{written}]"
end