Search in sources :

Example 1 with UnitCompiler

use of org.codehaus.janino.UnitCompiler in project drill by apache.

the class JaninoClassCompiler method doCompile.

private ClassFile[] doCompile(final String sourceCode) throws CompileException, IOException, ClassNotFoundException {
    StringReader reader = new StringReader(sourceCode);
    Scanner scanner = new Scanner((String) null, reader);
    Java.CompilationUnit compilationUnit = new Parser(scanner).parseCompilationUnit();
    return new UnitCompiler(compilationUnit, compilationClassLoader).compileUnit(this.debug, this.debug, this.debug);
}
Also used : Scanner(org.codehaus.janino.Scanner) Java(org.codehaus.janino.Java) UnitCompiler(org.codehaus.janino.UnitCompiler) StringReader(java.io.StringReader) Parser(org.codehaus.janino.Parser)

Aggregations

StringReader (java.io.StringReader)1 Java (org.codehaus.janino.Java)1 Parser (org.codehaus.janino.Parser)1 Scanner (org.codehaus.janino.Scanner)1 UnitCompiler (org.codehaus.janino.UnitCompiler)1