Package lipstone.joshua.parser.exceptions

Examples of lipstone.joshua.parser.exceptions.InvalidOperationException


    } while (!(temp = temp.getNextConsCell()).isNull());
   
    BigDec limits[] = {BigDec.ZERO, BigDec.ZERO};
    temp = parser.run(parts.get(1));
    if (temp.getCarType() != ConsType.NUMBER)
      throw new InvalidOperationException("The second and third parameters for the integrate operation must both evaluate to a number", this, "integrate", parts);
    limits[0] = (BigDec) temp.getCar();
    temp = parser.run(parts.get(2));
    if (temp.getCarType() != ConsType.NUMBER)
      throw new InvalidOperationException("The second and third parameters for the integrate operation must both evaluate to a number", this, "integrate", parts);
    limits[1] = (BigDec) temp.getCar();
    if (limits[1] == limits[0])
      return BigDec.ZERO;
    if (limits[1].lt(limits[0])) {
      BigDec tempLim = limits[0];
View Full Code Here


  public boolean isRelativelyPrime(ConsCell num) throws ParserException {
    num = parser.run(num);
    ArrayList<ConsCell> parts = num.splitOnSeparator();
    BigDec num1 = BigDec.ZERO, num2 = BigDec.ZERO;
    if (parts.get(0).getCarType() != ConsType.NUMBER || parts.get(1).getCarType() != ConsType.NUMBER)
      throw new InvalidOperationException("Both arguments to isRelativelyPrime must be numbers.", this, null, null);
    return isRelativelyPrime(num1, num2);
  }
View Full Code Here

   * @return the resulting value or null if the operation was invalid
   * @throws ParserException
   */
  private ConsCell runOperation(ConsCell input, boolean fullEval) throws ParserException {
    if (input.getCdrType() != ConsType.CONS_CELL || input.getNextConsCell().isNull())
      throw new InvalidOperationException(lastPlugin, (String) input.getCar(), new ArrayList<ConsCell>());
    if (!operations.containsKey(input.getCar()))
      throw new InvalidOperationException(((String) input.getCar()) + " is not a valid operation.", lastPlugin, (String) input.getCar(),
          (input.getNextConsCell().getCarType() == ConsType.CONS_CELL ? (ConsCell) input.getNextConsCell().singular().getCar() : input.getNextConsCell().singular()).splitOnSeparator());
    lastPlugin = operations.get(input.getCar()).getPlugin();
    ConsCell current = input.getNextConsCell(), number = new ConsCell();
    boolean skipCheck = true;
    do {
View Full Code Here

TOP

Related Classes of lipstone.joshua.parser.exceptions.InvalidOperationException

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.