Examples of SequenceType


Examples of client.net.sf.saxon.ce.value.SequenceType

    private void checkAgainstRequiredType(ExpressionVisitor visitor)
    throws XPathException {
        // Note, in some cases we are doing this twice.
        RoleLocator role = new RoleLocator(RoleLocator.VARIABLE, variableQName, 0);
        //role.setSourceLocator(this);
        SequenceType r = requiredType;
        if (r != null && select != null) {
            // check that the expression is consistent with the required type
            select = TypeChecker.staticTypeCheck(select, requiredType, false, role, visitor);
        }
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

        }
       
        RoleLocator role =
                new RoleLocator(RoleLocator.INSTRUCTION, "analyze-string/select", 0);

        SequenceType required = (SequenceType.SINGLE_STRING);
                                    // see bug 7976
        select = TypeChecker.staticTypeCheck(select, required, false, role, visitor);
        role = new RoleLocator(RoleLocator.INSTRUCTION, "analyze-string/regex", 0);
        regex = TypeChecker.staticTypeCheck(regex, SequenceType.SINGLE_STRING, false, role, visitor);
        role = new RoleLocator(RoleLocator.INSTRUCTION, "analyze-string/flags", 0);
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

        }

        if (requiredType != null) {
            // if declaration is null, we've already done the type checking in a previous pass
            final TypeHierarchy th = visitor.getConfiguration().getTypeHierarchy();
            SequenceType decl = requiredType;
            SequenceType sequenceType = SequenceType.makeSequenceType(
                    decl.getPrimaryType(), StaticProperty.ALLOWS_ZERO_OR_MORE);
            RoleLocator role = new RoleLocator(RoleLocator.VARIABLE, variableName, 0
            );
            //role.setSourceLocator(this);
            sequence = TypeChecker.strictTypeCheck(
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

    /**
    * Notify all references to this variable of the data type
    */

    public void fixupReferences() throws XPathException {
        final SequenceType type = getRequiredType();
        final TypeHierarchy th = getConfiguration().getTypeHierarchy();
        final Iterator iter = references.iterator();
        while (iter.hasNext()) {
            Value constantValue = null;
            int properties = 0;
            if (this instanceof XSLVariable) {
                if (select instanceof Literal) {
                    // we can't rely on the constant value because it hasn't yet been type-checked,
                    // which could change it (eg by numeric promotion). Rather than attempt all the type-checking
                    // now, we do a quick check. See test bug64
                    int relation = th.relationship(select.getItemType(th), type.getPrimaryType());
                    if (relation == TypeHierarchy.SAME_TYPE || relation == TypeHierarchy.SUBSUMED_BY) {
                        constantValue = ((Literal)select).getValue();
                    }
                }
                if (select != null) {
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

        int newcard = cardinality & getCardinality();
        if (newcard==0) {
            // this will probably lead to a type error later
            newcard = getCardinality();
        }
        SequenceType seqType = SequenceType.makeSequenceType(newItemType, newcard);
        setStaticType(seqType, constantValue, properties);
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

        // "some" and "every" have no ordering constraints

        Optimizer opt = visitor.getConfiguration().getOptimizer();
        sequence = ExpressionTool.unsorted(opt, sequence, false);

        SequenceType decl = getRequiredType();
        SequenceType sequenceType = SequenceType.makeSequenceType(decl.getPrimaryType(),
                                             StaticProperty.ALLOWS_ZERO_OR_MORE);
        RoleLocator role = new RoleLocator(RoleLocator.VARIABLE, getVariableQName(), 0);
        //role.setSourceLocator(this);
        sequence = TypeChecker.strictTypeCheck(
                                sequence, sequenceType, role, visitor.getStaticContext());
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

                        if (param instanceof XSLParam &&
                                ((XSLParam)param).getVariableQName().equals(withParam.getVariableQName())
                                /* TODO spec bug 10934: && !((XSLParam)param).isTunnelParam() */
                                ) {
                            ok = true;
                            SequenceType required = ((XSLParam)param).getRequiredType();
                            withParam.checkAgainstRequiredType(required);
                            break;
                        }
                    }
                    if (!ok) {
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

    */

    public SequenceType getRequiredType() {
        // System.err.println("Get required type of $" + getVariableName());
        final TypeHierarchy th = getConfiguration().getTypeHierarchy();
        SequenceType defaultType = (requiredType==null ? SequenceType.ANY_SEQUENCE : requiredType);
        if (requiredType != null) {
            return requiredType;
        } else if (select!=null) {
            if (Literal.isEmptySequence(select)) {
                // returning Type.EMPTY gives problems with static type checking
View Full Code Here

Examples of client.net.sf.saxon.ce.value.SequenceType

    private Expression promote(Expression parent, Expression child) {
        final TypeHierarchy th = optimizer.getConfiguration().getTypeHierarchy();
        LetExpression let = new LetExpression();
        let.setVariableQName(new StructuredQName("zz", NamespaceConstant.SAXON, "zz" + let.hashCode()));
        SequenceType type = SequenceType.makeSequenceType(child.getItemType(th), child.getCardinality());
        let.setRequiredType(type);
        ExpressionTool.copyLocationInfo(containingExpression, let);
        let.setSequence(child);
        let.setEvaluationMode(
                Cardinality.allowsMany(child.getCardinality()) ?
View Full Code Here

Examples of net.percederberg.mibble.type.SequenceType

     */
    private void printType(MibType type, String indent, int smiVersion) {
        MibType         refType;
        Constraint      refCons;
        Constraint      typeCons;
        SequenceType    seqType;
        SequenceOfType  seqOfType;

        if (type.getReferenceSymbol() != null) {
            os.print(type.getReferenceSymbol().getName());
            refType = type.getReferenceSymbol().getType();
            refCons = getConstraint(refType);
            typeCons = getConstraint(type);
            if (typeCons != null && typeCons != refCons) {
                printConstraint(type, indent);
            }
        } else if (type instanceof SequenceType) {           
            seqType = (SequenceType) type;
            os.println("SEQUENCE {");
            printTypeElements(seqType.getAllElements(),
                              indent + "    ",
                              smiVersion);
            os.println();
            os.print(indent);
            os.print("}");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.