Reworking if statement

Using 2 phase approach
Flattening tbd
This commit is contained in:
Torsten Ruger
2017-09-04 21:00:08 +03:00
parent db1549e0ee
commit dab4e74659
5 changed files with 47 additions and 26 deletions

View File

@@ -2,10 +2,17 @@ module Mom
# Base class for MOM instructions
class Instruction
attr :next_instruction
# flattening will change the structure from a tree to a linked list (and use
# next_instruction to do so)
def flatten
raise "not implemented"
end
end
# basically a label
class Noop
# A label with a name
class Label
attr_reader :name
def initialize(name)
@name = name
@@ -16,6 +23,7 @@ module Mom
end
require_relative "simple_call"
require_relative "if_statement"
require_relative "truth_check"
require_relative "jump"
require_relative "slot_load"