Search in sources :

Example 1 with EvalCodeGenerator

use of com.googlecode.aviator.code.EvalCodeGenerator in project aviatorscript by killme2008.

the class AviatorEvaluatorInstance method newCodeGenerator.

public CodeGenerator newCodeGenerator(final AviatorClassLoader classLoader, final String sourceFile) {
    switch(getOptimizeLevel()) {
        case AviatorEvaluator.COMPILE:
            final EvalCodeGenerator codeGen = newEvalCodeGenerator(classLoader, sourceFile);
            codeGen.start();
            return codeGen;
        case AviatorEvaluator.EVAL:
            return new OptimizeCodeGenerator(this, sourceFile, classLoader, this.traceOutputStream);
        default:
            throw new IllegalArgumentException("Unknow option " + getOptimizeLevel());
    }
}
Also used : OptimizeCodeGenerator(com.googlecode.aviator.code.OptimizeCodeGenerator) EvalCodeGenerator(com.googlecode.aviator.code.EvalCodeGenerator)

Aggregations

EvalCodeGenerator (com.googlecode.aviator.code.EvalCodeGenerator)1 OptimizeCodeGenerator (com.googlecode.aviator.code.OptimizeCodeGenerator)1