compiler/backend.rb

17 lines
230 B
Ruby
Raw Permalink Normal View History

2018-07-20 19:44:57 -05:00
class Backend
attr_writer :dbg
def initialize(code)
@code=code
@dbg=false
@pc=0
end
def run
while true
op=@code[@pc]
break if op==nil
inc=execute(op)
@pc+=1 if inc
end
end
end