Package xbird.xquery.expr.var.BindingVariable

Examples of xbird.xquery.expr.var.BindingVariable.ForVariable


            return variablesHolder;
        }

        @Override
        public ForClause visit(ForClause clause, XQueryContext ctxt) throws XQueryException {
            ForVariable var = clause.getVariable();
            excludedVariableList.add(var);
            XQExpression e = var.getValue();
            e.visit(this, ctxt);
            return clause;
        }
View Full Code Here


    private final Map<LetClause, List<Binding>> _pullup = new IdentityHashMap<LetClause, List<Binding>>(4);

    public LoopInvariantsTransformer(FLWRExpr flwr, ForClause forClause) {
        this._flwr = flwr;
        this._forClause = forClause;
        ForVariable forVar = forClause.getVariable();
        this._loopForVar = forVar;
        this._loopPosVar = forClause.getPositionVariable();
        this._noFollowBefore = forVar.getBirthId();
    }
View Full Code Here

    private final ForVariable _forVariable;

    public FilteredPathIndexAcccessExpr(RewriteInfo info, Type type) {
        super(info, type);
        ForVariable fv = info.getForVariable();
        if(fv == null) {
            throw new IllegalStateException("for variable is not set.. bug?");
        }
        this._forVariable = fv;
    }
View Full Code Here

            this._statEnv = statEnv;
        }

        @Override
        public ForClause visit(ForClause clause, XQueryContext ctxt) throws XQueryException {
            ForVariable var = clause.getVariable();
            var.setInsideRemoteExpr(true);
            XQExpression e = clause.getExpression();
            e.visit(this, ctxt);
            return clause;
        }
View Full Code Here

    [35PositionalVar   ::= "at" "$" VarName
    ************************************************************************/
    final public List<Binding> parseForClause() throws ParseException, XQueryException {
        final List<Binding> fors;
        ForClause clause;
        ForVariable var;
        Type varType = null;
        XQExpression expr;
        currentToken = jj_consume_token(ForVariable);
        currentToken = jj_consume_token(VarName);
        QualifiedName varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
        var = new ForVariable(varName);
        currentModule.putVariable(varName, var);
        clause = new ForClause(var);
        locate(clause);
        switch(jj_nt.kind) {
            case As:
                //TypeDeclaration?
                currentToken = jj_consume_token(As);
                varType = parseSequenceType();
                var.setType(varType);
                break;
            default:
                jj_la1[68] = jj_gen;
                ;
        }
        switch(jj_nt.kind) {
            case AtWord:
                //PositionalVar?
                currentToken = jj_consume_token(AtWord);
                currentToken = jj_consume_token(VariableIndicator);
                currentToken = jj_consume_token(VarName);
                QualifiedName posVarName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
                PositionalVariable posVar = new PositionalVariable(posVarName);
                currentModule.putVariable(posVarName, posVar);
                clause.setPositionVariable(posVar);
                break;
            default:
                jj_la1[69] = jj_gen;
                ;
        }
        currentToken = jj_consume_token(In);
        expr = parseExprSingle();
        clause.setInExpr(expr);
        fors = new LinkedList<Binding>();
        fors.add(clause);
        label_10: while(true) {
            switch(jj_nt.kind) {
                case Comma:
                    ;
                    break;
                default:
                    jj_la1[70] = jj_gen;
                    break label_10;
            }
            //("," "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle)*
            currentToken = jj_consume_token(Comma);
            currentToken = jj_consume_token(VariableIndicator);
            currentToken = jj_consume_token(VarName);
            varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
            var = new ForVariable(varName);
            currentModule.putVariable(varName, var);
            clause = new ForClause(var);
            switch(jj_nt.kind) {
                case As:
                    //TypeDeclaration?
                    currentToken = jj_consume_token(As);
                    varType = parseSequenceType();
                    var.setType(varType);
                    break;
                default:
                    jj_la1[71] = jj_gen;
                    ;
            }
View Full Code Here

                                XQExpression argExpr = params.get(0);
                                colpath = argExpr.eval(null, DynamicContext.DUMMY).toString();
                            }

                            FLWRExpr newFlwr = new FLWRExpr();
                            ForVariable forVar = new ForVariable();
                            forVar.setValue(funcall);
                            newFlwr.addClause(new ForClause(forVar));
                            VarRef varref = new VarRef(forVar);
                            steps.set(0, varref);
                            newFlwr.setFilteredReturnExpr(pathExpr);
View Full Code Here

    private final Map<LetClause, List<Binding>> _pullup = new IdentityHashMap<LetClause, List<Binding>>(4);

    public LoopInvariantsTransformer(FLWRExpr flwr, ForClause forClause) {
        this._flwr = flwr;
        this._forClause = forClause;
        ForVariable forVar = forClause.getVariable();
        this._loopForVar = forVar;
        this._loopPosVar = forClause.getPositionVariable();
        this._noFollowBefore = forVar.getBirthId();
    }
View Full Code Here

     [35PositionalVar   ::= "at" "$" VarName
     ************************************************************************/
    final public List<Binding> parseForClause() throws ParseException, XQueryException {
        final List<Binding> fors;
        ForClause clause;
        ForVariable var;
        Type varType = null;
        XQExpression expr;
        currentToken = jj_consume_token(ForVariable);
        currentToken = jj_consume_token(VarName);
        QualifiedName varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
        var = new ForVariable(varName);
        currentModule.putVariable(varName, var);
        clause = new ForClause(var);
        locate(clause);
        switch(jj_nt.kind) {
            case As:
                //TypeDeclaration?
                currentToken = jj_consume_token(As);
                varType = parseSequenceType();
                var.setType(varType);
                break;
            default:
                jj_la1[65] = jj_gen;
                ;
        }
        switch(jj_nt.kind) {
            case AtWord:
                //PositionalVar?
                currentToken = jj_consume_token(AtWord);
                currentToken = jj_consume_token(VariableIndicator);
                currentToken = jj_consume_token(VarName);
                QualifiedName posVarName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
                PositionalVariable posVar = new PositionalVariable(posVarName);
                currentModule.putVariable(posVarName, posVar);
                clause.setPositionVariable(posVar);
                break;
            default:
                jj_la1[66] = jj_gen;
                ;
        }
        currentToken = jj_consume_token(In);
        expr = parseExprSingle();
        clause.setInExpr(expr);
        fors = new LinkedList<Binding>();
        fors.add(clause);
        label_9: while(true) {
            switch(jj_nt.kind) {
                case Comma:
                    ;
                    break;
                default:
                    jj_la1[67] = jj_gen;
                    break label_9;
            }
            //("," "$" VarName TypeDeclaration? PositionalVar? "in" ExprSingle)*
            currentToken = jj_consume_token(Comma);
            currentToken = jj_consume_token(VariableIndicator);
            currentToken = jj_consume_token(VarName);
            varName = QNameUtil.parse(currentToken.image, namespaceContext, currentModule.getNamespace());
            var = new ForVariable(varName);
            currentModule.putVariable(varName, var);
            clause = new ForClause(var);
            switch(jj_nt.kind) {
                case As:
                    //TypeDeclaration?
                    currentToken = jj_consume_token(As);
                    varType = parseSequenceType();
                    var.setType(varType);
                    break;
                default:
                    jj_la1[68] = jj_gen;
                    ;
            }
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.var.BindingVariable.ForVariable

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.