❧

Exercises

display

Which are the terminal and the non-terminal symbols? Determine the sets of leftmost and follow-symbols L(X) and F(X) for each non-terminal symbol X. Construct a sequence of parsing steps for the following sentences:

display

5.2. Does the grammar of Exercise 5.1 satisfy the Restrictive Rules 1 and 2 for one-symbol lookahead top-down parsing? If not, find an equivalent syntax which does satisfy these rules. Represent this syntax by a syntax graph and a data structure to be used by Program 5.3.

348
display

5.5. Transform the description of PL/O (Fig. 5.4) into an equivalent set of BNF-

productions.

5.6. Write a program that determines the sets of initial and follow-symbols

display

5.8. Extend the PL/O language and compiler by introducing procedure param-

display
349
display

5.9. Extend the PL/O language and compiler by introducing arrays of variables.

display

§.11. Extend Program 5.5 into a program called “prettyprint.” The purpose of

display
↑ Up