Package xbird.xquery.expr

Examples of xbird.xquery.expr.XQExpression


        }
        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);
        }
        return 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);
        }
        return expr;
View Full Code Here

    public XQExpression visit(CommentConstructor constructor, XQueryContext ctxt)
            throws XQueryException {
        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);
            return hookLoopInvariant(constructor);
        }
        return constructor;
    }
View Full Code Here

        return constructor;
    }

    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) {
            removeInvariants(left);
            removeInvariants(right);
            return hookLoopInvariant(comp);
        }
View Full Code Here

        return comp;
    }

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

        }
        return call;
    }

    public XQExpression visit(DistinctSortExpr expr, XQueryContext ctxt) throws XQueryException {
        XQExpression step = expr.getStepExpr();
        assert (step != null);
        step.visit(this, ctxt);
        boolean isLoopInvariant = step.isLoopInvariant();
        if(isLoopInvariant) {
            removeInvariants(step);
            return hookLoopInvariant(expr);
        }
        return expr;
View Full Code Here

        return expr;
    }

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

    public XQExpression visit(ElementConstructor constructor, XQueryContext ctxt)
            throws XQueryException {
        boolean isLoopInvariant = true;
        String name = constructor.getElemName();
        if(name == null) {
            XQExpression nameExpr = constructor.getNameExpr();
            nameExpr.visit(this, ctxt);
            isLoopInvariant &= nameExpr.isLoopInvariant();
        }
        for(AttributeConstructorBase att : constructor.getAttributes()) {
            att.visit(this, ctxt);
            isLoopInvariant &= att.isLoopInvariant();
        }
        for(XQExpression v : constructor.getContents()) {
            v.visit(this, ctxt);
            isLoopInvariant &= v.isLoopInvariant();
        }
        if(isLoopInvariant) {
            if(name != null) {
                XQExpression nameExpr = constructor.getNameExpr();
                removeInvariants(nameExpr);
                for(AttributeConstructorBase att : constructor.getAttributes()) {
                    removeInvariants(att);
                }
                for(XQExpression v : constructor.getContents()) {
View Full Code Here

    public XQExpression visit(ExpressionProxy proxy, XQueryContext ctxt) throws XQueryException {
        return proxy;
    }

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

        return var;
    }

    public XQExpression visit(FilterExpr expr, XQueryContext ctxt) throws XQueryException {
        boolean isLoopInvariant = true;
        XQExpression e = expr.getSourceExpr();
        e.visit(this, ctxt);
        isLoopInvariant &= e.isLoopInvariant();
        for(XQExpression p : expr.getPredicates()) {
            p.visit(this, ctxt);
            isLoopInvariant &= p.isLoopInvariant();
        }
        if(isLoopInvariant) {
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.XQExpression

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.