588 views
2 votes
2 votes

In Fig. $4.56$ is a grammar for certain statements, similar to that discussed in Question $4.4.12$. Again, $e$ and $s$ are terminals standing for conditional expressions and "other statements," respectively.

  1. Build an LR parsing table for this grammar, resolving conflicts in the usual way for the dangling-else problem.
  2. Implement error correction by filling in the blank entries in the parsing table with extra reduce-actions or suitable error-recovery routines.
  3. Show the behavior of your parser on the following inputs:

 

  1. if e then s ; if e then s end
  2. while e do begin s ; if e then s ; end

 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
0 votes
0 votes
0 answers
4
admin asked Aug 20, 2019
371 views
Construct thecanonical LR, andLALR sets of items for the grammar $S\rightarrow S S + \mid S S \ast \mid a$ of Question $4.2.1$.