Package org.rascalmpl.interpreter.staticErrors

Examples of org.rascalmpl.interpreter.staticErrors.UnexpectedType


      try {
        Result<IValue> cval = this.getCondition().interpret(__eval);

        if (!cval.getType().isBool()) {
          throw new UnexpectedType(TF.boolType(),
              cval.getType(), this);
        }

        if (cval.isTrue()) {
          return this.getThenExp().interpret(__eval);
View Full Code Here


          }
          else if (subscripts[i] == null || relFieldType.comparable(subscriptType[i])){
            subscriptIsSet[i] = false;
          }
          else {
            throw new UnexpectedType(relFieldType, subscriptType[i], ctx.getCurrentAST());
          }
        } else {
          resFieldType[i - nSubs] = relFieldType;
        }
      }
View Full Code Here

    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {

      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);

    }
View Full Code Here

  public <U extends IValue, V extends IValue> Result<U> subscript(Result<?>[] subscripts) {
    if (subscripts.length != 1) {
      throw new UnsupportedSubscriptArity(getType(), subscripts.length, ctx.getCurrentAST());
    }
    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){
View Full Code Here

      super(__param1, __param2);
    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {
      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);
    }
View Full Code Here

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext eval) {
      if (this.getLiteral().isBoolean()) {
        return new BasicBooleanResult(eval, this);
      }
      throw new UnexpectedType(TF.boolType(), interpret(eval.getEvaluator()).getType(), this);
    }
View Full Code Here

            declaredType.match(v.getType(), bindings);
            declaredType = declaredType.instantiate(bindings);
            r = ResultFactory.makeResult(declaredType, v.getValue(), eval);
            eval.getCurrentModuleEnvironment().storeVariable(var.getName(), r);
          } else {
            throw new UnexpectedType(declaredType,
                v.getType(), var);
          }
        } else {
          eval.getCurrentModuleEnvironment().storeVariable(var.getName(), ResultFactory.nothing(declaredType));
        }
View Full Code Here

    }

    @Override
    public IBooleanResult buildBacktracker(IEvaluatorContext __eval) {

      throw new UnexpectedType(TF.boolType(), this
          .interpret(__eval.getEvaluator()).getType(),
          this);

    }
View Full Code Here

      tr.changed = true;
      tr.matched = true;
      Result<IValue> toBeInserted = e.getValue();
     
      if (!toBeInserted.getType().isSubtypeOf(e.getStaticType())) {
        throw new UnexpectedType(e.getStaticType(), toBeInserted.getType(), eval.getCurrentAST());
      }
      return e.getValue().getValue();
    }
  }
View Full Code Here

          tr.matched = true;
          tr.changed = true;
          subjectCursor += end;
        } else {
          throw new UnexpectedType(tf.stringType(),repl.getType(), eval.getCurrentAST());
        }
      }
    }
   
    tr.changed |= hasChanged;
View Full Code Here

TOP

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

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.