Package xbird.xquery.expr

Examples of xbird.xquery.expr.XQExpression.visit()


        final XQExpression body = module.getExpression();
        if(body != null) {
            attrFeed("expression body");
            indentln();
            body.visit(this, ctxt);
            indent--;
        }

        return null;
    }
View Full Code Here


        XQExpression inExpr = variable.getValue();
        if(inExpr == null) {
            assert (variable instanceof PositionalVariable) : variable.getName();
            return variable; // TODO REVIEWME
        }
        inExpr.visit(this, ctxt);
        boolean isLoopInvariant = inExpr.isLoopInvariant();//TODO REVIEWME
        if(isLoopInvariant) {
            if(variable == _loopForVar || variable == _loopPosVar) {
                removeInvariants(inExpr);
                variable.setLoopInvariant(false);
View Full Code Here

        return null;
    }

    public XQExpression visit(CaseClause clause, XQueryContext ctxt) throws XQueryException {
        XQExpression e = clause.getReturnExpr();
        e.visit(this, ctxt);
        boolean isLoopInvariant = e.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(e);
            return hookLoopInvariant(clause);
        }
View Full Code Here

        return clause;
    }

    public XQExpression visit(CastableExpr expr, XQueryContext ctxt) throws XQueryException {
        XQExpression e = expr.getExpression();
        e.visit(this, ctxt);
        boolean isLoopInvariant = e.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(e);
            return hookLoopInvariant(expr);
        }
View Full Code Here

        return expr;
    }

    public XQExpression visit(CastExpr expr, XQueryContext ctxt) throws XQueryException {
        XQExpression e = expr.getExpression();
        e.visit(this, ctxt);
        boolean isLoopInvariant = e.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(e);
            return hookLoopInvariant(expr);
        }
View Full Code Here

        boolean isLoopInvariant = true;
        String content = constructor.getContent();
        if(content == null) {
            XQExpression contentExpr = constructor.getContentExpr();
            assert (contentExpr != null);
            contentExpr.visit(this, ctxt);
            isLoopInvariant &= constructor.isLoopInvariant();
        }
        if(isLoopInvariant) {
            XQExpression contentExpr = constructor.getContentExpr();
            removeInvariants(contentExpr);
View Full Code Here

    }

    public XQExpression visit(ComparisonOp comp, XQueryContext ctxt) throws XQueryException {
        boolean isLoopInvariant = true;
        XQExpression left = comp.getLeftOperand();
        left.visit(this, ctxt);
        isLoopInvariant &= left.isLoopInvariant();
        XQExpression right = comp.getRightOperand();
        right.visit(this, ctxt);
        isLoopInvariant &= right.isLoopInvariant();
        if(isLoopInvariant) {
View Full Code Here

        boolean isLoopInvariant = true;
        XQExpression left = comp.getLeftOperand();
        left.visit(this, ctxt);
        isLoopInvariant &= left.isLoopInvariant();
        XQExpression right = comp.getRightOperand();
        right.visit(this, ctxt);
        isLoopInvariant &= right.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(left);
            removeInvariants(right);
            return hookLoopInvariant(comp);
View Full Code Here

    }

    public XQExpression visit(CompositePath fragment, XQueryContext ctxt) throws XQueryException {
        boolean isLoopInvariant = true;
        XQExpression src = fragment.getSourceExpr();
        src.visit(this, ctxt);
        isLoopInvariant &= src.isLoopInvariant();
        if(!isLoopInvariant) {
            return fragment;
        }
        XQExpression filter = fragment.getFilterExpr();
View Full Code Here

        isLoopInvariant &= src.isLoopInvariant();
        if(!isLoopInvariant) {
            return fragment;
        }
        XQExpression filter = fragment.getFilterExpr();
        filter.visit(this, ctxt);
        isLoopInvariant &= filter.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(src);
            removeInvariants(filter);
            return hookLoopInvariant(fragment);
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.