Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.ISetWriter.insertAll()


          && recursionGuard < 1000) {
        recursionGuard += 1;
        element = visitor.generate(type.getElementType());
      }

      writer.insertAll(set);

      if (element != null) {
        writer.insert(element);
      }
      return writer.done();
View Full Code Here


        elementType = elementType.lub(resultElem.getType());
        results.add(results.size(), resultElem.getValue());
      }
      Type resultType = TF.setType(elementType);
      ISetWriter w = __eval.__getVf().setWriter();
      w.insertAll(results);
      // Was: return makeResult(resultType, applyRules(w.done()));
      return org.rascalmpl.interpreter.result.ResultFactory.makeResult(
          resultType, w.done(), __eval);

    }
View Full Code Here

          && recursionGuard < 1000) {
        recursionGuard += 1;
        element = visitor.generate(type.getElementType());
      }

      writer.insertAll(set);

      if (element != null) {
        writer.insert(element);
      }
      return writer.done();
View Full Code Here

        List<IValue> elements = new ArrayList<IValue>(o.size());
        for (IValue e : o) {
          elements.add(e.accept(this));
        }
        ISetWriter writer = vf.relationWriter(calcLub(elements));
        writer.insertAll(elements);
        return writer.done();
      }

      @Override
      public IValue visitListRelation(IList o) throws RuntimeException {
View Full Code Here

        List<IValue> elements = new ArrayList<IValue>(o.size());
        for (IValue e : o) {
          elements.add(e.accept(this));
        }
        ISetWriter writer = vf.setWriter(calcLub(elements));
        writer.insertAll(elements);
        return writer.done();
      }
      @Override
      public IValue visitTuple(ITuple o) throws RuntimeException {
        IValue[] elements = new IValue[o.arity()];
View Full Code Here

  private int idNum = 0;

  public ITuple getGraph() {
    ISetWriter sw = vf.setWriter(tf.tupleType(tf.stringType(),
        tf.stringType(), tf.stringType(), tf.integerType()));
    sw.insertAll(ids.values());
    return vf.tuple(sw.done(), edges);
  }

  public IString addFact(IFact<?> fact, String name, int status) {
    if (!ids.containsKey(fact)) {
View Full Code Here

  @Override
  public <U extends IValue> Result<U> fieldAccess(String name, TypeStore store) {
    if (name.equals(type.getKeyLabel())) {
      ISetWriter w = getValueFactory().setWriter();
      w.insertAll(value);
      return makeResult(getTypeFactory().setType(type.getKeyType()), w.done(), ctx);
    }
    else if (name.equals(type.getValueLabel())) {
      ISetWriter w = getValueFactory().setWriter();
      Iterator<IValue> it = value.valueIterator();
View Full Code Here

       
        IConstructor choice = definitions.get(adt);
        ISetWriter alts = vf.setWriter();
       
        if (choice != null) {
          alts.insertAll((ISet) choice.get("alternatives"));
        }
       
        IListWriter w = vf.listWriter();
        if (type.hasFieldNames()) {
          for(int i = 0; i < type.getArity(); i++) {
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.