Re: Reasonable Non-LR Grammar

Sylvain Schmitz <schmitz@i3s.unice.fr>
Wed, 01 Aug 2007 14:04:57 +0200

          From comp.compilers

Related articles
Reasonable Non-LR Grammar zingard@mcmaster.ca (Daniel Zingaro) (2007-07-31)
Re: Reasonable Non-LR Grammar schmitz@i3s.unice.fr (Sylvain Schmitz) (2007-08-01)
| List of all articles for this month |

From: Sylvain Schmitz <schmitz@i3s.unice.fr>
Newsgroups: comp.compilers
Date: Wed, 01 Aug 2007 14:04:57 +0200
Organization: Compilers Central
References: 07-07-116
Keywords: parse, LR(1)

Daniel Zingaro wrote:
> Does anyone have a good example of a piece of a (possible) programming
> language grammar which is not LR(k)? I'm specifically looking for an
> example of where we can easily use Accent (a compiler-compiler using
> Earley parsers) without having to mess around with a grammar to avoid LR
> conflicts. I can contrive (mostly bad) examples but wondering what
> examples others have.


You can consider the Java modifiers syntax in
<http://java.sun.com/docs/books/jls/first_edition/html/19.doc.html#44488>.


There are two examples in the Standard ML language definition, although
they are mingled with ambiguities; see Kahrs' analysis in
<http://www.lfcs.inf.ed.ac.uk/reports/93/ECS-LFCS-93-257/>.


--
Hope that helps,


      Sylvain


Post a followup to this message

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