[antlr-interest] syntactic predicates and exceptions

Nigel Sheridan-Smith nbsherid at secsme.org.au
Wed Oct 19 18:34:27 PDT 2005


 

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Sohail Somani
> Sent: Wednesday, 19 October 2005 12:54 PM
> To: Don Caton
> Cc: 'ANTLR Interest'
> Subject: RE: [antlr-interest] syntactic predicates and exceptions
> 
> I think this is a good point. Especially since the code is generated it
> doesn't need to be maintained. While developing ~ 1 KLOC grammar, I've
> had to debug into the generated code about twice. So if I have to see if
> statements, its not a big deal.
> 
> Btw, it was great debugging into the generated code. So easy to read!
> 

I don't want to weigh in to this argument too much, but I do want to mention
one point. 

If you remove exception handling for back-tracking, there is one risk: the
readability of the code (and hence the ease of debugging and tracing) will
be reduced. 

If high performance is essential, then removing the exception handling is
the way to go. However, if readability of the parsers/lexers generated is an
essential requirement, then you should consider what you are losing. 

I certainly don't want to give Terence more work than he already has, but
can a command line switch or ANTLR option be considered here? Do people see
benefits in readability and the ease of debugging?

Nigel

--
Nigel Sheridan-Smith
PhD research student

Faculty of Engineering
University of Technology, Sydney
Phone: 02 9514 7946
Fax: 02 9514 2435




More information about the antlr-interest mailing list