Runtime classes have 3 attributes:
class_name
: the class name as a Stringvft
: the virtual function table for the class (flattened)supers
: the super type table (used for type tests)
# Compile the abstract runtime class structure
#
# Runtime classes have 3 attributes:
# * `class_name`: the class name as a String
# * `vft`: the virtual function table for the class (flattened)
# * `supers`: the super type table (used for type tests)
fun compile_rtclass(compiler: JavaCompiler) do
var v = compiler.new_visitor("RTClass.java")
v.add("import java.util.HashMap;")
v.add("public abstract class RTClass \{")
v.add(" public String class_name;")
v.add(" public HashMap<String, RTMethod> vft = new HashMap<>();")
v.add(" public HashMap<String, RTClass> supers = new HashMap<>();")
v.add(" protected RTClass() \{\}")
v.add("\}")
end
src/compiler/java_compiler.nit:1163,2--1178,4