[antlr-interest] Removing System.out and System.err calls

Robert.Klaus at innovations.de Robert.Klaus at innovations.de
Sun Oct 28 23:36:25 PDT 2007


Hi,

There are some in traceOut and traceIn which look like as if they are
used for debugging as well. As the debug output is gone on the main
development line, when is planned to release the next version?

Bye

Robert


> -----Original Message-----
> From: Terence Parr [mailto:parrt at cs.usfca.edu] 
> Sent: Saturday, October 27, 2007 3:19 AM
> To: Klaus Robert
> Cc: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Removing System.out and System.err calls
> 
> 
> On Oct 25, 2007, at 6:49 PM, <Robert.Klaus at innovations.de> 
> <Robert.Klaus at innovations.de> wrote:
> 
> > Hi,
> >
> > In the BaseRecognizer.class there are several calls to 
> System.err and 
> > System.out. In ANTLR2 I could overwrite methods like 
> "reportError" to 
> > take care of the messages myself.
> > However this is not possible in ANTLR3, as some of these 
> calls are in 
> > methods I think are better not overwritten (e.g.
> > "recoverFromMismatchedToken").
> > Would it be possible to delegate all reporting to dedicated 
> methods, 
> > e.g. "public void reportError(String msg)"? This would 
> allow users of
> > ANTLR3 to switch off System.out calls or use their own logging 
> > facility.
> 
> Howdy. All errors should actually go thru:
> 
> public void emitErrorMessage(String msg) {
>                 System.err.println(msg); }
> 
> The
> 
> System.err.println("BR.recoverFromMismatchedToken");
> 
> you see is a debugging print. Ooops.   Actually, it's gone in 
> my main  
> line of code. so we're cool.
> 
> Are there others?  That's the only one I see.
> 
> Ter
> 
> 
> 


More information about the antlr-interest mailing list