sorting mom instructions and statements into separate dirs
This commit is contained in:
parent
2779045caa
commit
20a88f9ac8
@ -14,4 +14,5 @@
|
||||
module Mom
|
||||
end
|
||||
|
||||
require_relative "mom/instruction.rb"
|
||||
require_relative "mom/instruction/instruction.rb"
|
||||
require_relative "mom/statement/statement.rb"
|
||||
|
@ -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
|
||||
|
||||
|
@ -32,4 +32,3 @@ require_relative "slot_load"
|
||||
require_relative "return_sequence"
|
||||
require_relative "message_setup"
|
||||
require_relative "argument_transfer"
|
||||
require_relative "statement"
|
15
lib/mom/statement/statement.rb
Normal file
15
lib/mom/statement/statement.rb
Normal 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"
|
@ -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"
|
Loading…
x
Reference in New Issue
Block a user