fork(54) download
  1. This is exercise 4.4.5 from purple dragon.
  2. The grammar S -> aSa | aa generates all even-length strings of a's. We can
  3. devise a recursive-descent parserwith backtrack for this grammar. If we choose
  4. to expand by production S -> aa first, then we shall only recognize the string aa.
  5. Thus, any reasonable recursive-descent parser will try S -> aSa first.
  6.  
  7. a) Show that this recursive-descent parser recognizes inputs aa, aaaa, and
  8. aaaaaaaa, but not aaaaaa
  9. !!b) What language does this recursive-descent parser recognize ?
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty