In Fig. 4.24 is a grammar for certain statements. You may take e and s to be terminals standing for conditional expressions and "other statements," respectively. If we resolve the conflict regarding expansion of the optional "else" (nonterminal stmtTail) by preferring to consume an else from the input whenever we see one, we can build a predictive parser for this grammar. Using the idea of synchronizing symbols described in Section 4.4.5: a) Build an error-correcting predictive parsing table for the grammar. b) Show the behavior of your parser on the following inputs:
(i) if e the n s ; if e the n s end( M ) whil e e do begin s ; if e the n s ; end
Fig. 4.24
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here