[antlr-interest] syntactic predicates and exceptions

Sohail Somani sohail at taggedtype.net
Tue Oct 18 19:53:41 PDT 2005


On Tue, 2005-18-10 at 12:03 -0400, Don Caton wrote:
> Putting if's throughout the code isn't going to slow anything down, you're
> talking about a handful of cpu instructions.  Contrast that to throwing a
> single exception that requires thousands of instructions to execute, then
> multiply that by the number of exceptions thrown in any non-trivial grammar.

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!

Sohail



More information about the antlr-interest mailing list