Examples of VarRef


Examples of wyvern.targets.Common.wyvernIL.IL.Imm.VarRef

      BytecodeClass clas = (BytecodeClass) inv.getSource().accept(opVisitor);
      BytecodeValue val = clas.getContext().getValue(inv.getId());
      dest = (BytecodeRef) val;
    } else if(destExpr instanceof Immediate) {
      Immediate imm = (Immediate) destExpr;
      VarRef ref = (VarRef) imm.getInner();
      dest = (BytecodeRef) context.getValue(ref.getName());
    } else {
      throw new RuntimeException("assignment not using Inv or Imm");
    }
    BytecodeValue src = assign.getSrc().accept(visitor);
    dest.setValue(src);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

    public boolean equals(OrderSpec other) {
        XQExpression orderExpr = other.getKeyExpr();
        if(!(orderExpr instanceof VarRef)) {
            return false;
        }
        VarRef orderingVarRef = (VarRef) orderExpr;
        Variable orderingVar = orderingVarRef.getValue();
        if(orderingVar != groupingVariable) {
            return false;
        }
        if(other.getCollation() != getCollation()) {
            return false;
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

    public void testLookupFunction() throws XQueryException, IllegalAccessException,
            NoSuchFieldException, NoSuchMethodException, InvocationTargetException {
        // params
        Variable v1 = new Variable.GlobalVariable(QNameTable.instantiate("", "p1"), new LiteralExpr(new XDouble(4)));
        v1.setType(DoubleType.DOUBLE);
        VarRef p1 = new VarRef(v1);
        List<VarRef> params = new LinkedList<VarRef>();
        params.add(p1);
        // function
        QualifiedName fname = QNameTable.instantiate("java:java.lang.Math", "sqrt");
        Function f = new FunctionManager().lookupFunction(fname, params);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

        List params = function.getParameters();
        for(int i = 0; i < params.size(); i++) {
            if(i != 0) {
                buf.append(", ");
            }
            VarRef p = (VarRef) params.get(i);
            buf.append(p.toString());
        }
        buf.append(") ");
        Type returnType = function.getReturnType();
        if(returnType != null) {
            buf.append("as ");
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

                            leftSrc = ((CompositePath) leftSrc).getSourceExpr();
                        }
                        while(rightSrc instanceof CompositePath) {
                            rightSrc = ((CompositePath) rightSrc).getSourceExpr();
                        }
                        VarRef pathSrc = null;
                        XQExpression persistKeyExpr = null, searchKeyExpr = null;
                        if(leftSrc instanceof VarRef && !(rightSrc instanceof VarRef)) {
                            pathSrc = (VarRef) leftSrc;
                            persistKeyExpr = right;
                            searchKeyExpr = left;
                        } else if(rightSrc instanceof VarRef && !(leftSrc instanceof VarRef)) {
                            pathSrc = (VarRef) rightSrc;
                            persistKeyExpr = left;
                            searchKeyExpr = right;
                        }
                        if(pathSrc != null) {
                            if(isFirst) {
                                persistKeyExprs = new ArrayList<XQExpression>(4);
                                searchKeyExprs = new ArrayList<XQExpression>(4);
                            }
                            Variable pv = pathSrc.getValue();
                            if(pv instanceof BindingVariable) {
                                if(searchKeyExpr instanceof CompositePath
                                        && _currentForClause != null) {
                                    assert (_currentBindings != null);
                                    final LetVariable lv = new AnonymousLetVariable(searchKeyExpr);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

                QualifiedName vn = QNameUtil.parse(currentToken.image, namespaceContext, defaultNamespace);
                Variable var = currentModule.getVariable(vn);
                if(var == null) {
                    error("err:XPST0008");
                }
                expr = new VarRef(var);
                break;
            case Lpar:
                //ParenthesizedExpr
                currentToken = jj_consume_token(Lpar);
                switch(jj_nt.kind) {
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

                            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);

                            MapExpr mapExpr = new MapExpr(colpath, forVar, newFlwr);
                            return mapExpr.staticAnalysis(statEnv);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

            if(srcVar instanceof ForVariable) {
                return null; //TODO REVIEWME
            }
            final XQExpression srcExpr = srcVar.getValue();
            if(srcExpr instanceof VarRef) {
                VarRef ref = (VarRef) srcExpr;
                Variable var = ref.getValue();
                assert (var != null);
                return rewrite(var, filterExpr, statEnv);
            } else if(srcExpr instanceof Variable) {
                Variable var = (Variable) srcExpr;
                return rewrite(var, filterExpr, statEnv);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

                            leftSrc = ((CompositePath) leftSrc).getSourceExpr();
                        }
                        while(rightSrc instanceof CompositePath) {
                            rightSrc = ((CompositePath) rightSrc).getSourceExpr();
                        }
                        VarRef pathSrc = null;
                        XQExpression persistKeyExpr = null, searchKeyExpr = null;
                        if(leftSrc instanceof VarRef && !(rightSrc instanceof VarRef)) {
                            pathSrc = (VarRef) leftSrc;
                            persistKeyExpr = right;
                            searchKeyExpr = left;
                        } else if(rightSrc instanceof VarRef && !(leftSrc instanceof VarRef)) {
                            pathSrc = (VarRef) rightSrc;
                            persistKeyExpr = left;
                            searchKeyExpr = right;
                        }
                        if(pathSrc != null) {
                            if(isFirst) {
                                persistKeyExprs = new ArrayList<XQExpression>(4);
                                searchKeyExprs = new ArrayList<XQExpression>(4);
                            }
                            Variable pv = pathSrc.getValue();
                            if(pv instanceof BindingVariable) {
                                if(searchKeyExpr instanceof CompositePath
                                        && _currentForClause != null) {
                                    assert (_currentBindings != null);
                                    final LetVariable lv = new AnonymousLetVariable(searchKeyExpr);
View Full Code Here

Examples of xbird.xquery.expr.var.VarRef

                QualifiedName vn = QNameUtil.parse(currentToken.image, namespaceContext, defaultNamespace);
                Variable var = currentModule.getVariable(vn);
                if(var == null) {
                    error("err:XPST0008");
                }
                expr = new VarRef(var);
                break;
            case Lpar:
                //ParenthesizedExpr
                currentToken = jj_consume_token(Lpar);
                switch(jj_nt.kind) {
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.