Examples of MapExpr


Examples of org.exist.xquery.functions.map.MapExpr

    AST __t341 = _t;
    org.exist.xquery.parser.XQueryAST tmp121_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
    match(_t,LITERAL_map);
    _t = _t.getFirstChild();
   
          MapExpr expr = new MapExpr(context);
          path.add(expr);
          step = expr;
       
    {
    _loop344:
    do {
      if (_t==null) _t=ASTNULL;
      if ((_t.getType()==COLON)) {
        AST __t343 = _t;
        org.exist.xquery.parser.XQueryAST tmp122_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
        match(_t,COLON);
        _t = _t.getFirstChild();
       
                  PathExpr key = new PathExpr(context);
                  PathExpr value = new PathExpr(context);
               
        step=expr(_t,key);
        _t = _retTree;
        step=expr(_t,value);
        _t = _retTree;
        expr.map(key, value);
        _t = __t343;
        _t = _t.getNextSibling();
      }
      else {
        break _loop344;
View Full Code Here

Examples of xbird.xquery.expr.ext.MapExpr

                                colpath = "/";
                            } else {
                                XQExpression argExpr = params.get(0);
                                colpath = argExpr.eval(null, DynamicContext.DUMMY).toString();
                            }
                            MapExpr mapExpr = new MapExpr(colpath, bindingVar, flwrExpr);
                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            } else if(expr instanceof PathExpr) {
                PathExpr pathExpr = (PathExpr) expr;
                List<XQExpression> steps = pathExpr.getSteps();
                if(steps.size() > 1) {
                    XQExpression firstStep = steps.get(0);
                    if(firstStep instanceof DirectFunctionCall) {
                        DirectFunctionCall funcall = (DirectFunctionCall) firstStep;
                        if(FnCollection.FUNC_NAME.equals(funcall.getFuncName())) {
                            List<XQExpression> params = funcall.getParams();
                            final String colpath;
                            if(params.isEmpty()) {
                                colpath = "/";
                            } else {
                                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);

                            MapExpr mapExpr = new MapExpr(colpath, forVar, newFlwr);
                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            }
        }
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.