Re: Grammar needed

Karsten Nyblad <148f3wg02@sneakemail.com>
26 Oct 2006 00:30:13 -0400

          From comp.compilers

Related articles
Grammar needed leonardo@dcc.ufmg.br (Leonardo Teixeira Passos) (2006-10-24)
Re: Grammar needed schmitz@i3s.unice.fr (Sylvain Schmitz) (2006-10-26)
Re: Grammar needed 148f3wg02@sneakemail.com (Karsten Nyblad) (2006-10-26)
Re: Grammar needed pjj@cs.man.ac.uk (Pete Jinks) (2006-10-26)
Re: Grammar needed cfc@shell01.TheWorld.com (Chris F Clark) (2006-10-26)
Re: Grammar needed leonardo@dcc.ufmg.br (Leonardo Teixeira Passos) (2006-11-01)
| List of all articles for this month |
From: Karsten Nyblad <148f3wg02@sneakemail.com>
Newsgroups: comp.compilers
Date: 26 Oct 2006 00:30:13 -0400
Organization: Compilers Central
References: 06-10-101
Keywords: parse, theory
Posted-Date: 26 Oct 2006 00:30:13 EDT

Leonardo Teixeira Passos wrote:
> (i) It represents an LR(k) language
> (ii) The grammar it self isn't LR(k) for any k, for there is at least
> one conflict. One or more of these conflicts does not indicate
> ambiguity in the grammar, but can't be solved with any k.


Start symbol: S
Non terminals: S A B C
Terminals: a b c
The language as regular expression: c*(a|b)
Ambiguity: You cannot know if you should start by reducing the empty
string to A or B before you see a or b.


S -> A C a
S -> B C b
A ->
B ->
C ->
C -> C c


Karsten Nyblad
148f3wg02 at sneakemail dot com



Post a followup to this message

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