/** * Create an operator node. * * @param expr an char[] containing the expression * @param start the start offet for the token * @param end the end offset for the token * @return ASTNode */ private ASTNode createOperator(final char[] expr, final int start, final int end) { lastWasIdentifier = false; return lastNode = new OperatorNode(OPERATORS.get(new String(expr, start, end - start)), expr, start, pCtx); }
/** * Create an operator node. * * @param expr an char[] containing the expression * @param start the start offet for the token * @param end the end offset for the token * @return ASTNode */ private ASTNode createOperator(final char[] expr, final int start, final int end) { lastWasIdentifier = false; return lastNode = new OperatorNode(OPERATORS.get(new String(expr, start, end - start)), expr, start, pCtx); }
/** * Create an operator node. * @param expr * @param start * @param end * @return */ private ASTNode createOperator(final char[] expr, final int start, final int end) { lastWasIdentifier = false; return lastNode = new OperatorNode(OPERATORS.get(new String(expr, start, end - start))); }
return lastNode = new OperatorNode(OPERATORS.get(tmp));
return lastNode = new OperatorNode(OPERATORS.get(tmp), expr, st, pCtx);
return lastNode = new OperatorNode(OPERATORS.get(tmp), expr, st, pCtx);
OperatorNode operator = new OperatorNode((Integer) stk.pop(), expr, st, pCtx); Integer tkOp2 = (Integer) stk.pop(); astBuild.addTokenNode(new LiteralNode(getStackValueResult(), pCtx)); astBuild.addTokenNode(new OperatorNode(tkOp2, expr, st, pCtx), verify(pCtx, tkLA2)); return false;
private boolean compileReduce(int opCode, ASTLinkedList astBuild) { switch (arithmeticFunctionReduction(opCode)) { case -1: /** * The reduction failed because we encountered a non-literal, * so we must now back out and cleanup. */ stk.xswap_op(); astBuild.addTokenNode(new LiteralNode(stk.pop(), pCtx)); astBuild.addTokenNode( (OperatorNode) splitAccumulator.pop(), verify(pCtx, (ASTNode) splitAccumulator.pop()) ); return false; case -2: /** * Back out completely, pull everything back off the stack and add the instructions * to the output payload as they are. */ LiteralNode rightValue = new LiteralNode(stk.pop(), pCtx); OperatorNode operator = new OperatorNode((Integer) stk.pop(), expr, st, pCtx); astBuild.addTokenNode(new LiteralNode(stk.pop(), pCtx), operator); astBuild.addTokenNode(rightValue, (OperatorNode) splitAccumulator.pop()); astBuild.addTokenNode(verify(pCtx, (ASTNode) splitAccumulator.pop())); } return true; }
private boolean compileReduce(int opCode, ASTLinkedList astBuild) { switch (arithmeticFunctionReduction(opCode)) { case -1: /** * The reduction failed because we encountered a non-literal, * so we must now back out and cleanup. */ stk.xswap_op(); astBuild.addTokenNode(new LiteralNode(stk.pop())); astBuild.addTokenNode( (OperatorNode) splitAccumulator.pop(), verify(pCtx, (ASTNode) splitAccumulator.pop()) ); return false; case -2: /** * Back out completely, pull everything back off the stack and add the instructions * to the output payload as they are. */ LiteralNode rightValue = new LiteralNode(stk.pop()); OperatorNode operator = new OperatorNode((Integer) stk.pop()); astBuild.addTokenNode(new LiteralNode(stk.pop()), operator); astBuild.addTokenNode(rightValue, (OperatorNode) splitAccumulator.pop()); astBuild.addTokenNode(verify(pCtx, (ASTNode) splitAccumulator.pop())); } return true; }
astBuild.addTokenNode(new OperatorNode(tkOp2.getOperator(), expr, st, pCtx), verify(pCtx, tkLA2)); break;
astBuild.addTokenNode(new OperatorNode(tkOp2.getOperator(), expr, st, pCtx), verify(pCtx, tkLA2)); break;
splitAccumulator.push(tk, new OperatorNode(operator2, expr, st, pCtx)); return OP_OVERFLOW; splitAccumulator.push(nextToken, new OperatorNode(operator2, expr, st, pCtx)); return OP_OVERFLOW;
return lastNode = new OperatorNode(Operator.CONTAINS, expr, st, pCtx);
return lastNode = new OperatorNode(Operator.CONTAINS, expr, st, pCtx);
splitAccumulator.push(tk, new OperatorNode(operator2, expr, st, pCtx)); return OP_OVERFLOW;
splitAccumulator.push(new OperatorNode(operator2)); return tk instanceof Substatement ? -2 : OP_TERMINATE;
astBuild.addTokenNode(new OperatorNode(tkOp2.getOperator()), verify(pCtx, tkLA2)); break;