end
end
-redef class ANode
- type VISITOR: AbstractCompilerVisitor
-end
+# Node visit
redef class APropdef
- fun compile_to_c(v: VISITOR, mpropdef: MMethodDef, arguments: Array[RuntimeVariable])
+ fun compile_to_c(v: AbstractCompilerVisitor, mpropdef: MMethodDef, arguments: Array[RuntimeVariable])
do
v.add("printf(\"NOT YET IMPLEMENTED {class_name} {mpropdef} at {location.to_s}\\n\");")
debug("Not yet implemented")
end
end
- fun init_expr(v: VISITOR, recv: RuntimeVariable)
+ fun init_expr(v: AbstractCompilerVisitor, recv: RuntimeVariable)
do
var nexpr = self.n_expr
if nexpr != null then
end
end
- fun check_expr(v: VISITOR, recv: RuntimeVariable)
+ fun check_expr(v: AbstractCompilerVisitor, recv: RuntimeVariable)
do
var nexpr = self.n_expr
if nexpr != null then return
end
redef class AClassdef
- private fun compile_to_c(v: VISITOR, mpropdef: MMethodDef, arguments: Array[RuntimeVariable])
+ private fun compile_to_c(v: AbstractCompilerVisitor, mpropdef: MMethodDef, arguments: Array[RuntimeVariable])
do
if mpropdef == self.mfree_init then
var super_inits = self.super_inits
redef class AExpr
# Try to compile self as an expression
# Do not call this method directly, use `v.expr' instead
- private fun expr(v: VISITOR): nullable RuntimeVariable
+ private fun expr(v: AbstractCompilerVisitor): nullable RuntimeVariable
do
v.add("printf(\"NOT YET IMPLEMENTED {class_name}:{location.to_s}\\n\");")
var mtype = self.mtype
# Try to compile self as a statement
# Do not call this method directly, use `v.stmt' instead
- private fun stmt(v: VISITOR)
+ private fun stmt(v: AbstractCompilerVisitor)
do
var res = expr(v)
if res != null then v.add("{res};")