Re: Problem with a derivation tree



On Sun, 22 Oct 2006, David C. Ullrich wrote:
<marsh@xxxxxxxxxxxxxxxxxx> wrote:
On Sat, 21 Oct 2006 anandr86@xxxxxxxxx wrote:

In the book "Principles of compiler design, Aho Ullman" the
following exercise caught my attention. The grammar given is

S -> aSa | aa

It is quoted that a "top down parse with backtracking" can establish
the inputs with 2,4 or 8 a's but not 6 a's .... How is this possible ?

Inputs?! Don't get it.

Then why don't you let someone who understands the question try
replying?

On the hopes that someone would explain the question
or consider if 'inputs' was miscue for 'outputs'.

S -> aSa -> aaSaa -> aaaaaa is an output.

The grammar he's fantasizing is
S -> SS | aa

Shucks, S -> SS -> SSaa -> aaaaaa
.



Relevant Pages

  • Top down parsing
    ... following exercise caught my attention. ... The grammar given is ... S -> aSa | aa ...
    (comp.theory)
  • Problem with a derivation tree
    ... following exercise caught my attention. ... The grammar given is ... S -> aSa | aa ...
    (sci.math)
  • Problem with top down parsing
    ... following exercise caught my attention. ... The grammar given is ... S -> aSa | aa ...
    (comp.compilers)
  • Re: Problem with a derivation tree
    ... following exercise caught my attention. ... S -> aSa | aa ... The grammar he's fantasizing is ...
    (sci.math)
  • Re: No monthly fee
    ... if this is a pondian word) put up by a local bank that puzzled ... "No monthly fee - and a whole lot more!" ... confuse advertising English grammar or construction with the grammar ... You paid attention. ...
    (alt.usage.english)