Package org.eclipse.imp.pdb.facts

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


      if(seenValues.contains(val))
          throw RuntimeExceptionFactory.MultipleKey(val, null, null);
      seenValues.add(val);
      w.put(val, key);
    }
    return w.done();
  }
 
  public IValue invert(IMap M)
  //@doc{invert -- return map with key and value inverted; values are not unique and are collected in a set}
  {
View Full Code Here


   
    iter = M.entryIterator();
    for(IValue v : hm.keySet()){
      w.put(v, hm.get(v).done());
    }
    return w.done();
  }
 
  public IValue isEmpty(IMap M)
  //@doc{isEmpty -- is map empty?}
  {
View Full Code Here

      for(Entry<String, IValue> e : T.asWithKeywordParameters().getParameters().entrySet()){
        w.put(values.string(e.getKey()), e.getValue());
      }
    }
   
    return w.done();
  }

  public IValue getName(INode T)
  //@doc{getName -- get the function name of a node}
  {
View Full Code Here

   
    for (Entry<java.lang.String,IValue> entry : map.entrySet()) {
      w.put(values.string(entry.getKey()), entry.getValue());
    }
   
    return w.done();
  }
 
  public INode setAnnotations(INode node, IMap annotations) {
    java.util.Map<java.lang.String,IValue> map = new HashMap<java.lang.String,IValue>();
   
View Full Code Here

        }
        IList afterComments = extractComments(after);
        if (!afterComments.isEmpty()) {
          comments.put(values.integer(((INode)result).arity()), afterComments);
        }
        result = ((INode)result).asAnnotatable().setAnnotation("comments", comments.done());
      }
      return result;
    }
   
    if (TreeAdapter.isLexical(tree)) {
View Full Code Here

          aw.append(kid);
        }
      }
      args = aw.done();
      int length = args.length();
      IMap comments = cw.done();
     
//      // this could be optimized.
//      i = 0;
//      int length = args.length();
//      while (i < length) {
View Full Code Here

    IMapWriter mapWriter = values.mapWriter();
    for (IValue key : map.keySet()) {
      mapWriter.put(key, map.get(key).done());
    }
   
    return mapWriter.done();
  }
 
  public IMap index(IList s) {
    Map<IValue, ISetWriter> map = new HashMap<IValue, ISetWriter>(s.length());
   
View Full Code Here

    IMapWriter mapWriter = values.mapWriter();
    for (IValue key : map.keySet()) {
      mapWriter.put(key, map.get(key).done());
    }
   
    return mapWriter.done();
  }

  public IValue takeOneFrom(ISet st)
  // @doc{takeOneFrom -- remove an arbitrary element from a set,
  //      returns the element and the modified set}
View Full Code Here

   
    IMapWriter w = values.mapWriter();
    for(IValueWrap v : hm.keySet()){
      w.put(v.getValue(), hm.get(v).done());
    }
    return w.done();
  }
 
  public IValue toMapUnique(ISet st)
  // @doc{toMapUnique -- convert a set of tuples to a map; keys are unique}
  {
View Full Code Here

        throw RuntimeExceptionFactory.MultipleKey(key.getValue(), null, null);
      }
      seenKeys.add(key);
      w.put(key.getValue(), val);
    }
    return w.done();
  }

  public IValue toString(ISet st)
  // @doc{toString -- convert a set to a string}
  {
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.