Re: Grammar failing single lookahead

2007-05-30 Thread Evan Lavelle
Evan Lavelle wrote: Prolog : FirstPrologList | SecondPrologList | FirstPrologList SecondPrologList ; I missed the case of no prolog at all, but this has no conflicts: Prolog : /* nothing */ | FirstPrologList | SecondPrologList | FirstPrologList SecondPrologList ; Evan ___

Re: Grammar failing single lookahead

2007-05-30 Thread Evan Lavelle
Root: Prolog Prolog: FirstProlog SecondProlog FirstProlog: /* empty */ | FirstProlog A SecondProlog: /* empty */ | SecondProlog B A: DECLARE FOO B: DECLARE BAR How about this: Root: Prolog; Prolog : FirstPrologList | SecondPrologList | FirstPrologList SecondPrologList ; Fir

Re: Grammar failing single lookahead

2007-05-30 Thread Frans Englich
On Wednesday 30 May 2007 12:55, Tim Van Holder wrote: > Frans Englich wrote: > > The intent of the grammar is to enforce that declarations appear in a > > certain order(FirstProlog, SecondProlog), that the declarations are > > optional, and they take the form of "declare ". > > > > This is somethin

Re: Grammar failing single lookahead

2007-05-30 Thread Tim Van Holder
Frans Englich wrote: > The intent of the grammar is to enforce that declarations appear in a certain > order(FirstProlog, SecondProlog), that the declarations are optional, and > they take the form of "declare ". > > This is something that naturally leads to a shift/reduce conflict. As far as >

Grammar failing single lookahead

2007-05-30 Thread Frans Englich
See attached grammar. Its essence is this: - %token DECLARE %token FOO %token BAR Root: Prolog Prolog: FirstProlog SecondProlog FirstProlog: /* empty */ | FirstProlog A SecondProlog: /* empty */ | SecondProlog B A: DECLARE FOO B: DECLARE BAR --