Rewrite the underlying grammar of exercise 512 so that it


Rewrite the underlying grammar of Exercise 5.12 so that it groups the sub expressions of ::IE to the right and the sub expressions of + to the left.

a) Construct a translation scheme that simulates the syntax-directed den" ition or Exercise 5.12(b) .

b) Modify the translation scheme of (a) to emit code incrementally to an output file

Exercise 5.12 Expressions generated by the following grammar can have assignments within them.

The sernantics of expressions are as in C. That is. b: =c is an expression that assigns the value of c to b; the r-value of this expression is the same as that of c. Furthermore. a: = (b: =0) assigns the value of c to b and then to a.

a) Construct a syntax-directed definition for checking that the left side of an expression is an l-value. Use an inherited attribute side of nonterminal E to indicate whether the expression generated by E appears on the len or right side of an assignment.

b) Extend the syntax-directed definition in (a) to generate intermediate code for the stack machine of Section 2.8 as it checks the input

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: Rewrite the underlying grammar of exercise 512 so that it
Reference No:- TGS01477167

Expected delivery within 24 Hours