List Parsing in LALR
6 Sep 1999 11:49:59 -0400

          From comp.compilers

Related articles
List Parsing in LALR (1999-09-06)
Re: List Parsing in LALR (1999-10-14)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 6 Sep 1999 11:49:59 -0400
Organization: - Share what you know. Learn what you don't.
Keywords: parse, LALR, question, comment

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]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.