[antlr-interest] LL(1), LL(k), LL(*), predicated decisions

Loring Craymer craymer at warpiv.com
Mon Jun 5 15:15:08 PDT 2006


Ter--

Out of curiosity, what's the distribution of k values in representative
grammars?  It might be useful to be able to gather that statistic when
trying to optimize a grammar; in fact, it might be useful to get that on a
per-rule basis (eventually) and feed that to ANTLRWorks.  Also, we know from
experience that tree grammars have predominantly LL(1) decisions--especially
since up until ANTLR 3 tree grammars have been predicated-LL(1) of
necessity--and the same is probably true of most parser grammars.

Given the code bloat resulting from excessive DFAs, I rather think that not
only was the investigation worthwhile, but it also merits follow-up when
time is available.

--Loring

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Terence Parr
> Sent: Monday, June 05, 2006 2:34 PM
> To: ANTLR Interest; ANTLR-dev list
> Subject: Re: [antlr-interest] LL(1), LL(k), LL(*), predicated decisions
> 
> Followup...i just generated from java.g using all new-style DFA and
> the resulting code is just huge.  Too much overhead to uncompress and
> set up those DFA :(  I think we're better off doing inline DFA for
> fixed LL(k) decisions.  Oh well.  Worth the few hours of investigation.
> 
> Ter



More information about the antlr-interest mailing list