nitc :: APropdef :: compile_to_java
# Compile that property definition to java code
fun compile_to_java(v: JavaCompilerVisitor, mpropdef: MMethodDef, arguments: Array[RuntimeVariable]) do
v.info("NOT YET IMPLEMENTED {class_name}::compile_to_java")
end
src/compiler/java_compiler.nit:1497,2--1500,4
redef fun compile_to_java(v, mpropdef, arguments) do
v.current_node = self
if mpropdef == mreadpropdef then
compile_getter(v, mpropdef, arguments)
else if mpropdef == mwritepropdef then
compile_setter(v, mpropdef, arguments)
else
abort
end
v.current_node = null
end
src/compiler/java_compiler.nit:1841,2--1851,4
redef fun compile_to_java(v, mpropdef, arguments) do
if mpropdef.msignature != null then
var i = 0
for mparam in mpropdef.msignature.as(not null).mparameters do
var variable = n_signature.as(not null).n_params[i].variable
if variable == null then continue
var argvar = v.variable(variable)
v.assign(argvar, v.new_expr("args[{i + 1}]", v.compiler.mainmodule.object_type))
arguments.add(argvar)
i += 1
end
end
# Call the implicit super-init
var auto_super_inits = self.auto_super_inits
if auto_super_inits != null then
var args = [arguments.first]
for auto_super_init in auto_super_inits do
assert auto_super_init.mproperty != mpropdef.mproperty
args.clear
for i in [0..auto_super_init.msignature.arity+1[ do
args.add(arguments[i])
end
assert auto_super_init.mproperty != mpropdef.mproperty
v.compile_callsite(auto_super_init, args)
end
end
if auto_super_call then
v.supercall(mpropdef, arguments.first.mtype.as(MClassType), arguments)
end
compile_inside_to_java(v, mpropdef, arguments)
end
src/compiler/java_compiler.nit:1504,2--1536,4