Package xbird.xquery.expr.var.Variable

Examples of xbird.xquery.expr.var.Variable.PreEvaluatedVariable


            this._analyzed = true;
            final XQExpression analyzed = bindingVar.staticAnalysis(statEnv);
            if(analyzed instanceof Evaluable) {
                final Sequence<? extends Item> src = analyzed.eval(null, DynamicContext.DUMMY);
                final Sequence<? extends Item> evaluated = effectiveBooleanValue(src, null, DynamicContext.DUMMY);
                return new PreEvaluatedVariable(evaluated);
            } else if(TypeUtil.subtypeOf(SequenceType.EMPTY, bindingVar.getType())) {
                final boolean isEvery = every;
                return new LiteralExpr(isEvery ? BooleanValue.TRUE : BooleanValue.FALSE);
            }
            this.condExpr = condExpr.staticAnalysis(statEnv);
View Full Code Here


    // helper

    protected AbstractXQExpression optimize(StaticContext ctxt) throws XQueryException {
        if(_leftOperand instanceof Evaluable && _rightOperand instanceof Evaluable) {
            Sequence<? extends Item> eagerEvaluated = eval(null, DynamicContext.DUMMY);
            return new PreEvaluatedVariable(eagerEvaluated);
        }
        // switch operand
        Type rtype = _rightOperand.getType();
        Type ltype = _leftOperand.getType();
        if(rtype instanceof AtomicType) {
View Full Code Here

            func.staticAnalysis(statEnv, _params);
            this._type = func.getReturnType(_params);
            final EvaluationPolicy evalPolicy = func.getEvaluationPolicy();
            if(evalPolicy == EvaluationPolicy.eager) {
                Sequence preEvaled = eval(ValueSequence.EMPTY_SEQUENCE, new DynamicContext(statEnv));
                return new PreEvaluatedVariable(preEvaled, _type);
            } else if(evalPolicy == EvaluationPolicy.rewritten) {
                XQExpression rewritted = func.rewrite(_params, statEnv);
                XQExpression analyzed = rewritted.staticAnalysis(statEnv);
                return analyzed;
            } else if(evalPolicy == EvaluationPolicy.threaded) {
View Full Code Here

        op.staticAnalysis(statEnv, _leftOperand, _rightOperand);
        this._op = op;
        if(_leftOperand instanceof Evaluable && _rightOperand instanceof Evaluable) {
            // apply eagar evaluation
            final Sequence<? extends Item> evaluated = eval(null, DynamicContext.DUMMY);
            return new PreEvaluatedVariable(evaluated);
        }
        this._type = op.getReturnType();
        return this;
    }
View Full Code Here

            func.staticAnalysis(statEnv, _params);
            this._type = func.getReturnType(_params);
            final EvaluationPolicy evalPolicy = func.getEvaluationPolicy();
            if(evalPolicy == EvaluationPolicy.eager) {
                Sequence preEvaled = eval(ValueSequence.EMPTY_SEQUENCE, new DynamicContext(statEnv));
                return new PreEvaluatedVariable(preEvaled, _type);
            } else if(evalPolicy == EvaluationPolicy.rewritten) {
                XQExpression rewritted = func.rewrite(_params, statEnv);
                XQExpression analyzed = rewritted.staticAnalysis(statEnv);
                return analyzed;
            } else if(evalPolicy == EvaluationPolicy.threaded) {
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.var.Variable.PreEvaluatedVariable

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.