8 Sep 2002 22:58:05 -0400

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) |

[13 later articles] |

From: | "Ira Baxter" <idbaxter@semdesigns.com> |

Newsgroups: | comp.compilers |

Date: | 8 Sep 2002 22:58:05 -0400 |

Organization: | Compilers Central |

References: | 02-09-014 |

Keywords: | LR(1), parse |

Posted-Date: | 08 Sep 2002 22:58:05 EDT |

"tj bandrowsky" <tbandrow@unitedsoftworks.com> wrote in message

*> Are there examples of grammars that are GLR but not LR(1) or LALR(1)?*

*>*

*> I have added meaningful error detection, fixed up some theoretical*

*> mistakes, I am looking to see if I can credibly claim that Diplodicus*

*> is a general LR parser. I would like to know how I can **prove*

*> that**, particularly in a rigourous way.*

*>*

*> It seems to me being able to correctly parse a grammar that can only*

*> be parsed by GLR would at least add some rhetorical help to that case,*

*> so examples of correctly parsing GLR grammars would be particularly*

*> helpful. Is C++ with templates GLR?*

GLR parsers can technically parse any context-free grammar. You

should be able to construct one a non-LALR(1) with trivial effort.

Virtually no real language is actually LALR(1) out-of-the-manual.

(ISO PASCAL might be). What people typically do to get around this is

to hack the lexer to peek ahead in critical cases, or attach parsing

actions to take in some symbol table information.

We use a GLR parser to avoid these ugly hacks.

--

Ira Baxter, Ph.D. CTO Semantic Designs

www.semdesigns.com 512-250-1018

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.