Re: LR Grammars not in LALR(1) or LR(1)

"tj bandrowsky" <tbandrow@unitedsoftworks.com>
12 Sep 2002 00:14:35 -0400

          From comp.compilers

Related articles
LR Grammars not in LALR(1) or LR(1) tbandrow@unitedsoftworks.com (tj bandrowsky) (2002-09-03)
Re: LR Grammars not in LALR(1) or LR(1) haberg@matematik.su.se (Hans Aberg) (2002-09-08)
Re: LR Grammars not in LALR(1) or LR(1) idbaxter@semdesigns.com (Ira Baxter) (2002-09-08)
Re: LR Grammars not in LALR(1) or LR(1) tbandrow@unitedsoftworks.com (tj bandrowsky) (2002-09-12)
Re: LR Grammars not in LALR(1) or LR(1) tbandrow@unitedsoftworks.com (tj bandrowsky) (2002-09-12)
Re: LR Grammars not in LALR(1) or LR(1) haberg@matematik.su.se (Hans Aberg) (2002-09-12)
Re: LR Grammars not in LALR(1) or LR(1) soenke.kannapinn@wincor-nixdorf.com (=?Windows-1252?Q?S=F6nke_Kannapinn?=) (2002-09-14)
Re: LR Grammars not in LALR(1) or LR(1) haberg@matematik.su.se (Hans Aberg) (2002-09-14)
Re: LR Grammars not in LALR(1) or LR(1) thp@cs.ucr.edu (2002-09-20)
Re: LR Grammars not in LALR(1) or LR(1) haberg@matematik.su.se (Hans Aberg) (2002-09-22)
[12 later articles]
| List of all articles for this month |
From: "tj bandrowsky" <tbandrow@unitedsoftworks.com>
Newsgroups: comp.compilers
Date: 12 Sep 2002 00:14:35 -0400
Organization: http://groups.google.com/
References: 02-09-014 02-09-057
Keywords: parse
Posted-Date: 12 Sep 2002 00:14:35 EDT

> GLR parsers can technically parse any context-free grammar. You
> should be able to construct one a non-LALR(1) with trivial effort.


I think this fits the bill?


obj_id: id | obj_id "." id; // a recursive definition of id ("." id)*
expr: obj_id
        | simple_func
        | obj_func
        | expr "+" expr
        ...
        ;
simple_func: id "(" asgn_list ")"; // simple funcs have complex
params


asgn_list: (obj_id "=" expr ";")+;
obj_func: obj_id "(" expr_list? ")"; // obj funcs have simple params
expr_list: expr ("," expr)*;


> We use a GLR parser to avoid these ugly hacks.


Yeah, same here. Thanks!



Post a followup to this message

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