rubyx/lib/vm/tree/assignment.rb

31 lines
460 B
Ruby
Raw Normal View History

2017-01-14 19:28:44 +02:00
module Vm
2016-12-09 13:20:48 +02:00
module Tree
2016-12-09 13:20:48 +02:00
class Assignment < Statement
attr_accessor :name , :value
def initialize(name , value = nil )
@name , @value = name , value
2016-12-09 13:20:48 +02:00
end
2016-12-28 14:11:05 +02:00
def to_s
"#{name} = #{value}\n"
end
end
class IvarAssignment < Assignment
def to_s
"@#{name} = #{value}\n"
end
end
class ArgAssignment < Assignment
end
class LocalAssignment < Assignment
end
end
end