Package xbird.xquery.expr.types

Examples of xbird.xquery.expr.types.TypeswitchExpr


    /************************************************************************
    [43] TypeswitchExpr ::= <"typeswitch" "("> Expr ")" CaseClause+
                "default" ("$" VarName)? "return" ExprSingle
    ************************************************************************/
    final public TypeswitchExpr parseTypeswitchExpr() throws ParseException, XQueryException {
        final TypeswitchExpr switchExpr;
        XQExpression expr = null;
        CaseClause cc = null;
        QualifiedName varName = null;
        currentToken = jj_consume_token(TypeswitchLpar);
        expr = parseExpr();
        switchExpr = new TypeswitchExpr(expr);
        locate(switchExpr);
        currentToken = jj_consume_token(Rpar);
        label_14: while(true) {
            cc = parseCaseClause();
            switchExpr.addCaseClause(cc);
            switch(jj_nt.kind) {
                case Case:
                    ;
                    break;
                default:
                    jj_la1[87] = jj_gen;
                    break label_14;
            }
        }
        currentModule.pushVarScope();
        currentToken = jj_consume_token(Default);
        switch(jj_nt.kind) {
            case VariableIndicator:
                currentToken = jj_consume_token(VariableIndicator);
                currentToken = jj_consume_token(VarName);
                varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
                break;
            default:
                jj_la1[88] = jj_gen;
                ;
        }
        currentToken = jj_consume_token(Return);
        expr = parseExprSingle();
        CaseVariable var = new CaseVariable(varName);
        CaseClause dc = new CaseClause(var, expr);
        switchExpr.setDefaultClause(dc);
        currentModule.popVarScope();
        {
            if(true)
                return switchExpr;
        }
View Full Code Here


    /************************************************************************
     [43] TypeswitchExpr ::= <"typeswitch" "("> Expr ")" CaseClause+
     "default" ("$" VarName)? "return" ExprSingle
     ************************************************************************/
    final public TypeswitchExpr parseTypeswitchExpr() throws ParseException, XQueryException {
        final TypeswitchExpr switchExpr;
        XQExpression expr = null;
        CaseClause cc = null;
        QualifiedName varName = null;
        currentToken = jj_consume_token(TypeswitchLpar);
        expr = parseExpr();
        switchExpr = new TypeswitchExpr(expr);
        locate(switchExpr);
        currentToken = jj_consume_token(Rpar);
        label_12: while(true) {
            cc = parseCaseClause();
            switchExpr.addCaseClause(cc);
            switch(jj_nt.kind) {
                case Case:
                    ;
                    break;
                default:
                    jj_la1[82] = jj_gen;
                    break label_12;
            }
        }
        currentModule.pushVarScope();
        currentToken = jj_consume_token(Default);
        switch(jj_nt.kind) {
            case VariableIndicator:
                currentToken = jj_consume_token(VariableIndicator);
                currentToken = jj_consume_token(VarName);
                varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
                break;
            default:
                jj_la1[83] = jj_gen;
                ;
        }
        currentToken = jj_consume_token(Return);
        expr = parseExprSingle();
        CaseVariable var = new CaseVariable(varName);
        CaseClause dc = new CaseClause(var, expr);
        switchExpr.setDefaultClause(dc);
        currentModule.popVarScope();
        {
            if(true)
                return switchExpr;
        }
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.types.TypeswitchExpr

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.