Example #1
0
 public static NodeValue eval(Expr expr, Binding binding) {
   Context context = ARQ.getContext().copy();
   context.set(ARQConstants.sysCurrentTime, NodeFactoryExtra.nowAsDateTime());
   FunctionEnv env = new ExecutionContext(context, null, null, null);
   NodeValue r = expr.eval(binding, env);
   return r;
 }
Example #2
0
  public static String joinList(List<Expr> args, String sep) {
    if (args == null) return "<<Null list>>";

    if (args.size() == 0) return "<<Empty list>>";

    StringBuilder s = new StringBuilder();

    boolean first = true;

    for (Expr ex : args) {
      if (!first) s.append(sep);
      // Values are printed withquoting.
      if (ex instanceof NodeValue) {
        NodeValue nv = (NodeValue) ex;
        s.append(nv.asQuotedString());
      } else s.append(ex.toString());
      first = false;
    }
    return s.toString();
  }