The grammar for ac shown in figure 21 requires all


The grammar for ac shown in Figure 2.1 requires all declarations to precede all executable statements. In this exercise, the ac language is extended so that declarations and executable statements can be interspersed. However, an identifier cannot be mentioned in an executable statement until it has been declared.

(a) Modify the CFG in Figure 2.1 to accommodate this language extension.

(b) Discuss any revisions you would consider in the AST design for ac.

(c) Discuss how semantic analysis is affected by the changes you envision for the CFG and the AST.

Figure 2.1

Request for Solution File

Ask an Expert for Answer!!
Basic Statistics: The grammar for ac shown in figure 21 requires all
Reference No:- TGS01474717

Expected delivery within 24 Hours