Package org.eclipse.imp.pdb.facts

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


      for(int j = first; j >= 0 && j > end && j < getValue().arity(); j += increment){
        w.append(getValue().get(j));
      }
    }
    TypeFactory tf = TypeFactory.getInstance();
    return makeResult(tf.listType(tf.valueType()), w.done(), ctx);
  }
 
  //////
 
  @Override
View Full Code Here


    IValueFactory VF = ValueFactoryFactory.getValueFactory();
    IListWriter w = VF.listWriter(elemType);
    for(Map.Entry<ISourceLocation, Count> e : sortData()){
      w.insert(VF.tuple(e.getKey(), VF.integer(e.getValue().getTicks())));
    }
    return w.done();
  }
 
  public void report() {
    List<Map.Entry<ISourceLocation, Count>> sortedData = sortData();
View Full Code Here

      }

      Type resultType = TF.listType(elementType);
      IListWriter w = __eval.__getVf().listWriter();
      w.appendAll(results);
      return org.rascalmpl.interpreter.result.ResultFactory.makeResult(resultType, w.done(), __eval);
    }

    @Override
    public Type typeOf(Environment env, boolean instantiateTypeParameters, IEvaluator<Result<IValue>> eval) {
      Type elementType = TF.voidType();
View Full Code Here

        i += getSeparatorCount(tree);
      } else {
        ++i;
      }
    }
    return writer.done();
  }

  private static int getSeparatorCount(IConstructor tree) {
    return SymbolAdapter.getSeparators(ProductionAdapter.getType(getProduction(tree))).length();
  }
View Full Code Here

        writer.append(kid);
      }
      // skip layout
      i++;
    }
    return writer.done();
  }

  public static boolean isCILiteral(IConstructor tree) {
    return isAppl(tree) ? ProductionAdapter
        .isCILiteral(getProduction(tree)) : false;
View Full Code Here

          IList p = searchCategory((IConstructor) q, category);
          writer.appendAll(p);
        }
      }
    }
    return writer.done();
  }

  public static boolean isRascalLexical(IConstructor tree) {
    return SymbolAdapter.isLex(getType(tree));
  }
View Full Code Here

    new Sorting(tmpArr, new Less((ICallableValue) cmpv)).shuffle().sort();


    IListWriter writer = values.listWriter();
    writer.append(tmpArr);
    return writer.done();
  }
 
  public IList sort(ISet l, IValue cmpv) {
    IValue[] tmpArr = new IValue[l.size()];
    int i = 0;
View Full Code Here

    IListWriter writer = values.listWriter();
    for(IValue v : tmpArr){
      writer.append(v);
    }
   
    return writer.done();
  }
 
  private IList makeUpTill(int from,int len){
    IListWriter writer = values.listWriter();
    for(int i = from ; i < len; i++){
View Full Code Here

  private IList makeUpTill(int from,int len){
    IListWriter writer = values.listWriter();
    for(int i = from ; i < len; i++){
      writer.append(values.integer(i));
    }
    return writer.done();
  }
 
  public IValue delete(IList lst, IInteger n)
  // @doc{delete -- delete nth element from list}
  {
View Full Code Here

          w.insert(lst.get(i));
          if(i == k){
            w.insert(elm);
          }
        }
        return w.done();
      }
     
    throw RuntimeExceptionFactory.indexOutOfBounds(n, null, null);
   }
 
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.