Examples of IValue


Examples of org.eclipse.imp.pdb.facts.IValue

   
    return res;
  }
 
  public static IValue jdbc2pdbValue(ResultSet rs, int idx, IValueFactory vf) {
    IValue res = null;
   
    try {
      if (idx == 0 && rs.getInt(0) == 1219)
        System.err.println(rs.getDate(6));
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

        Type elementType = resultType.getType().getTypeParameters().getFieldType(0);
        int columns = elementType.getArity();

        ISetWriter sw = vf.setWriter(elementType);
        while (rs.next()) {
          IValue tupleValues[] = new IValue[columns];
          for (int idx = 0; idx < columns; ++idx) {
            tupleValues[idx] = JDBC.jdbc2pdbValue(rs, idx + 1, this.vf);
          }
          sw.insert(vf.tuple(tupleValues));
        }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

        ISetWriter sw = vf.setWriter(elementType);
        int columns = rs.getMetaData().getColumnCount();
       
        while (rs.next()) {
          IValue tupleValues[] = new IValue[columns];
          for (int idx = 0; idx < columns; ++idx) {
            tupleValues[idx] = JDBC.jdbc2pdbValue(rs, idx + 1, this.vf);
          }
          sw.insert(vf.tuple(tupleValues));
        }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

        Type elementType = resultType.getType().getTypeParameters().getFieldType(0);
        int columns = elementType.getArity();

        IListWriter lw = vf.listWriter(elementType);
        while (rs.next()) {
          IValue tupleValues[] = new IValue[columns];
          for (int idx = 0; idx < columns; ++idx) {
            tupleValues[idx] = JDBC.jdbc2pdbValue(rs, idx + 1, this.vf);
          }
          lw.append(vf.tuple(tupleValues));
        }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

  public IValue arbitrary(IValue type, IInteger depthLimit, IEvaluatorContext eval) {
    try {
      TypeParameterVisitor tpvisit = new TypeParameterVisitor();
      Type requestedType = Cobra.reifyType(type);
      HashMap<Type, Type> tpbindings = tpvisit.bindTypeParameters(requestedType);
      IValue result = quickcheck.arbitrary(requestedType,
          depthLimit.intValue(), eval.getCurrentEnvt().getRoot(),
          eval.getValueFactory(), tpbindings);
      return result;
    } catch (IllegalArgumentException e) {
      throw RuntimeExceptionFactory.illegalArgument(depthLimit,
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

    private Result<IValue> createVisitedDate(IEvaluator<Result<IValue>> eval, String datePart, org.rascalmpl.ast.JustDate.Lexical x) {
      try {
        datePart.replaceAll("-", "");

        StandardTextReader parser = new StandardTextReader();
        IValue result = parser.read(VF, new StringReader("$" + datePart));
        return makeResult(TF.dateTimeType(), result, eval);
      } catch (FactTypeUseException e) {
        throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
      } catch (FactParseError e) {
          throw new DateTimeSyntax(e.getMessage(), eval.getCurrentAST().getLocation());
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

    RandomValueTypeVisitor v = new RandomValueTypeVisitor(
        getValueFactory(), (ModuleEnvironment) getEnv().getRoot(),
        maxDepth.intValue(), generators, ctx.getCurrentEnvt().getTypeBindings());

    IValue returnVal = instantiatedReturnType.accept(v);

    return makeResult(instantiatedReturnType, returnVal, eval);

  }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

      IValueFactory vf, Map<Type, Type> typeParameters) {

    RandomValueTypeVisitor visitor = new RandomValueTypeVisitor(vf,
        (ModuleEnvironment) env, depthLimit, generators, typeParameters);

    IValue result = visitor.generate(type);
    if (result == null) {
      throw new IllegalArgumentException("No construction possible at this depth or less.");
    }
    return result;
  }
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

      try {
        Type[] actualTypes = new Type[formals.getArity()];
        for(int j = 0; j < types.length; j ++) {
          actualTypes[j] = types[j].instantiate(tpbindings);
        }
        IValue result = function.call(actualTypes, values, null).getValue();
        function.getEval().getStdOut().flush();
        if (!((IBool) result).getValue()) {
          reportFailed(fname, "test returns false", tpbindings, formals, values, out);
          return false;
        } else if (verbose && formals.getArity() > 0) {
View Full Code Here

Examples of org.eclipse.imp.pdb.facts.IValue

        out.println("\t" + key + " => " + tpbindings.get(key));
      }
    }
    out.println("Actual parameters:");
    for (int i = 0; i < formals.getArity(); i++) {
      IValue arg = values[i];
      out.println("\t" + formals.getFieldType(i) + " " + "=>" + arg);
    }
    out.println();
    return false;
  }
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.