Package xbird.xquery.expr.path

Examples of xbird.xquery.expr.path.NodeTest


        }
        return constructor;
    }

    public XQExpression visit(AxisStep step, XQueryContext ctxt) throws XQueryException {
        NodeTest nt = step.getNodeTest();
        nt.visit(this, ctxt);
        boolean isLoopInvariant = nt.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(nt);
            return hookLoopInvariant(step);
        }
        return step;
View Full Code Here


        }
        return constructor;
    }

    public XQExpression visit(AxisStep step, XQueryContext ctxt) throws XQueryException {
        NodeTest nt = step.getNodeTest();
        assert (nt != null);
        nt.visit(this, ctxt);
        return step;
    }
View Full Code Here

              | ("following" "::")
    [73] AbbrevForwardStep ::= "@"? NodeTest
    ************************************************************************/
    final public AxisStep parseForwardStep() throws ParseException, XQueryException {
        int kind = AxisStep.CHILD;
        final NodeTest nodeTest;
        switch(jj_nt.kind) {
            case AxisAttribute:
            case AxisChild:
            case AxisDescendantOrSelf:
            case AxisDescendant:
View Full Code Here

              | ("ancestor-or-self" "::")
    [76] AbbrevReverseStep :: ".."
    ************************************************************************/
    final public AxisStep parseReverseStep() throws ParseException, XQueryException {
        final int kind;
        final NodeTest nodeTest;
        switch(jj_nt.kind) {
            case AxisAncestorOrSelf:
            case AxisAncestor:
            case AxisParent:
            case AxisPrecedingSibling:
View Full Code Here

    [77] NodeTest      ::= KindTest | NameTest
    [78] NameTest      ::= QName | Wildcard
    [79] Wildcard      ::= "*" | (NCName ":" "*") | ("*" ":" NCName)
    ************************************************************************/
    final public NodeTest parseNodeTest(int axis) throws ParseException, XQueryException {
        final NodeTest nt;
        NodeType kind = null;
        switch(jj_nt.kind) {
            case ElementType:
            case AttributeType:
            case SchemaElementType:
            case SchemaAttributeType:
            case CommentLparRpar:
            case TextLparRpar:
            case NodeLparRpar:
            case DocumentLpar:
            case ProcessingInstructionLpar:
            case ElementTypeForKindTest:
            case AttributeTypeForKindTest:
            case SchemaElementTypeForKindTest:
            case SchemaAttributeTypeForKindTest:
            case CommentLparRparForKindTest:
            case TextLparRparForKindTest:
            case NodeLparRparForKindTest:
            case DocumentLparForKindTest:
            case ProcessingInstructionLparForKindTest:
            case ElementTypeForDocumentTest:
            case SchemaElementTypeForDocumentTest:
                kind = parseKindTest();
                nt = new NodeTest(kind);
                break;
            default:
                jj_la1[134] = jj_gen;
                if(jj_2_2(3)) {
                    switch(jj_nt.kind) {
                        case QName:
                            //NameTest       
                            currentToken = jj_consume_token(QName);
                            QualifiedName name = QNameUtil.parse(currentToken.image, namespaceContext, staticContext.getDefaultElementNamespace());
                            nt = new NodeTest(axis, name);
                            break;
                        case NCNameColonStar:
                        case StarColonNCName:
                        case Star:
                            switch(jj_nt.kind) {
                                case Star:
                                    //Wildcard
                                    currentToken = jj_consume_token(Star);
                                    nt = new NodeTest(axis);
                                    break;
                                case NCNameColonStar:
                                    //NCName ":" "*"
                                    currentToken = jj_consume_token(NCNameColonStar);
                                    String prefix = currentToken.image.substring(0, currentToken.image.indexOf(':'));
                                    String uri = namespaceContext.getNamespaceURI(prefix);
                                    if(uri == null) {
                                        error("err:XPST0081");
                                    }
                                    name = QNameTable.instantiate(uri, NodeTest.ANY, prefix);
                                    nt = new NodeTest(axis, name);
                                    break;
                                case StarColonNCName:
                                    //"*" ":" NCName
                                    currentToken = jj_consume_token(StarColonNCName);
                                    String ncname = currentToken.image.substring(currentToken.image.indexOf(':') + 1);
                                    name = QNameTable.instantiate(XMLUtils.NULL_NS_URI, ncname, NodeTest.ANY);
                                    nt = new NodeTest(axis, name);
                                    break;
                                default:
                                    jj_la1[132] = jj_gen;
                                    jj_consume_token(-1);
                                    throw new ParseException();
View Full Code Here

        }
        return constructor;
    }

    public XQExpression visit(AxisStep step, XQueryContext ctxt) throws XQueryException {
        NodeTest nt = step.getNodeTest();
        nt.visit(this, ctxt);
        boolean isLoopInvariant = nt.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(nt);
            return hookLoopInvariant(step);
        }
        return step;
View Full Code Here

     | ("following" "::")
     [73] AbbrevForwardStep ::= "@"? NodeTest
     ************************************************************************/
    final public AxisStep parseForwardStep() throws ParseException, XQueryException {
        int kind = AxisStep.CHILD;
        final NodeTest nodeTest;
        switch(jj_nt.kind) {
            case AxisAttribute:
            case AxisChild:
            case AxisDescendantOrSelf:
            case AxisDescendant:
View Full Code Here

     | ("ancestor-or-self" "::")
     [76] AbbrevReverseStep :: ".."
     ************************************************************************/
    final public AxisStep parseReverseStep() throws ParseException, XQueryException {
        final int kind;
        final NodeTest nodeTest;
        switch(jj_nt.kind) {
            case AxisAncestorOrSelf:
            case AxisAncestor:
            case AxisParent:
            case AxisPrecedingSibling:
View Full Code Here

     [77] NodeTest      ::= KindTest | NameTest
     [78] NameTest      ::= QName | Wildcard
     [79] Wildcard      ::= "*" | (NCName ":" "*") | ("*" ":" NCName)
     ************************************************************************/
    final public NodeTest parseNodeTest(int axis) throws ParseException, XQueryException {
        final NodeTest nt;
        NodeType kind = null;
        switch(jj_nt.kind) {
            case ElementType:
            case AttributeType:
            case SchemaElementType:
            case SchemaAttributeType:
            case CommentLparRpar:
            case TextLparRpar:
            case NodeLparRpar:
            case DocumentLpar:
            case ProcessingInstructionLpar:
            case ElementTypeForKindTest:
            case AttributeTypeForKindTest:
            case SchemaElementTypeForKindTest:
            case SchemaAttributeTypeForKindTest:
            case CommentLparRparForKindTest:
            case TextLparRparForKindTest:
            case NodeLparRparForKindTest:
            case DocumentLparForKindTest:
            case ProcessingInstructionLparForKindTest:
            case ElementTypeForDocumentTest:
            case SchemaElementTypeForDocumentTest:
                kind = parseKindTest();
                nt = new NodeTest(kind);
                break;
            default:
                jj_la1[129] = jj_gen;
                if(jj_2_2(3)) {
                    switch(jj_nt.kind) {
                        case QName:
                            //NameTest       
                            currentToken = jj_consume_token(QName);
                            QualifiedName name = QNameUtil.parse(currentToken.image, namespaceContext, staticContext.getDefaultElementNamespace());
                            nt = new NodeTest(axis, name);
                            break;
                        case NCNameColonStar:
                        case StarColonNCName:
                        case Star:
                            switch(jj_nt.kind) {
                                case Star:
                                    //Wildcard
                                    currentToken = jj_consume_token(Star);
                                    nt = new NodeTest(axis);
                                    break;
                                case NCNameColonStar:
                                    //NCName ":" "*"
                                    currentToken = jj_consume_token(NCNameColonStar);
                                    String prefix = currentToken.image.substring(0, currentToken.image.indexOf(':'));
                                    String uri = namespaceContext.getNamespaceURI(prefix);
                                    if(uri == null) {
                                        error("err:XPST0081");
                                    }
                                    name = QNameTable.instantiate(uri, NodeTest.ANY, prefix);
                                    nt = new NodeTest(axis, name);
                                    break;
                                case StarColonNCName:
                                    //"*" ":" NCName
                                    currentToken = jj_consume_token(StarColonNCName);
                                    String ncname = currentToken.image.substring(currentToken.image.indexOf(':') + 1);
                                    name = QNameTable.instantiate(XMLConstants.NULL_NS_URI, ncname, NodeTest.ANY);
                                    nt = new NodeTest(axis, name);
                                    break;
                                default:
                                    jj_la1[127] = jj_gen;
                                    jj_consume_token(-1);
                                    throw new ParseException();
View Full Code Here

        }
        return constructor;
    }

    public XQExpression visit(AxisStep step, XQueryContext ctxt) throws XQueryException {
        NodeTest nt = step.getNodeTest();
        assert (nt != null);
        nt.visit(this, ctxt);
        return step;
    }
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.path.NodeTest

Copyright © 2018 www.massapicom. 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.