Package org.renjin.eval

Examples of org.renjin.eval.EvalException


    } else {
      each = 1;
    }
    if(!IntVector.isNA(lengthOut)) {
      if(lengthOut < 0) {
        throw new EvalException("invalid 'length.out' argument");
      }
      resultLength = lengthOut;
    }

    if(times.length() > 1 && each > 1) {
      throw new EvalException("invalid 'times' argument");
    }

    /*
     * If there is no per-element times parameter,
     * and we have a large vector, then just return
View Full Code Here


    return this.attributes.copy().set(attributeName, newValue).build();
  }
 
  protected SEXP cloneWithNewAttributes(AttributeMap attributes) {
    if(attributes != AttributeMap.EMPTY) {
      throw new EvalException("cannot change/set attributes on " + getClass().getSimpleName());
    }
    return this;
  }
View Full Code Here

    return this;
  }

  @Override
  public String asString() {
    throw new EvalException("Cannot coerce " + getTypeName() + " to scalar string");
  }
View Full Code Here

    super("restart");
  }
 
  @Override
  public SEXP apply(Context context, Environment rho, FunctionCall call, PairList args) {
    throw new EvalException("restart is not yet implemented.");
  }
View Full Code Here

    // this is an .Internal function, so we need to go up one context.
    Context originalContext = context.getParent();
   
    Closure closure = originalContext.getClosure();
    if(closure == null) {
      throw new EvalException("Recall() must be called from within a closure");
    }
   
    PairList newArguments = (PairList)rho.getVariable(Symbols.ELLIPSES);
    FunctionCall newCall = new FunctionCall(originalContext.getCall().getFunction(), newArguments);
   
View Full Code Here

    catVector(vector);
  }

  @Override
  protected void unhandled(SEXP exp) {
    throw new EvalException(
        "argument of type '%s' cannot be handled by 'cat'", exp.getTypeName());
  }
View Full Code Here

            imaginarySum += z.getImaginary();
          }
        }

      } else {
        throw new EvalException("invalid 'type' (" + argument.getTypeName() + ") of argument");
      }
    }
    if(haveComplex) {
      return new ComplexArrayVector(new Complex(realSum, imaginarySum));
View Full Code Here

        }
        lastCell = null;
       
      } else if(isContinuation(line)) {
        if(lastCell == null) {
          throw new EvalException("Malformed DCF exception '%s'", line);
        } else {
          StringBuilder value = new StringBuilder();
          value.append(cells.get(lastCell));
          value.append(" ");
          value.append(line.trim());
View Full Code Here

  }

  private static String[] parseLine(String line) {
    int colon = line.indexOf(':');
    if(colon == -1) {
      throw new EvalException("Malformed DCF line: '" + line + "'");
    }
    String fieldName = line.substring(0, colon).trim();
    String value = line.substring(colon+1).trim();
    return new String[] { fieldName, value };
  }
View Full Code Here

        if(argument instanceof AtomicVector) {
          addVector(argument);
        } else if(recursive && argument instanceof ListVector) {
          addList((ListVector)argument);
        } else {
          throw new EvalException("invalid 'type' (%s) of argument", argument.getTypeName());
        }
      }
      return this;
    }
View Full Code Here

TOP

Related Classes of org.renjin.eval.EvalException

Copyright © 2018 www.massapicom. 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.