public Class getLeftEgressType() { return main.getEgressType(); }
public Class getLeftEgressType() { return main.getEgressType(); }
private static boolean isIntOptimizationviolation(BooleanNode bn, ASTNode bn2) { return (bn instanceof IntOptimized && bn2.getEgressType() != Integer.class); }
private static boolean isIntOptimizationviolation(BooleanNode bn, ASTNode bn2) { return (bn instanceof IntOptimized && bn2.getEgressType() != Integer.class); }
public void setRightMost(ASTNode right) { BinaryOperation n = this; while (n.right != null && n.right instanceof BinaryOperation) { n = (BinaryOperation) n.right; } n.right = right; if (n == this) { if ((rType = ParseTools.__resolveType(n.right.getEgressType())) == 0) rType = -1; } }
public void setRightMost(ASTNode right) { BinaryOperation n = this; while (n.right != null && n.right instanceof BinaryOperation) { n = (BinaryOperation) n.right; } n.right = right; if (n == this) { if ((rType = ParseTools.__resolveType(n.right.getEgressType())) == 0) rType = -1; } }
public void setRightMost(ASTNode right) { BinaryOperation n = this; while (n.right != null && n.right instanceof BinaryOperation) { n = (BinaryOperation) n.right; } n.right = right; if (n == this) { if ((rType = ParseTools.__resolveType(n.right.getEgressType())) == 0) rType = -1; } }
public static void expectType(ParserContext pCtx, ASTNode node, Class type, boolean compileMode) { Class retType = boxPrimitive(node.getEgressType()); if (compileMode) { if ((retType == null || !boxPrimitive(type).isAssignableFrom(retType)) && (!Object.class.equals(retType) && pCtx.isStrictTypeEnforcement())) { throw new CompileException("was expecting type: " + type.getName() + "; but found type: " + (retType != null ? retType.getName() : "<Unknown>"), new char[0], 0); } } else if (retType == null || !Object.class.equals(retType) && !boxPrimitive(type).isAssignableFrom(retType)) { throw new CompileException("was expecting type: " + type.getName() + "; but found type: " + (retType != null ? retType.getName() : "<Unknown>"), new char[0], 0); } }
public CompiledExpression(ASTLinkedList astMap, String sourceName, Class egressType, ParserConfiguration parserConfiguration, boolean literalOnly) { this.firstNode = astMap.firstNode(); this.sourceName = sourceName; this.knownEgressType = astMap.isSingleNode() ? astMap.firstNonSymbol().getEgressType() : egressType; this.literalOnly = literalOnly; this.parserConfiguration = parserConfiguration; this.importInjectionRequired = !parserConfiguration.getImports().isEmpty(); }
public static Accessor extractAccessor(ASTNode n) { if (n instanceof LiteralNode) return new ExecutableLiteral(n.getLiteralValue()); else return new ExecutableAccessor(n, n.getEgressType()); }
public CompiledExpression(ASTLinkedList astMap, String sourceName, Class egressType, ParserConfiguration parserConfiguration, boolean literalOnly) { this.firstNode = astMap.firstNode(); this.sourceName = sourceName; this.knownEgressType = astMap.isSingleNode() ? astMap.firstNonSymbol().getEgressType() : egressType; this.literalOnly = literalOnly; this.parserConfiguration = parserConfiguration; this.importInjectionRequired = !parserConfiguration.getImports().isEmpty(); }
public static Accessor extractAccessor(ASTNode n) { if (n instanceof LiteralNode) return new ExecutableLiteral(n.getLiteralValue()); else return new ExecutableAccessor(n, n.getEgressType()); }
public static Accessor extractAccessor(ASTNode n) { if (n instanceof LiteralNode) return new ExecutableLiteral(n.getLiteralValue()); else return new ExecutableAccessor(n, n.getEgressType()); }
public static Class getReturnType(ASTIterator input, boolean strongTyping) { ASTNode begin = input.firstNode(); if (begin == null) return Object.class; if (input.size() == 1) return begin.getEgressType(); return buildTree(input).getReturnType(strongTyping); }
public static Class getReturnType(ASTIterator input, boolean strongTyping) { ASTNode begin = input.firstNode(); if (begin == null) return Object.class; if (input.size() == 1) return begin.getEgressType(); return buildTree(input).getReturnType(strongTyping); }
public CompiledExpression(ASTLinkedList astMap, String sourceName, Class egressType, ParserContext ctx, boolean literalOnly) { this.firstNode = astMap.firstNode(); this.sourceName = sourceName; this.knownEgressType = astMap.isSingleNode() ? astMap.firstNonSymbol().getEgressType() : egressType; this.literalOnly = literalOnly; setParserContext(ctx); }
public static Class determineType(String name, CompiledExpression compiledExpression) { ASTIterator iter = new ASTLinkedList(compiledExpression.getFirstNode()); ASTNode node; while (iter.hasMoreNodes()) { if (name.equals((node = iter.nextNode()).getName()) && node.isAssignment()) { return node.getEgressType(); } } return null; }
public static Class determineType(String name, CompiledExpression compiledExpression) { ASTIterator iter = new ASTLinkedList(compiledExpression.getFirstNode()); ASTNode node; while (iter.hasMoreNodes()) { if (name.equals((node = iter.nextNode()).getName()) && node.isAssignment()) { return node.getEgressType(); } } return null; }
public static Class determineType(String name, CompiledExpression compiledExpression) { ASTIterator iter = new ASTLinkedList(compiledExpression.getFirstNode()); ASTNode node; while (iter.hasMoreNodes()) { if (name.equals((node = iter.nextNode()).getName()) && node.isAssignment()) { return node.getEgressType(); } } return null; }
public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { if (accessor != null) { return accessor.getValue(main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory); } else { AccessorOptimizer o = OptimizerFactory.getThreadAccessorOptimizer(); accessor = o.optimizeAccessor(getCurrentThreadParserContext(), name, main.getReducedValueAccelerated(ctx, thisValue, factory), thisValue, factory, false, main.getEgressType()); return o.getResultOptPass(); } }