<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.2">
</HEAD>
<BODY>
On Tue, 2008-07-01 at 13:02 -0400, Andy Tripp wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Jim,

As you point out, the default case is that people will want to process their own error messages,
rather than have ANTLR send them to stderr. So doesn't it make more sense to
have ANTLR package them into a data structure (which has a toString() method
which ANTLR calls and sends to stderr? The alternative is that people
have to either parse the error text or look at the ANTLR-generated code to
understand how to override the default behavior.

You mention reusing your error handling mechanism across &quot;virtually all&quot; your
grammars. I think that for almost ANTLR users, the number of lexer/parsers that they're
going to write is exactly 1. Better to make it as easy as possible to write that
first grammar and not assume that they're going to be creating more grammars
anyway. Part of making it easy is to make it possible to build a lexer/parser
as a &quot;black box&quot;, without having to ever look at the ANTLR-generated code.
</PRE>
</BLOCKQUOTE>
No need to go into a long conversations about this, but placing the messages in a collection would then just hide them away. So, they would just sit there and the users would not even know there WERE any messages. So, then you have to supply... errr... a method to print them out. Then you have to override that method to print them out in the way you want. Then one finds that the information in the collection isn't quite what you want, or that most people want the messages to print as they occur, so now there are two methods that you might need to override. So, you are back to square one, or maybe worse. In short, while I don't think that collection the messages is bad idea at all (I do it myself), my feeling is that creating the collection would actually complicate things for new users, not simplify them. <BR>
<BR>
At the end of the day though, if that's what most people wanted and Ter thought it to be a reasonable request, then I certainly would not object to it.<BR>
<BR>
Jim<BR>
<BR>
<BR>
</BODY>
</HTML>