[antlr-interest] ANTLR generating invalid Java

Terence Parr parrt at cs.usfca.edu
Thu Aug 7 13:10:24 PDT 2008


On Aug 7, 2008, at 12:37 PM, Oren Ben-Kiki wrote:

> On Thu, Aug 7, 2008 at 11:17 AM, Terence Parr <parrt at cs.usfca.edu>  
> wrote:
>> On Aug 6, 2008, at 3:23 PM, Oren Ben-Kiki wrote:
>>> See for example line 1758 - where is the "n" rule parameter variable
>>> supposed to come from? Could it be that back-tracking and rule
>>> parameters don't mix?
>>
>> yep.  youHave to be careful; some discussions about this in the  
>> archives or
>> in the book.
>> Ter
>
> I didn't see this warning in the book... Now that I am aware of it, I
> can avoid the problem by turning of auto-backtracking and manually
> adding syntactic predicates. Thanks!
>
> There's still the question of the huge redundant "if" statements. It
> seems like some sort of exponential explosion of combinations of
> semantic predicates... that is, (T1 || T2 || ..) where each T<i> is
> (S1 && S2 && ...) for some semantic predicates S<i>.

Yeah,That happens also... I have to optimize. would love to see a very  
small example that generated an efficient predicate tests.

Ter


More information about the antlr-interest mailing list