use of com.googlecode.aviator.code.interpreter.ir.LoadIR in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onConstant.
@Override
public void onConstant(final Token<?> lookhead) {
if (LOAD_CONSTANTS_TYPE.contains(lookhead.getType())) {
VariableMeta meta = null;
if (lookhead.getType() == TokenType.Variable) {
meta = this.variables.get(lookhead.getLexeme());
}
emit(new LoadIR(this.sourceFile, lookhead, meta, this.constantPool.contains(lookhead)));
}
}
use of com.googlecode.aviator.code.interpreter.ir.LoadIR in project aviatorscript by killme2008.
the class InterpretExpression method loadConstants.
private void loadConstants(final Set<Token<?>> constants, final List<IR> instruments) {
final Env env = new Env();
env.setInstance(this.instance);
InterpretContext ctx = new InterpretContext(this, instruments, env);
for (Token<?> token : constants) {
final LoadIR loadConstantIR = new LoadIR(this.sourceFile, token, null, false);
loadConstantIR.evalWithoutDispatch(ctx);
this.constantPool.put(token, ctx.pop());
}
}
Aggregations