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...


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



May 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here