[antlr-interest] Exit Status from ANTLR

John Reid j.reid at mail.cryst.bbk.ac.uk
Wed May 16 06:30:37 PDT 2007


If antlr is invoked by

java antlr.Tool

then the antlr.Tool class must have a main method. Presumably this main 
method is not called by any other code except when antlr is executed 
from the command line?

If it isn't then why not call system.exit(1) when there is a problem in 
antlr.Tool.main.

If it is called by other code then why not create
an antlr.ToolCommandLine class that wraps antlr.Tool and does call 
system.exit with a non-zero return code when necessary.

All in all it seems a fairly serious short-coming of the command line 
interface that the calling process has no straightforward way of knowing 
whether antlr succeeded.

Best,
John.



Randall R Schulz wrote:
> Oliver,
> 
> On Monday 20 November 2006 00:40, you wrote:
>> I do not think so. Using System.exit in an IDE like e.g. Eclipse will
>> either tear down the whole IDE or cause a security exception. Neither
>> option is desirable.
> 
> I specifically asked that this be done for the command-line interface 
> invoked via the main method org.antlr.Tool. That method should only be 
> used by the stand-alone CLI tool.
> 
> 
> Randall Schulz
> 
> 
>> Oliver
>>
>> 2006/11/19, Randall R Schulz <rschulz at sonic.net>:
>>> Hi,
>>>
>>> It would be nice if the ANTLR command (as in {@link
>>> org.antlr.Tool#main(String[])} would call
>>> System.exit(somethingNonZero) if it detected and error in the
>>> submitted grammar specification.
> 



More information about the antlr-interest mailing list