private static boolean isReductionOpportunity(ASTNode oper, ASTNode node) { ASTNode n = node; return (n != null && n.isLiteral() && (n = n.nextASTNode) != null && reducacbleOperator(n.getOperator()) && PTABLE[oper.getOperator()] <= PTABLE[n.getOperator()] && (n = n.nextASTNode) != null && n.isLiteral() && n.getLiteralValue() instanceof Number); }
private static boolean isReductionOpportunity(ASTNode oper, ASTNode node) { ASTNode n = node; return (n != null && n.isLiteral() && (n = n.nextASTNode) != null && reducacbleOperator(n.getOperator()) && PTABLE[oper.getOperator()] <= PTABLE[n.getOperator()] && (n = n.nextASTNode) != null && n.isLiteral() && n.getLiteralValue() instanceof Number); }
private static boolean isReductionOpportunity(ASTNode oper, ASTNode node) { ASTNode n = node; return (n != null && n.isLiteral() && (n = n.nextASTNode) != null && reducacbleOperator(n.getOperator()) && PTABLE[oper.getOperator()] <= PTABLE[n.getOperator()] && (n = n.nextASTNode) != null && n.isLiteral() && n.getLiteralValue() instanceof Number); }
else if (tk.isLiteral()) { sbuf.append("LITERAL :: ").append(tk.getLiteralValue()).append("'");
else if (tk.isLiteral()) { sbuf.append("LITERAL :: ").append(tk.getLiteralValue()).append("'");
else if (tk.isLiteral()) { sbuf.append("LITERAL :: ").append(tk.getLiteralValue()).append("'");
if (right.isLiteral() && canConvert(right.getEgressType(), left.getEgressType())) { this.right = new LiteralNode(convert(right.getReducedValueAccelerated(null, null, null), left.getEgressType())); if (this.left.isLiteral() && this.right.isLiteral()) { if (this.left.egressType == this.right.egressType) { lType = rType = ParseTools.__resolveType(left.egressType);
private static Serializable _optimizeTree(final CompiledExpression compiled) { /** * If there is only one token, and it's an identifier, we can optimize this as an accessor expression. */ if (compiled.isSingleNode()) { ASTNode tk = compiled.getFirstNode(); if (tk.isLiteral() && !tk.isThisVal()) { return new ExecutableLiteral(tk.getLiteralValue()); } return tk.canSerializeAccessor() ? new ExecutableAccessorSafe(tk, compiled.getKnownEgressType()) : new ExecutableAccessor(tk, compiled.getKnownEgressType()); } return compiled; }
private static Serializable _optimizeTree(final CompiledExpression compiled) { /** * If there is only one token, and it's an identifier, we can optimize this as an accessor expression. */ if (compiled.isSingleNode()) { ASTNode tk = compiled.getFirstNode(); if (tk.isLiteral() && !tk.isThisVal()) { return new ExecutableLiteral(tk.getLiteralValue()); } return tk.canSerializeAccessor() ? new ExecutableAccessorSafe(tk, compiled.getKnownEgressType()) : new ExecutableAccessor(tk, compiled.getKnownEgressType()); } return compiled; }
private static Serializable _optimizeTree(final CompiledExpression compiled) { /** * If there is only one token, and it's an identifier, we can optimize this as an accessor expression. */ if (compiled.isSingleNode()) { ASTNode tk = compiled.getFirstNode(); if (tk.isLiteral() && !tk.isThisVal()) { return new ExecutableLiteral(tk.getLiteralValue()); } return tk.canSerializeAccessor() ? new ExecutableAccessorSafe(tk, compiled.getKnownEgressType()) : new ExecutableAccessor(tk, compiled.getKnownEgressType()); } return compiled; }
if (right.isLiteral() && canConvert(left.getEgressType(), right.getEgressType())) { Class targetType = isAritmeticOperation(operation) ? egressType : left.getEgressType(); this.right = new LiteralNode(convert(right.getReducedValueAccelerated(null, null, null), targetType), pCtx); if (this.left.isLiteral() && this.right.isLiteral()) { if (this.left.egressType == this.right.egressType) { lType = rType = ParseTools.__resolveType(left.egressType);
if (lastNode.isLiteral() && lastNode.getLiteralValue() instanceof Class) { lastNode.discard();
if (lastNode.isLiteral() && lastNode.getLiteralValue() instanceof Class) { lastNode.discard();
right.getEgressType() == Double.class && ( left.getEgressType() == Float.class || left.getEgressType() == float.class ) ); if (right.isLiteral() && requiresConversion && canConvert(left.getEgressType(), right.getEgressType())) { Class targetType = isAritmeticOperation(operation) ? egressType : left.getEgressType(); this.right = new LiteralNode(convert(right.getReducedValueAccelerated(null, null, null), targetType), pCtx); if (this.left.isLiteral() && this.right.isLiteral()) { if (this.left.egressType == this.right.egressType) { lType = rType = ParseTools.__resolveType(left.egressType);
if (lastNode.isLiteral() && lastNode.getLiteralValue() instanceof Class) { lastNode.discard();
if (compileMode && !tk.isLiteral()) { splitAccumulator.push(tk, new OperatorNode(operator2, expr, st, pCtx)); return OP_OVERFLOW; if (compileMode && !nextToken.isLiteral()) { splitAccumulator.push(nextToken, new OperatorNode(operator2, expr, st, pCtx)); return OP_OVERFLOW; if (compileMode && !tk.isLiteral()) { stk.push(operator, tk); return OP_NOT_LITERAL;
if (compileMode && !tk.isLiteral()) {