use of com.googlecode.aviator.code.interpreter.ir.SourceInfo in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onMethodInvoke.
@Override
public void onMethodInvoke(final Token<?> lookhead) {
final MethodMetaData methodMetaData = this.methodMetaDataStack.pop();
@SuppressWarnings("unchecked") final List<FunctionArgument> params = lookhead != null ? (List<FunctionArgument>) lookhead.getMeta(Constants.PARAMS_META, Collections.EMPTY_LIST) : Collections.<FunctionArgument>emptyList();
if (this.instance.getOptionValue(Options.CAPTURE_FUNCTION_ARGS).bool) {
int funcId = getNextFuncInvocationId();
getFuncsArgs().put(funcId, Collections.unmodifiableList(params));
methodMetaData.funcId = funcId;
}
emit(new SendIR(methodMetaData.methodName, methodMetaData.parameterCount, methodMetaData.token.getMeta(Constants.UNPACK_ARGS, false), methodMetaData.funcId, new SourceInfo(this.sourceFile, methodMetaData.token.getLineNo())));
}
use of com.googlecode.aviator.code.interpreter.ir.SourceInfo in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onJoinLeft.
@Override
public void onJoinLeft(final Token<?> lookhead) {
if (!OperationRuntime.containsOpFunction(this.compileEnv, OperatorType.AND)) {
emit(new AssertTypeIR(AssertTypes.Bool));
Label label = makeLabel();
pushLabel0(label);
this.instruments.add(new BranchIfIR(label, new SourceInfo(this.sourceFile, lookhead.getLineNo())));
emit(PopIR.INSTANCE);
}
}
use of com.googlecode.aviator.code.interpreter.ir.SourceInfo in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onTernaryLeft.
@Override
public void onTernaryLeft(final Token<?> lookhead) {
this.instruments.add(new GotoIR(peekLabel1(), new SourceInfo(this.sourceFile, lookhead.getLineNo())));
// emit(PopIR.INSTANCE);
Label label0 = popLabel0();
visitLabel(label0);
emit(PopIR.INSTANCE);
}
use of com.googlecode.aviator.code.interpreter.ir.SourceInfo in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onAndLeft.
@Override
public void onAndLeft(final Token<?> lookhead) {
if (!OperationRuntime.containsOpFunction(this.compileEnv, OperatorType.AND)) {
emit(new AssertTypeIR(AssertTypes.Bool));
Label label = makeLabel();
pushLabel0(label);
this.instruments.add(new BranchUnlessIR(label, new SourceInfo(this.sourceFile, lookhead.getLineNo())));
emit(PopIR.INSTANCE);
}
}
use of com.googlecode.aviator.code.interpreter.ir.SourceInfo in project aviatorscript by killme2008.
the class InterpretCodeGenerator method onTernaryBoolean.
@Override
public void onTernaryBoolean(final Token<?> lookhead) {
Label label0 = makeLabel();
pushLabel0(label0);
Label label1 = makeLabel();
pushLabel1(label1);
this.instruments.add(new BranchUnlessIR(label0, new SourceInfo(this.sourceFile, lookhead.getLineNo())));
emit(PopIR.INSTANCE);
}
Aggregations