rubyx/lib/virtual/passes/get_implementation.rb
Torsten Ruger 5726d2c181 move machine to module level
makes for shorter, more concise, access
also remove one more bug possibility
(reinitiation)
2015-06-01 08:40:17 +03:00

18 lines
583 B
Ruby

module Virtual
# This implements instance variable get (not the opposite of Set,
# such a thing does not exists, their slots)
# Ivar get needs to acces the layout, find the index of the name,
# and shuffle the data to return register
# In short it's so complicated we implement it in ruby and stick the implementation here
class GetImplementation
def run block
block.codes.dup.each do |code|
next unless code.is_a? Virtual::InstanceGet
raise "Start coding"
end
end
end
Virtual.machine.add_pass "Virtual::GetImplementation"
end