Examples of UnexpectedTokenException


Examples of scriptingLanguage.errors.UnexpectedTokenException

 
  @Override
  public Token eval(AbstractClass<?> caller, Token first, Token last, AbstractFrame frame) throws ArrayIndexOutOfBoundsException, IllegalArgumentException, InterpreterException {
    Variable<?> f = (Variable<?>) (first.getCar() instanceof String ? frame.readVariable((String) first.getCar()).getCar() : first.getCar());
    if (!(f instanceof AbstractObject<?>))
      throw new UnexpectedTokenException("Expected an object, got a " + f.getType() + ".  ");
    return f.eval(caller, (Token) last.getCar(), frame);
  }
View Full Code Here

Examples of scriptingLanguage.errors.UnexpectedTokenException

      case ">":
        return new Token(new PrimitiveObject<>(Interpreter.booleanClass, p[0].getType().compareValues(p[0].getSource(), p[1].getSource()) > 0), Interpreter.booleanType);
      case ">=":
        return new Token(new PrimitiveObject<>(Interpreter.booleanClass, p[0].getType().compareValues(p[0].getSource(), p[1].getSource()) >= 0), Interpreter.booleanType);
      default:
        throw new UnexpectedTokenException(data + " is not a valid relational operator.");
    }
  }
View Full Code Here

Examples of scriptingLanguage.errors.UnexpectedTokenException

    PrimitiveObject<?>[] p = Interpreter.castPrimitives((PrimitiveObject<?>) f, (PrimitiveObject<?>) l);
    if (data.equals("=="))
      return new Token(new PrimitiveObject<>(Interpreter.booleanClass, p[0].getType().compareValues(p[0].getSource(), p[1].getSource()) == 0), Interpreter.booleanType);
    if (data.equals("!="))
      return new Token(new PrimitiveObject<>(Interpreter.booleanClass, p[0].getType().compareValues(p[0].getSource(), p[1].getSource()) != 0), Interpreter.booleanType);
    throw new UnexpectedTokenException(data + " is not a valid equality operator.");
  }
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.