Question: ist -> list + digit list -> list digit list -> digit digit -> 0|1|2|3|4|5|6|7|8|9 1. Use the grammar above, follow derivation on chapter 2

ist -> list + digit

list -> list digit

list -> digit

digit -> 0|1|2|3|4|5|6|7|8|9

1. Use the grammar above, follow derivation on chapter 2 slide 15 to apply the production to following expression

3-1+9,

4+2-3+9

2. How to modify the grammar above to right associative? Use the modified grammar to draw the parse tree for 4+2-3+9

3. Use the grammar on compiler design slide 25 to draw the parse tree for 3-2*8+5/3, and 3-2*(4+7)/5

4. Transform the following expressions to postfix notation (4+2-9)/3+7*4, ((2+8/3)+4)*3-9

5. Use the Syntax-directed definition on compiler design slide 36 to translate (4+2-9)/3+7*4 to postfix notation. Show the parse tree with synthesized attributes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!