The Gateway to Computer Science Excellence
+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

 

in Compiler Design by Veteran (54.7k points) | 12 views

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,430 answers
195,214 comments
99,931 users