[antlr-interest] packrat vs. LL(*)

Sam Harwell sharwell at pixelminegames.com
Mon Jun 8 19:48:33 PDT 2009


[I read the rest of this thread as well.]

The backtrack=true option *destroys* the ability to provide useful error
messages. A backtrack+memoize grammar is *much* less efficient in both
time and space than a left-factored grammar written for ANTLR with these
in mind. The options are potentially useful as a quick hack to test a
grammar before left factoring it, but aside from allowing "lazy"
development (writing efficient, correct left-factored grammars can be
very time consuming), they have no practical benefit.

Sam

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Steven Obua
Sent: Monday, June 08, 2009 3:09 PM
To: Jim Idle
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] packrat vs. LL(*)

Well, with the options I give, it finishes code generation in a few  
milli seconds. My grammar is very readable (which would be destroyed  
by left-factoring), the parser is sufficiently fast. In twenty years,  
it will be even faster.



More information about the antlr-interest mailing list