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; }
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; }