public Class getKnownEgressType() { return stmt.getKnownEgressType(); } }
private Object[] executeAll(Object ctx, VariableResolverFactory vars) { if (length == 0) return GetterAccessor.EMPTY; Object[] vals = new Object[length]; for (int i = 0; i < length; i++) { vals[i] = parms[i].getValue(ctx, vars); } return vals; }
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { if (statement == null) { statement = (ExecutableStatement) subCompileExpression(expr, this.start, this.offset, pCtx); acc = (CompiledAccExpression) compileSetExpression(property.toCharArray(), statement.getKnownEgressType(), pCtx); } acc.setValue(ctx, thisValue, factory, ctx = statement.getValue(ctx, thisValue, factory)); return ctx; }
assert debug("subtoken[" + i + "] { " + new String(subtokens.get(i)) + " }"); preConvArgs[i] = args[i] = (es[i] = (ExecutableStatement) subCompileExpression(subtokens.get(i), pCtx)) .getValue(this.thisRef, this.thisRef, variableFactory); if (es[i].isExplicitCast()) argTypes[i] = es[i].getKnownEgressType(); argTypes[i] = es[i].getKnownEgressType(); if (argTypes[i] != null) continue; if (es[i].getKnownEgressType() == Object.class) { argTypes[i] = args[i] == null ? null : args[i].getClass(); argTypes[i] = es[i].getKnownEgressType(); ExecutableStatement cExpr; for (int i = 0; i < es.length; i++) { if ((cExpr = es[i]).getKnownIngressType() == null) { cExpr.setKnownIngressType(parameterTypes[i]); cExpr.computeTypeConversionRule(); if (!cExpr.isConvertableIngressEgress() && i < args.length) { args[i] = convert(args[i], paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs()));
if (!returnType.isAssignableFrom(c.getKnownEgressType()) && c.isLiteralOnly()) { if (canConvert(c.getKnownEgressType(), returnType)) { a.setValueStatement(new ExecutableLiteral(convert(c.getValue(null, null), returnType))); return tk; && unboxPrimitive(c.getKnownEgressType()).equals(returnType)) { "cannot assign type " + c.getKnownEgressType().getName() + " to " + returnType.getName());
for (int i = 0; i < es.length; i++) { cExpr = es[i]; if (cExpr.getKnownIngressType() == null) { cExpr.setKnownIngressType(paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs())); cExpr.computeTypeConversionRule(); if (!cExpr.isConvertableIngressEgress()) { args[i] = convert(args[i], paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs()));
try { args[i] = (es[i] = (ExecutableStatement) subCompileExpression(subtokens.get(i), pCtx)) .getValue(this.thisRef, thisRef, variableFactory); if (es[i].isExplicitCast()) argTypes[i] = es[i].getKnownEgressType(); argTypes[i] = es[i].getKnownEgressType(); if (es[i] instanceof ExecutableLiteral && ((ExecutableLiteral)es[i]).getLiteral() == null) { argTypes[i] = NullType.class; if (argTypes[i] != null) continue; if (es[i].getKnownEgressType() == Object.class) { argTypes[i] = args[i] == null ? null : args[i].getClass(); argTypes[i] = es[i].getKnownEgressType();
public ASTNode handleSubstatement(Substatement stmt) { if (stmt.getStatement() != null && stmt.getStatement().isLiteralOnly()) { return new LiteralNode(stmt.getStatement().getValue(null, null, null), pCtx); } else { return stmt; } }
public ForNode(char[] expr, int start, int offset, int blockStart, int blockEnd, int fields, ParserContext pCtx) { super(pCtx); boolean varsEscape = buildForEach(this.expr = expr, this.start = start, this.offset = offset, this.blockStart = blockStart, this.blockOffset = blockEnd, fields, pCtx); this.indexAlloc = pCtx != null && pCtx.isIndexAllocation(); if ((fields & COMPILE_IMMEDIATE) != 0 && compiledBlock.isEmptyStatement() && !varsEscape) { throw new RedundantCodeException(); } if (pCtx != null) { pCtx.popVariableScope(); } }
assert debug("subtoken[" + i + "] { " + new String(subtokens.get(i)) + " }"); preConvArgs[i] = args[i] = (es[i] = (ExecutableStatement) subCompileExpression(subtokens.get(i), pCtx)) .getValue(this.thisRef, this.thisRef, variableFactory); if (es[i].isExplicitCast()) argTypes[i] = es[i].getKnownEgressType(); argTypes[i] = es[i].getKnownEgressType(); if (argTypes[i] != null) continue; if (es[i].getKnownEgressType() == Object.class) { argTypes[i] = args[i] == null ? null : args[i].getClass(); argTypes[i] = es[i].getKnownEgressType(); ExecutableStatement cExpr; for (int i = 0; i < es.length; i++) { if ((cExpr = es[i]).getKnownIngressType() == null) { cExpr.setKnownIngressType(parameterTypes[i]); cExpr.computeTypeConversionRule(); if (!cExpr.isConvertableIngressEgress() && i < args.length) { args[i] = convert(args[i], paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs()));
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { if (statement == null) { statement = (ExecutableStatement) subCompileExpression(expr, this.start, this.offset, pCtx); acc = (CompiledAccExpression) compileSetExpression(property.toCharArray(), statement.getKnownEgressType(), pCtx); } acc.setValue(ctx, thisValue, factory, ctx = statement.getValue(ctx, thisValue, factory)); return ctx; }
if (!returnType.isAssignableFrom(c.getKnownEgressType()) && c.isLiteralOnly()) { if (canConvert(c.getKnownEgressType(), returnType)) { a.setValueStatement(new ExecutableLiteral(convert(c.getValue(null, null), returnType))); return tk; && unboxPrimitive(c.getKnownEgressType()).equals(returnType)) { "cannot assign type " + c.getKnownEgressType().getName() + " to " + returnType.getName(), expr, st);
for (int i = 0; i < es.length; i++) { cExpr = es[i]; if (cExpr.getKnownIngressType() == null) { cExpr.setKnownIngressType(paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs())); cExpr.computeTypeConversionRule(); if (!cExpr.isConvertableIngressEgress()) { args[i] = convert(args[i], paramTypeVarArgsSafe(parameterTypes, i, m.isVarArgs()));
try { args[i] = (es[i] = (ExecutableStatement) subCompileExpression(subtokens.get(i), pCtx)) .getValue(this.thisRef, thisRef, variableFactory); if (es[i].isExplicitCast()) argTypes[i] = es[i].getKnownEgressType(); argTypes[i] = es[i].getKnownEgressType(); if (es[i] instanceof ExecutableLiteral && ((ExecutableLiteral)es[i]).getLiteral() == null) { argTypes[i] = NullType.class; if (argTypes[i] != null) continue; if (es[i].getKnownEgressType() == Object.class) { argTypes[i] = args[i] == null ? null : args[i].getClass(); argTypes[i] = es[i].getKnownEgressType();
public ASTNode handleSubstatement(Substatement stmt) { if (stmt.getStatement() != null && stmt.getStatement().isLiteralOnly()) { return new LiteralNode(stmt.getStatement().getValue(null, null, null), pCtx); } else { return stmt; } }
public ForNode(char[] expr, int start, int offset, int blockStart, int blockEnd, int fields, ParserContext pCtx) { super(pCtx); boolean varsEscape = buildForEach(this.expr = expr, this.start = start, this.offset = offset, this.blockStart = blockStart, this.blockOffset = blockEnd, fields, pCtx); this.indexAlloc = pCtx != null && pCtx.isIndexAllocation(); if ((fields & COMPILE_IMMEDIATE) != 0 && compiledBlock.isEmptyStatement() && !varsEscape) { throw new RedundantCodeException(); } if (pCtx != null) { pCtx.popVariableScope(); } }
assert debug("subtoken[" + i + "] { " + subtokens[i] + " }"); preConvArgs[i] = args[i] = (es[i] = (ExecutableStatement) subCompileExpression(subtokens[i].toCharArray(), pCtx)) .getValue(this.ctx, this.thisRef, variableFactory); argTypes[i] = es[i].getKnownEgressType(); if (es[i].getKnownEgressType() == Object.class) { argTypes[i] = args[i] == null ? null : args[i].getClass(); argTypes[i] = es[i].getKnownEgressType(); ExecutableStatement cExpr; for (int i = 0; i < es.length; i++) { if ((cExpr = es[i]).getKnownIngressType() == null) { cExpr.setKnownIngressType(parameterTypes[i]); cExpr.computeTypeConversionRule(); if (!cExpr.isConvertableIngressEgress()) { args[i] = convert(args[i], parameterTypes[i]);
public Class getKnownEgressType() { return stmt.getKnownEgressType(); } }
/** * Executes a compiled expression. * * @param compiledExpression - * @param factory - * @return - * @see #compileExpression(String) */ public static Object executeExpression(final Object compiledExpression, final VariableResolverFactory factory) { return ((ExecutableStatement) compiledExpression).getValue(null, factory); }
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { if (statement == null) { statement = (ExecutableStatement) subCompileExpression(stmt); acc = (CompiledAccExpression) compileSetExpression(property.toCharArray(), statement.getKnownEgressType(), getCurrentThreadParserContext()); } acc.setValue(ctx, thisValue, factory, ctx = statement.getValue(ctx, thisValue, factory)); return ctx; }