Search in sources :

Example 1 with OperatorIR

use of com.googlecode.aviator.code.interpreter.ir.OperatorIR in project aviatorscript by killme2008.

the class InterpretCodeGenerator method emit.

private void emit(IR ir) {
    if (ir instanceof OperatorIR) {
        // check if operator is override.
        final OperatorType op = ((OperatorIR) ir).getOp();
        AviatorFunction fn = this.instance.getOpFunction(op);
        if (fn != null) {
            // replace it with new IR
            ir = new OperatorIR(op, fn);
        }
    }
    this.instruments.add(ir);
}
Also used : AviatorFunction(com.googlecode.aviator.runtime.type.AviatorFunction) OperatorIR(com.googlecode.aviator.code.interpreter.ir.OperatorIR) OperatorType(com.googlecode.aviator.lexer.token.OperatorType)

Aggregations

OperatorIR (com.googlecode.aviator.code.interpreter.ir.OperatorIR)1 OperatorType (com.googlecode.aviator.lexer.token.OperatorType)1 AviatorFunction (com.googlecode.aviator.runtime.type.AviatorFunction)1