/** * Type-check the expression. At this stage details of the static type must be known. * If the variable has a compile-time value, this is substituted for the variable reference */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { if (constantValue != null) { binding = null; return Literal.makeLiteral(constantValue); } // if (staticType == null) { // throw new IllegalStateException("Variable $" + getDisplayName() + " has not been fixed up"); // } if (binding instanceof Expression) { inLoop = visitor.isLoopingSubexpression((Expression)binding); // following code removed because it causes error181 to blow the stack - need to check for circularities well // if (binding instanceof GlobalVariable) { // ((GlobalVariable)binding).typeCheck(visitor, AnyItemType.getInstance()); // } } else if (binding instanceof UserFunctionParameter) { inLoop = visitor.isLoopingSubexpression(null); } return this; }
/** * Type-check the expression. At this stage details of the static type must be known. * If the variable has a compile-time value, this is substituted for the variable reference */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { if (constantValue != null) { binding = null; return Literal.makeLiteral(constantValue); } // if (staticType == null) { // throw new IllegalStateException("Variable $" + getDisplayName() + " has not been fixed up"); // } if (binding instanceof Expression) { inLoop = visitor.isLoopingSubexpression((Expression)binding); // following code removed because it causes error181 to blow the stack - need to check for circularities well // if (binding instanceof GlobalVariable) { // ((GlobalVariable)binding).typeCheck(visitor, AnyItemType.getInstance()); // } } else if (binding instanceof UserFunctionParameter) { inLoop = visitor.isLoopingSubexpression(null); } return this; }
/** * Type-check the expression. At this stage details of the static type must be known. * If the variable has a compile-time value, this is substituted for the variable reference */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { if (constantValue != null) { binding = null; return Literal.makeLiteral(constantValue); } // if (staticType == null) { // throw new IllegalStateException("Variable $" + getDisplayName() + " has not been fixed up"); // } if (binding instanceof Expression) { inLoop = visitor.isLoopingSubexpression((Expression)binding); // following code removed because it causes error181 to blow the stack - need to check for circularities well // if (binding instanceof GlobalVariable) { // ((GlobalVariable)binding).typeCheck(visitor, AnyItemType.getInstance()); // } } else if (binding instanceof UserFunctionParameter) { inLoop = visitor.isLoopingSubexpression(null); } return this; }
operand1 instanceof UserFunctionCall && th.isSubType(operand1.getItemType(th), BuiltInAtomicType.BOOLEAN) && !visitor.isLoopingSubexpression(null)) { Expression cond = Choose.makeConditional(operand0, operand1, Literal.makeLiteral(BooleanValue.FALSE)); ExpressionTool.copyLocationInfo(this, cond);
operand1 instanceof UserFunctionCall && th.isSubType(operand1.getItemType(th), BuiltInAtomicType.BOOLEAN) && !visitor.isLoopingSubexpression(null)) { Expression cond = Choose.makeConditional(operand0, operand1, Literal.makeLiteral(BooleanValue.FALSE)); ExpressionTool.copyLocationInfo(this, cond);
operand1 instanceof UserFunctionCall && th.isSubType(operand1.getItemType(th), BuiltInAtomicType.BOOLEAN) && !visitor.isLoopingSubexpression(null)) { Expression cond = Choose.makeConditional(operand0, operand1, Literal.makeLiteral(BooleanValue.FALSE)); ExpressionTool.copyLocationInfo(this, cond);