Question: 4. Given the grammar below: 1. A id = E 2. EE +T EE-T T 3. TT*F T/F F 4. F (E) id 5. id
4. Given the grammar below: 1. A id = E 2. EE +T EE-T T 3. TT*F T/F F 4. F (E) id 5. id a bc..z etc Write a program for the bottom up parsing algorithm of the following input strings a. a= b+c d b. a= b*c + d*e c. a=b*c*d d. a=a/b c*d e. a=b+c d f For now, you need to hand generate the handle sequences of the above strings and use them as inputs to your program. 5. Repeat NO. 4 but this time you need to hand generate the DFA for the above grammar and complete the bottom up parsing algorithm for the above strings (extra credit, attempt only after completed others) 6. Using the concepts of syntax directed translation, write a program to build the binary tree for the above strings in NO. 4 7. Also using syntax directed translation concept discussed in class, generate the three address codes for the strings in NO. 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
