+1 vote
12 views

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

| 12 views