return out.join("\n")
end
- # The current module processed
- readable writable attr _module: MMSrcModule
+ # The processed module
+ readable attr _module: MMSrcModule
# Where instr and decl are stored
readable writable attr _ctx: CContext = new CContext
# The current indent lever
- readable writable attr _indent_level: Int = 0
+ readable writable attr _indent_level: Int = 0
- # The current ToolContext
- readable writable attr _tc: ToolContext
+ # The ToolContext info
+ readable attr _tc: ToolContext
# Create a new CompilerVisitor based on a module
- init(module: MMSrcModule) do _module = module
+ init(module: MMSrcModule, tc: ToolContext)
+ do
+ _module = module
+ _tc = tc
+ end
end
# Where instr and decl are stored for a module
var cnames = ["bigint", "char", "int", "float", "char *", "val_t *", "void *"]
for i in [0..pnames.length[ do
var n = pnames[i].to_symbol
- var pi = new PrimitiveInfo
- pi.name = n
- pi.tagged = tagged[i]
- pi.cname = cnames[i]
+ var pi = new PrimitiveInfo(n, tagged[i], cnames[i])
res[n] = pi
end
return res
# Information about a primitive class
class PrimitiveInfo
# The name of the class
- readable writable attr _name: Symbol
+ readable attr _name: Symbol
# Is the class tagged (aka not boxed)
- readable writable attr _tagged: Bool
+ readable attr _tagged: Bool
# The corresponding c type for the primitive value
- readable writable attr _cname: String
+ readable attr _cname: String
- private init do end
+ private init(n: Symbol, t: Bool, c: String)
+ do
+ _name = n
+ _tagged = t
+ _cname = c
+ end
end
redef class MMType