Consider translation during parsing as in exercise 523 s c


Consider translation during parsing as in Exercise 5.23. S. C. Johnson suggests the following method for simulating a separate stack for inherited attributes, using markers and a global variable for each inherited attribute. In the following production, the value v is pushed onto stack i by the first action and is popped by the second action:

Stack i can be simulated by the following productions that use a global variable g and a marker nonterminal M with synthesized attribute s:

a) Apply this transformation to the translation scheme of Exercise 5.23(b). Replace all references to the top of tbe separate stack by references to the global variable.

b) Show that the translation scheme constructed in (a) computes the same values for the synthesized attribute of the start symbol as that in Exercise 5.23(b)

Exercise 5.23(b) b) Modify the translation scheme constructed in (a) so that the value of inherited attribute ps appears on a separate stack. Eliminate marker nonterminal M in the process.

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: Consider translation during parsing as in exercise 523 s c
Reference No:- TGS01477198

Expected delivery within 24 Hours