Re: Problem with a derivation tree



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.

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

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

Math isn't easy. To make it obscure, take computer courses. ;-)
.



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: Grammaticaly correct sentences (or not...)
    ... have to use a set of correct and incorrect sentences: ... of something like a phrase structure grammar. ... English would be too difficult to parse. ... requirement of the exercise. ...
    (alt.usage.english)