sorting mom instructions and statements into separate dirs

This commit is contained in:
Torsten Ruger 2018-03-13 16:51:33 +05:30
parent 2779045caa
commit 20a88f9ac8
17 changed files with 21 additions and 19 deletions

View File

@ -14,4 +14,5 @@
module Mom
end
require_relative "mom/instruction.rb"
require_relative "mom/instruction/instruction.rb"
require_relative "mom/statement/statement.rb"

View File

@ -62,7 +62,7 @@ To make the transition even easier, it is done in two steps.
## 1. Everything but control structures
So we go from language to machine as the first step, in terms of memory instructions.
wSo we go from language to machine as the first step, in terms of memory instructions.
Memory gets moved around between the main machine objects (frames and messages).
But control structures stay "intact", so we stay at tree structure

View File

@ -32,4 +32,3 @@ require_relative "slot_load"
require_relative "return_sequence"
require_relative "message_setup"
require_relative "argument_transfer"
require_relative "statement"

View File

@ -0,0 +1,15 @@
module Mom
class Statement
include Common::List
# flattening will change the structure from a tree to a linked list (and use
# nekst to do so)
def flatten(options = {})
raise "not implemented for #{self}"
end
end
end
require_relative "statements"
require_relative "if_statement"
require_relative "while_statement"

View File

@ -1,13 +1,4 @@
module Mom
class Statement
include Common::List
# flattening will change the structure from a tree to a linked list (and use
# nekst to do so)
def flatten(options = {})
raise "not implemented for #{self}"
end
end
class Statements < Statement
include Common::Statements
@ -26,8 +17,4 @@ module Mom
}
end
end
end
require_relative "if_statement"
require_relative "while_statement"