renaming mom builtin to macro

This commit is contained in:
2019-09-11 20:17:43 +03:00
parent 5ea91df4c1
commit 616dd3487c
55 changed files with 49 additions and 47 deletions

View File

@ -9,12 +9,14 @@ module Mom
end
end
end
class Macro < Instruction
end
end
require_relative "builtin/space"
require_relative "builtin/integer"
require_relative "builtin/object"
require_relative "builtin/word"
require_relative "macro/space"
require_relative "macro/integer"
require_relative "macro/object"
require_relative "macro/word"
module Mom
module Builtin

View File

@ -29,7 +29,7 @@ module Mom
end
end
end
class Comparison < ::Mom::Instruction
class Comparison < Macro
attr_reader :operator
def initialize(name , operator)
super(name)

View File

@ -62,7 +62,7 @@ module Mom
end
end
end
class Div10 < ::Mom::Instruction
class Div10 < Macro
def to_risc(compiler)
s = "div_10 "
builder = compiler.builder(compiler.source)

View File

@ -16,7 +16,7 @@ module Mom
end
end
end
class Div4 < ::Mom::Instruction
class Div4 < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
integer_tmp = builder.allocate_int

View File

@ -9,7 +9,7 @@ module Mom
end
end
end
class Exit < ::Mom::Instruction
class Exit < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
builder.prepare_int_return # makes integer_tmp variable as return

View File

@ -16,7 +16,7 @@ module Mom
end
end
end
class GetInternalByte < ::Mom::Instruction
class GetInternalByte < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
integer_tmp = builder.allocate_int

View File

@ -12,7 +12,7 @@ module Mom
end
end
end
class GetInternalWord < Instruction
class GetInternalWord < Macro
def to_risc(compiler)
compiler.builder(compiler.source).build do
object! << message[:receiver]

View File

@ -32,7 +32,7 @@ module Mom
end
end
end
class Init < ::Mom::Instruction
class Init < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
builder.build do

View File

@ -9,7 +9,7 @@ module Mom
end
end
end
class MethodMissing < ::Mom::Instruction
class MethodMissing < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
builder.prepare_int_return # makes integer_tmp variable as return

View File

@ -24,7 +24,7 @@ module Mom
end
end
end
class IntOperator < Instruction
class IntOperator < Macro
attr_reader :operator
def initialize(name , operator)
super(name)

View File

@ -13,7 +13,7 @@ module Mom
end
end
end
class Putstring < ::Mom::Instruction
class Putstring < Macro
def to_risc(compiler)
builder = compiler.builder(compiler.source)
builder.prepare_int_return # makes integer_tmp variable as return

View File

@ -15,7 +15,7 @@ module Mom
end
end
end
class SetInternalByte < ::Mom::Instruction
class SetInternalByte < Macro
def to_risc(compiler)
compiler.builder(compiler.source).build do
word! << message[:receiver]

View File

@ -14,7 +14,7 @@ module Mom
end
end
end
class SetInternalWord < ::Mom::Instruction
class SetInternalWord < Macro
def to_risc(compiler)
compiler.builder(compiler.source).build do
object! << message[:receiver]

View File

@ -23,4 +23,4 @@ require_relative "mom_collection"
require_relative "callable_compiler"
require_relative "method_compiler"
require_relative "block_compiler"
require_relative "builtin"
require_relative "macro"