rubyx/lib/vool/statements/statements.rb

29 lines
589 B
Ruby
Raw Normal View History

2017-04-01 20:28:57 +02:00
module Vool
class Statements < Statement
include Common::Statements
# create machine instructions
def to_mom( method )
raise "Empty list ? #{statements.length}" unless @statements[0]
flat = @statements.shift.to_mom(method)
while( nekst = @statements.shift )
flat.append nekst.to_mom(method)
end
flat
2017-04-08 11:10:42 +02:00
end
2017-04-09 09:14:28 +02:00
def create_objects
@statements.each{ |s| s.create_objects }
end
def each(&block)
block.call(self)
@statements.each{|a| a.each(block)}
end
end
class ScopeStatement < Statements
2017-04-01 20:28:57 +02:00
end
end