Package org.rascalmpl.interpreter.staticErrors

Examples of org.rascalmpl.interpreter.staticErrors.UndeclaredAnnotation


  public <U extends IValue, V extends IValue> Result<U> setAnnotation(String annoName, Result<V> anno, Environment env) {
    Type annoType = env.getAnnotationType(getType(), annoName);

    if (getType() != getTypeFactory().nodeType()) {
      if (getType() != getTypeFactory().nodeType() && annoType == null) {
        throw new UndeclaredAnnotation(annoName, getType(), ctx.getCurrentAST());
      }
      if (!anno.getType().isSubtypeOf(annoType)){
        throw new UnexpectedType(annoType, anno.getType(), ctx.getCurrentAST());
      }
    }
View Full Code Here


  @Override
  public <U extends IValue> Result<U> getAnnotation(String annoName, Environment env) {
    Type annoType = env.getAnnotationType(getType(), annoName);
 
    if (annoType == null) {
      throw new UndeclaredAnnotation(annoName, getType(), ctx.getCurrentAST());
    }
 
    IValue annoValue = getValue().asAnnotatable().getAnnotation(annoName);
    if (annoValue == null) {
      throw RuntimeExceptionFactory.noSuchAnnotation(annoName, ctx.getCurrentAST(), null);
View Full Code Here

      if (result == null || result.getValue() == null) {
        throw new UninitializedVariable(label, this.getReceiver());
      }

      if (!__eval.__getEnv().declaresAnnotation(result.getType(), label)) {
        throw new UndeclaredAnnotation(label, result.getType(),
            this);
      }

      try {
        __eval.__setValue(__eval.newResult(result.getAnnotation(label,
View Full Code Here

      Result<IValue> receiver = this.getReceiver().interpret(__eval);
      String label = Names.name(this.getAnnotation());

      if (!__eval.getCurrentEnvt().declaresAnnotation(receiver.getType(),
          label)) {
        throw new UndeclaredAnnotation(label, receiver.getType(),
            this);
      }

      Type type = __eval.getCurrentEnvt().getAnnotationType(
          receiver.getType(), label);
View Full Code Here

  @Override
  public <U extends IValue> Result<U> getAnnotation(String annoName, Environment env) {
    Type annoType = env.getAnnotationType(getType(), annoName);
 
    if (annoType == null) {
      throw new UndeclaredAnnotation(annoName, getType(), ctx.getCurrentAST());
    }
 
    IValue annoValue = getValue().asAnnotatable().getAnnotation(annoName);
    if (annoValue == null) {
      throw RuntimeExceptionFactory.noSuchAnnotation(annoName, ctx.getCurrentAST(), null);
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.staticErrors.UndeclaredAnnotation

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.