pplouis@my-deja.com wrote:> How to write grammar for lists like this in LALR(1)?

> aList -> anItem ;> aList -> aList anItem ;

> anItem -> 'boo' 'foo' ;> anItem -> 'bar' 'boo' ;> anItem -> 'bar' ;

> Thanks for the help.> PP Louis> [Expand and flatten it, I suppose, or else use a lexical hack to peek ahead> two tokens. -John]

You could try affix grammars of which the van Wijngaarden grammar is
one example. See the specification of Algol 68.
--
Sian Leitch (Software Engineer specialising in Algol 68)
[So how do you parse an affix grammar using an LALR(1) parser? -John]