Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IInteger.intValue()


    for(IValue v : st){
      ITuple t = (ITuple) v;
      IInteger from = (IInteger) t.get(0);
      IInteger to = (IInteger) t.get(2);
      if(from.intValue() > r) r = from.intValue();
      if(to.intValue() > r) r = to.intValue();
    }
    return r + 1;
  }
 
  private void printTransitions(PrintStream fos, ISet st){
View Full Code Here


    for(IValue v : st){
      ITuple t = (ITuple) v;
      IInteger from = (IInteger) t.get(0);
      IInteger to = (IInteger) t.get(2);
      if(from.intValue() > r) r = from.intValue();
      if(to.intValue() > r) r = to.intValue();
    }
    return r + 1;
  }
 
  private void printTransitions(PrintStream fos, ISet st){
View Full Code Here

      fos.print('(');
      fos.print(from.intValue());
      fos.print(',');
      fos.print("\"" + act.getValue() + "\"");
      fos.print(',');
      fos.print(to.intValue());
      fos.print(')');
      fos.println();
    }
  }
 
View Full Code Here

    IInteger maxDepth = (IInteger) actuals[0];

    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

      throw new UnsupportedSubscript(type, null, ctx.getCurrentAST());
    if (!subsBase.getType().isInteger()){
      throw new UnsupportedSubscript(getTypeFactory().integerType(), subsBase.getType(), ctx.getCurrentAST());
    }
    IInteger index = (IInteger)subsBase.getValue();
    int idx = index.intValue();
    if(idx < 0){
      idx = idx + getValue().arity();
    }
    if ( (idx >= getValue().arity()) || (idx < 0)) {
      throw RuntimeExceptionFactory.indexOutOfBounds(index, ctx.getCurrentAST(), ctx.getStackTrace());
View Full Code Here

          b.append(escapeChar(from.intValue()));
        }
        else {
          b.append(escapeChar(from.intValue()));
          b.append("-");
          b.append(escapeChar(to.intValue()));
        }
      }
      b.append("]");
      return b.toString();
    }
View Full Code Here

    }
    if (getValue().getValue().length() == 0) {
      throw RuntimeExceptionFactory.illegalArgument(ctx.getCurrentAST(), ctx.getStackTrace());
    }
    IInteger index = ((IInteger)key.getValue());
    int idx = index.intValue();
    if(idx < 0){
      idx = idx + getValue().length();
    }
    if ( (idx >= getValue().length()) || (idx < 0) ) {
      throw RuntimeExceptionFactory.indexOutOfBounds(index, ctx.getCurrentAST(), ctx.getStackTrace());
View Full Code Here

  }

  public IInteger color(IString colorName, IReal alpha, IEvaluatorContext ctx) {
    IInteger c = colorNames.get(colorName.getValue().toLowerCase());
    if (c != null) {
      int ci = c.intValue();
      return vf.integer(figureColor(ci, alpha.floatValue()));
    }
    throw RuntimeExceptionFactory.illegalArgument(colorName, ctx.getCurrentAST(),
        ctx.getStackTrace());
  }
View Full Code Here

        if (getValue().length() == 0) {
          throw RuntimeExceptionFactory.emptyList(ctx.getCurrentAST(), ctx.getStackTrace());
        }
        IInteger index = (IInteger) subscripts[0].getValue();
       
        int idx = index.intValue();
        if(idx < 0){
          idx = idx + getValue().length();
        }
        if ( (idx >= getValue().length()) || (idx < 0) ) {
          throw RuntimeExceptionFactory.indexOutOfBounds(index, ctx.getCurrentAST(), ctx.getStackTrace());
View Full Code Here

    if (!((Result<IValue>)subscripts[0]).getType().isInteger()) {
      throw new UnexpectedType(getTypeFactory().integerType(),
          ((Result<IValue>)subscripts[0]).getType(), ctx.getCurrentAST());
    }
    IInteger index = ((IntegerResult)subscripts[0]).getValue();
    int idx = index.intValue();
    if (idx < 0){
      idx = idx + getValue().arity();
    }
    if ( (idx >= getValue().arity()) || (idx < 0)) {
      throw RuntimeExceptionFactory.indexOutOfBounds(index, ctx.getCurrentAST(), ctx.getStackTrace());
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.