use of kalang.compiler.codegen.Ast2Class in project kalang by kasonyang.
the class KalangClassLoader method generate.
@Override
public void generate(ClassNode classNode) {
final MemoryOutputManager outputManager = new MemoryOutputManager();
Ast2Class ast2Class = new Ast2Class(outputManager);
ast2Class.generate(classNode);
String[] names = outputManager.getClassNames();
for (String name : names) {
byte[] bs = outputManager.getBytes(name);
if (bs != null) {
Class<?> clazz = defineClass(name, bs, 0, bs.length);
loadedClasses.put(name, clazz);
}
}
}
use of kalang.compiler.codegen.Ast2Class in project kalang by kasonyang.
the class ClassWriter method generate.
@Override
public void generate(ClassNode classNode) {
if (outputManager != null) {
Ast2Class ast2class = new Ast2Class(outputManager);
ast2class.generate(classNode);
}
}
Aggregations