rubyx/lib/vm/tree/assignment.rb

31 lines
460 B
Ruby
Raw Normal View History

2017-01-14 18:28:44 +01:00
module Vm
2016-12-09 12:20:48 +01:00
module Tree
2016-12-09 12:20:48 +01:00
class Assignment < Statement
attr_accessor :name , :value
def initialize(name , value = nil )
@name , @value = name , value
2016-12-09 12:20:48 +01:00
end
2016-12-28 13:11:05 +01: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