How does backtracking affect the language recognized by a parser?
问题 Not a school related question, but it comes up in the Dragon Book (Compilers: Principles, Techniques, and Tools) in an exercise: The grammar: S ::= aSa | aa generates all even length strings of a's except for the empty string. a) Construct a recursive-descent parser with backtracking for this grammar that tries the alternative aSa before aa. Show that the procedure for S succeeds on 2, 4, or 8 a's, but fails on 6 a's. b) What language does your parser recognize? I'm stumped. It seems like if