[antlr-interest] Grammar generation results in exception

Jim Idle jimi at temporal-wave.com
Mon Jun 25 14:22:29 PDT 2007


In terms of human detectable time it is unlikely to affect you, but it
does have significant bite :-). However, while it is obviously 'better'
to do it 'right', in the end it is matter of whether your backtracking
parser is eminently adequate for the task. There are obviously a lot of
cases were say 100ms vs 30ms would be of no consequence.

However, if for instance, you use the backtracking Java parser in the
examples to parser the entire .java source for JDK 1.6 you can see that
it can make noticeable difference, which may or may not be important to
your task.

It is not my intention to imply that backtracking parsers are somehow
completely the wrong way to do things, just to make sure that the choice
with informed intent :-)

Robin: I would be quite interested to look at the C# parser that
processes the define ambiguity if this is possible.

Jim


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Gavin Lambert
> Sent: Monday, June 25, 2007 1:38 PM
> To: Robin Davies; antlr-interest at antlr.org
> Subject: Re: [antlr-interest] Grammar generation results in exception
> 
> At 05:55 26/06/2007, Robin Davies wrote:
>  >I'm curious about this. I'm approaching the point at which I
> need
>  >to convert my grammar to non-backtracking (if neccessary), and
> to
>  >optimize (as required). And I'm not entirely clear on the
>  >performance implications of various optimizations. Given a
> choice
>  >between maintainability with decent performance, and
> head-snapping
>  >speed, I'll take the former anytime.
> 
> So far, in my (limited) experience with ANTLR, I haven't seen any
> significant performance difference between having backtracking on
> and off.  The only noticeable difference is that the parser
> generates the wrong results (for my grammar) if backtracking is
> off :)



More information about the antlr-interest mailing list