Package org.eclipse.imp.pdb.facts

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


          }
          writer.append(getValueFactory().tuple(fieldValues));
        }
      }
      Type resultType = getTypeFactory().lrelTypeFromTuple(tupleType);
      return makeResult(resultType, writer.done(), ctx);
    }

    @Override
    protected <U extends IValue> Result<U> joinSet(SetResult that) {
      // Note the reverse of arguments, we need "that join this"
View Full Code Here


    TypeFactory tf = TypeFactory.getInstance();
    IListWriter writer = vf.listWriter(tf.realType());
    for (int i = 0; i < l.length; i++) {
      writer.append(vf.real(l[i]));
    }
    return writer.done();
  }

  private static LinearObjectiveFunction
    convertLinObjFun(IConstructor c) {
    double[] coefficients =  convertRealList(LLObjectiveFun_llObjFun_coefficients(c));
View Full Code Here

  private IList parsePlainCommandLineArgs(String[] commandline) {
    IListWriter w = vf.listWriter();
    for (String arg : commandline) {
      w.append(vf.string(arg));
    }
    return w.done();
  }

  public Map<String, IValue> parseKeywordCommandLineArgs(IRascalMonitor monitor, String[] commandline, AbstractFunction func) {
    Map<String, Expression> kwps = func.getKeywordParameterDefaults();
    Map<String, Type> expectedTypes = new HashMap<String,Type>();
View Full Code Here

         
          while (i + 1 < commandline.length && !commandline[i+1].startsWith("-")) {
            writer.append(parseCommandlineOption(func, expected.getElementType(), commandline[++i]));
          }
         
          params.put(label, writer.done());
        }
        else if (expected.isSubtypeOf(tf.setType(tf.valueType()))) {
          ISetWriter writer = vf.setWriter();
         
          while (i + 1 < commandline.length && !commandline[i+1].startsWith("-")) {
View Full Code Here

         
          while (i + 1 < commandline.length && !commandline[i+1].startsWith("-")) {
            writer.insert(parseCommandlineOption(func, expected.getElementType(), commandline[++i]));
          }
         
          params.put(label, writer.done());
        }
        else {
          params.put(label, parseCommandlineOption(func, expected, commandline[++i]));
        }
      }
View Full Code Here

       
        for (String key : type.getKeywordParameters()) {
          kwTypes.insert(vf.constructor(Factory.Symbol_Label, vf.string(key), type.getKeywordParameterType(key).accept(this)));
        }
       
        alts.insert(vf.constructor(Factory.Production_Cons, vf.constructor(Factory.Symbol_Label,  vf.string(type.getName()), adt), w.done(), kwTypes.done(), kwDefaults.done(), vf.set()));
        choice = vf.constructor(Factory.Production_Choice, adt, alts.done());
        definitions.put(adt, choice);
      }
     
     
View Full Code Here

            for (Type param : params) {
              w.append(param.accept(this));
            }
          }
         
          sym = vf.constructor(Factory.Symbol_Adt, vf.string(type.getName()), w.done());
          cache.put(type, sym);
       

          // make sure to find the type by the uninstantiated adt
          Type adt = store.lookupAbstractDataType(type.getName());
View Full Code Here

          for (Type f : type) {
            w.append(f.accept(this));
          }
        }

        return vf.constructor(Factory.Symbol_Tuple, w.done());
      }

      @Override
      public IValue visitValue(Type type) {
        return vf.constructor(Factory.Symbol_Value);
View Full Code Here

        IListWriter w = vf.listWriter();
        for (Type arg : externalType.getArgumentTypes()) {
          w.append(arg.accept(this));
        }
       
        return vf.constructor(Factory.Symbol_Func, externalType.getReturnType().accept(this), w.done());
      }

      private IValue visitReifiedType(ReifiedType externalType) {
        return vf.constructor(Factory.Symbol_ReifiedType, externalType.getTypeParameters().getFieldType(0).accept(this));
      }
View Full Code Here

        appendSeparators(args, result, delta, i);
        result.append(tree);
      }
    }
   
    return result.done();
  }

  private void appendSeparators(IList args, IListWriter result, int delta, int i) {
    for (int j = i - delta; j > 0 && j < i; j++) {
      result.append(args.get(j));
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.