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; }
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; }