/** * Type-check the expression */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { operand = visitor.typeCheck(operand, contextItemType); return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { for (int i = 0; i < arguments.length; i++) { if (arguments[i] != null) { arguments[i] = visitor.typeCheck(arguments[i], contextItemType); } } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { base = visitor.typeCheck(base, contextItemType); return this; }
/** * The typeCheck method suppresses compile-time evaluation * @param visitor an expression visitor * @param contextItemType the static type of the context item * @return the expression after typechecking * @throws XPathException */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { operand = visitor.typeCheck(operand, contextItemType); return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { content = visitor.typeCheck(content, contextItemType); adoptChildExpression(content); return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { for (int i=0; i<components.length; i++) { components[i] = visitor.typeCheck(components[i], contextItemType); adoptChildExpression(components[i]); } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { child = visitor.typeCheck(child, contextItemType); adoptChildExpression(child); return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { select = visitor.typeCheck(select, contextItemType); adoptChildExpression(select); if (terminate != null) { terminate = visitor.typeCheck(terminate, contextItemType); adoptChildExpression(terminate); } return this; }
public static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { for (int i=0; i<params.length; i++) { Expression select = params[i].getSelectExpression(); if (select != null) { params[i].setSelectExpression(visitor.typeCheck(select, contextItemType)); } } }
/** * Type-check the expression */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { operand = visitor.typeCheck(operand, contextItemType); if (requiredCardinality == StaticProperty.ALLOWS_ZERO_OR_MORE || Cardinality.subsumes(requiredCardinality, operand.getCardinality())) { return operand; } return this; }
/** * Type-check the pattern. * Default implementation does nothing. This is only needed for patterns that contain * variable references or function calls. * @return the optimised Pattern */ public Pattern analyze(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { idExpression = visitor.typeCheck(idExpression, contextItemType); RoleLocator role = new RoleLocator(RoleLocator.FUNCTION, "id", 1); idExpression = TypeChecker.staticTypeCheck(idExpression, SequenceType.ATOMIC_SEQUENCE, false, role, visitor); return this; }
/** * Type-check the expression */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { operand = visitor.typeCheck(operand, contextItemType); if (requiredCardinality == StaticProperty.ALLOWS_ZERO_OR_MORE || Cardinality.subsumes(requiredCardinality, operand.getCardinality())) { return operand; } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { if (select != null) { select = visitor.typeCheck(select, contextItemType); adoptChildExpression(select); } checkAgainstRequiredType(visitor); return this; }
/** * Type-check the expression */ public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { operand = visitor.typeCheck(operand, contextItemType); if (requiredCardinality == StaticProperty.ALLOWS_ZERO_OR_MORE || Cardinality.subsumes(requiredCardinality, operand.getCardinality())) { return operand; } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { Expression oldop = operand; RoleLocator role = new RoleLocator(RoleLocator.UNARY_EXPR, "-", 0); operand = TypeChecker.staticTypeCheck(operand, SequenceType.OPTIONAL_NUMERIC, backwardsCompatible, role, visitor); operand = visitor.typeCheck(operand, contextItemType); if (operand != oldop) { adoptChildExpression(operand); } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { WithParam.typeCheck(actualParams, visitor, contextItemType); WithParam.typeCheck(tunnelParams, visitor, contextItemType); if (calledTemplateExpression != null) { calledTemplateExpression = visitor.typeCheck(calledTemplateExpression, contextItemType); adoptChildExpression(calledTemplateExpression); } return this; }
public Expression typeCheck(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { content = visitor.typeCheck(content, contextItemType); // TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy(); // ItemType contentItemType = content.getItemType(th); // contentMayContainAttributesOrNamespaces = // th.relationship(contentItemType, NodeKindTest.ATTRIBUTE) != TypeHierarchy.DISJOINT && // th.relationship(contentItemType, NodeKindTest.NAMESPACE) != TypeHierarchy.DISJOINT; adoptChildExpression(content); verifyLazyConstruction(); checkContentSequence(visitor.getStaticContext()); return this; }
/** * Type-check the pattern. * Default implementation does nothing. This is only needed for patterns that contain * variable references or function calls. * @return the optimised Pattern */ public Pattern analyze(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { idExpression = visitor.typeCheck(idExpression, contextItemType); RoleLocator role = new RoleLocator(RoleLocator.FUNCTION, "id", 1, visitor.getConfiguration().getNamePool()); idExpression = TypeChecker.staticTypeCheck(idExpression, SequenceType.ATOMIC_SEQUENCE, false, role, visitor); return this; }
public Expression optimize(ExpressionVisitor visitor, ItemType contextItemType) throws XPathException { WithParam.optimize(visitor, actualParams, contextItemType); WithParam.optimize(visitor, tunnelParams, contextItemType); select = visitor.typeCheck(select, contextItemType); // More info available second time around select = visitor.optimize(select, contextItemType); adoptChildExpression(select); if (Literal.isEmptySequence(select)) { return select; } return this; }