public static boolean normalizeParser(ParserBean spec,CompilerLogger logger)
	throws CopperException
	{
		boolean hasError = false;
		GrammarConsistencyChecker checker = new GrammarConsistencyChecker();
		if(spec != null) hasError |= spec.acceptVisitor(checker);
		else hasError = true;
		if(hasError && logger.isLoggable(GrammarSemanticErrorMessage.getGrammarSemanticErrorMessageLevel()))
		{
			for(GrammarError e : checker.getErrors())
			{
				logger.log(new GrammarSemanticErrorMessage(e));
			}
//			StringBuffer sb = new StringBuffer();
//			sb.append("Parser specification").append(spec == null ? "" : " " + spec.getDisplayName()).append(" is not well-formed; the following errors occurred:\n");
//			for(GrammarError e : checker.getErrors())
//			{
//				sb.append("    ").append(e.toString()).append("\n");
//			}
//			if(logger.isLoggable(CompilerLogMessageSort.PARSING_ERROR)) logger.logMessage(CompilerLogMessageSort.PARSING_ERROR,null,sb.toString());
//			logger.flushMessages();
			logger.flush();
			return true;
		}
		GrammarNormalizer normalizer = new GrammarNormalizer();
		if(spec != null) spec.acceptVisitor(normalizer);
		return hasError;
	}