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