Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IMapWriter.done()


    for (IValue i : imports) {
      URI uri = URIUtil.createRascalModule(((IString) i).getValue());
      mw.put(i, VF.sourceLocation(uri));
    }
   
    eval.getStdErr().println("locations: " + mw.done());
   
    return (IConstructor) eval.call(monitor, "linkImportedModules", moduleParseTree, mw.done());
  }
 
  public synchronized IConstructor checkModule(IRascalMonitor monitor, IConstructor moduleParseTree) {
View Full Code Here


      mw.put(i, VF.sourceLocation(uri));
    }
   
    eval.getStdErr().println("locations: " + mw.done());
   
    return (IConstructor) eval.call(monitor, "linkImportedModules", moduleParseTree, mw.done());
  }
 
  public synchronized IConstructor checkModule(IRascalMonitor monitor, IConstructor moduleParseTree) {
    IConstructor res = moduleParseTree;
//    res = resolveImports(monitor, res);
View Full Code Here

      private IMap makeMap(Map<String, String> headers) {
        IMapWriter writer = vf.mapWriter();
        for (Entry<String, String> entry : headers.entrySet()) {
          writer.put(vf.string(entry.getKey()), vf.string(entry.getValue()));
        }
        return writer.done();
      }

      private IConstructor makeMethod(Method method) {
        initMethodAndStatusValues(ctx);
        return methodValues.get(method);
View Full Code Here

  @Override
  public IValue visitMap(Type type) {
    IMapWriter writer = vf.mapWriter(); // type.writer(vf);

    if (maxDepth <= 0 || (stRandom.nextInt(2) == 0)) {
      return writer.done();
    } else {

      RandomValueTypeVisitor visitor = descend();
      IValue key = visitor.generate(type.getKeyType());
      IValue value = visitor.generate(type.getValueType());
View Full Code Here

      if (key != null && value != null) {
        writer.put(key, value);
      }

      writer.putAll((IMap) visitor.generate(type));
      return writer.done();
    }
  }

  @Override
  public IValue visitNode(Type type) {
View Full Code Here

      Type type = TF.mapType(keyType, valueType);
      IMapWriter w = __eval.__getVf().mapWriter();
      w.putAll(result);

      return org.rascalmpl.interpreter.result.ResultFactory.makeResult(
          type, w.done(), __eval);

    }

    @Override
    public Type typeOf(Environment env, boolean instantiateTypeParameters, IEvaluator<Result<IValue>> eval) {
View Full Code Here

          String[] keyValue = param.split("=");
          res.put(vf.string(keyValue[0]), vf.string(keyValue[1]));
        }
      }
     
      IMap map = res.done();
      return makeResult(map.getType(), map, ctx);
    }

    default:
      throw new UndeclaredField(name, getTypeFactory().sourceLocationType(), ctx.getCurrentAST());
View Full Code Here

      IMapWriter w = values.mapWriter(Node, Node);
      Map<Object, Object> m = (Map<Object,Object>)obj;
      for (Map.Entry<Object,Object> e: m.entrySet()) {
        w.put(loadRec(e.getKey(), anchors, visited, ctx), loadRec(e.getValue(), anchors, visited, ctx));
      }
      result = values.constructor(Node_mapping, w.done());
    }
    else {
      throw RuntimeExceptionFactory.illegalArgument(
          values.string(obj.toString() + " (class=" + obj.getClass() + ")"),
          ctx.getCurrentAST(), ctx.getStackTrace());
View Full Code Here

  @Override
  public IValue visitMap(Type type) {
    IMapWriter writer = vf.mapWriter(); // type.writer(vf);

    if (maxDepth <= 0 || (stRandom.nextInt(2) == 0)) {
      return writer.done();
    } else {

      RandomValueTypeVisitor visitor = descend();
      IValue key = visitor.generate(type.getKeyType());
      IValue value = visitor.generate(type.getValueType());
View Full Code Here

      if (key != null && value != null) {
        writer.put(key, value);
      }

      writer.putAll((IMap) visitor.generate(type));
      return writer.done();
    }
  }

  @Override
  public IValue visitNode(Type type) {
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.