Exemplo n.º 1
0
  public Type typeCheck(Statement stmt, Environment env) throws Exception {
    TypeChecker.clearErrors();
    Type type = stmt.typeCheck(env, NameScope.NAMESANDSTATE, null);

    if (TypeChecker.getErrorCount() > 0) {
      throw new VDMErrorsException(TypeChecker.getErrors());
    }

    return type;
  }
Exemplo n.º 2
0
  public Type typeCheck(Expression expr, Environment env) throws Exception {
    TypeChecker.clearErrors();
    Type type = expr.typeCheck(env, null, NameScope.NAMESANDSTATE, null);

    if (TypeChecker.getErrorCount() > 0) {
      throw new VDMErrorsException(TypeChecker.getErrors());
    }

    return type;
  }