Package xbird.xquery.misc.QNameTable

Examples of xbird.xquery.misc.QNameTable.QualifiedName


                    return false;
                }
                if(verifyType == TEXT_MATCH) {
                    continue;
                }
                final QualifiedName otherName = otherPatterns.get(oi);
                final QualifiedName verifyName = verifyPatterns.get(vi);
                if(!verifyName.equals(otherName)) {
                    return false;
                }
            } else if(verifyType == ELEM_WILDCARD) {
                final int otherType = otherTypes.elementAt(oi);
                if((otherType & ELEMENT) != ELEMENT) {
View Full Code Here


    public String toString() {
        final StringBuilder buf = new StringBuilder(128);
        final int ptnlen = patterns.size();
        for(int i = 0; i < ptnlen; i++) {
            buf.append('/');
            final QualifiedName qname = patterns.get(i);
            final int type = types.elementAt(i);
            if(qname == null) {
                if(type == SKIPPABLE) {
                    continue;
                } else if(type == TEXT) {
View Full Code Here

        boolean isCopyNamespacesDeclCalled = false;
        boolean isDefaultCollationDeclCalled = false;
        boolean isConstructionDeclCalled = false;
        boolean isOrderingModeDeclCalled = false;
        boolean isEmptyOrderingDeclCalled = false;
        QualifiedName optName = null;
        String optValue = null;
        label_1: while(true) {
            switch(jj_nt.kind) {
                case DeclareConstruction:
                case DeclareDefaultOrder:
View Full Code Here

     [110] TypeDeclaration ::= "as" SequenceType

     TODO: err:XPTY0004, err:XQST0054, err:XP0006
     ************************************************************************/
    final public void parseVarDecl() throws ParseException, XQueryException {
        final QualifiedName varName;
        Type varType = null;
        XQExpression valueExpr = null;
        boolean isExternal = false;
        currentToken = jj_consume_token(DefineVariable);
        // TODO spaces afrer "$"
        currentToken = jj_consume_token(VarName);
        varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
        switch(jj_nt.kind) {
            case As:
                currentToken = jj_consume_token(As);
                varType = parseSequenceType();
                break;
            default:
                jj_la1[22] = jj_gen;
                ;
        }
        switch(jj_nt.kind) {
            case ColonEquals:
                currentToken = jj_consume_token(ColonEquals);
                valueExpr = parseExprSingle();
                break;
            case External:
                currentToken = jj_consume_token(External);
                isExternal = true;
                break;
            default:
                jj_la1[23] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
        final Variable variable;
        if(isExternal) {
            Variable extVar = currentModule.getVariable(varName);
            if(extVar != null) {
                variable = extVar;
            } else {
                variable = ExpressionFactory.createExternalVariable(varName, currentModule);
                currentModule.putVariable(varName, variable);
            }
        } else { // internal
            if(isLibraryModule) {
                final String expectedNamespace = currentModule.getNamespace();
                if(expectedNamespace != null) {
                    if(!expectedNamespace.equals(varName.getNamespaceURI())) {
                        error("err:XQST0048");
                    }
                }
            }
            variable = currentModule.declareGlobalVariable(varName, valueExpr); // may causes err:XQ0049
View Full Code Here

     [23] FunctionDecl ::= <"declare" "function"> <QName "("> ParamList? (")" | (<")" "as"> SequenceType)) (EnclosedExpr | "external")
     [26] EnclosedExpr ::= "{" Expr "}"
     ************************************************************************/
    final public void parseFunctionDecl() throws ParseException, XQueryException {
        final UserFunction func;
        final QualifiedName funcName;
        List<ParametricVariable> paramList = Collections.<ParametricVariable> emptyList();
        Type returnType = Untyped.UNTYPED;
        final XQExpression funcBody;
        currentModule.pushVarScope();
        currentToken = jj_consume_token(DefineFunction);
        currentToken = jj_consume_token(QNameLpar);
        funcName = QNameUtil.parse(currentToken.image.substring(0, currentToken.image.length() - 1).trim(), namespaceContext, staticContext.getDefaultFunctionNamespace());
        switch(jj_nt.kind) {
            case VariableIndicator:
                paramList = parseParamList();
                break;
            default:
                jj_la1[24] = jj_gen;
                ;
        }
        switch(jj_nt.kind) {
            case Rpar:
                currentToken = jj_consume_token(Rpar);
                break;
            case RparAs:
                currentToken = jj_consume_token(RparAs);
                returnType = parseSequenceType();
                break;
            default:
                jj_la1[25] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
        final String nsuri = funcName.getNamespaceURI();
        if(isLibraryModule) {
            final String tn = currentModule.getNamespace();
            if(tn == null) { // sanity check
                error("err:XQST0046");
            }
View Full Code Here

     [25Param ::= "$" QName TypeDeclaration?
     [110] TypeDeclaration ::= "as" SequenceType
     ************************************************************************/
    final public List<ParametricVariable> parseParamList() throws ParseException, XQueryException {
        final List<ParametricVariable> paramList = new LinkedList<ParametricVariable>();
        QualifiedName paramName;
        ParametricVariable param;
        Type paramType = null;
        currentToken = jj_consume_token(VariableIndicator);
        currentToken = jj_consume_token(VarName);
        paramName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
View Full Code Here

                            default:
                                jj_la1[30] = jj_gen;
                                jj_consume_token(-1);
                                throw new ParseException();
                        }
                        QualifiedName itemName = QNameUtil.parse(currentToken.image, namespaceContext, staticContext.getDefaultElementNamespace());
                        itemType = TypeFactory.createAtomicType(itemName, staticContext);
                        break;
                    default:
                        jj_la1[31] = jj_gen;
                        jj_consume_token(-1);
View Full Code Here

     [132] ElementNameOrWildcard ::= ElementName | "*"
     [136] ElementName ::= QName
     [137] TypeName ::= QName
     ************************************************************************/
    final public ElementTest parseElementTest() throws ParseException, XQueryException {
        QualifiedName elementName = null;
        QualifiedName typeName = null;
        boolean isNillable = false;
        switch(jj_nt.kind) {
            case ElementType:
                currentToken = jj_consume_token(ElementType);
                break;
View Full Code Here

     [133] SchemaElementTest  ::= <"schema-element" "("> ElementDeclaration ")"
     [134] ElementDeclaration ::= ElementName
     [136] ElementName        ::= QName
     ************************************************************************/
    final public SchemaElementTest parseSchemaElementTest() throws ParseException, XQueryException {
        QualifiedName elementName = null;
        switch(jj_nt.kind) {
            case SchemaElementType:
                currentToken = jj_consume_token(SchemaElementType);
                break;
            case SchemaElementTypeForKindTest:
View Full Code Here

     [128] AttribNameOrWildcard ::= AttributeName | "*"
     [135] AttributeName      ::= QName
     [137] TypeName              ::= QName
     ************************************************************************/
    final public AttributeTest parseAttributeTest() throws ParseException, XQueryException {
        QualifiedName attributeName = null;
        QualifiedName typeName = null;
        switch(jj_nt.kind) {
            case AttributeType:
                currentToken = jj_consume_token(AttributeType);
                break;
            case AttributeTypeForKindTest:
View Full Code Here

TOP

Related Classes of xbird.xquery.misc.QNameTable.QualifiedName

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.