CT3 QB
CT3 QB
1. Evaluate the expressions for the SDD annotated parse tree for the follow expressions.
a) 3 * 5 + 4n
b) (3 + 4) * (5 + 6)
2. (i)Analyze the grammar and syntax-directed translation for desk calculator
(ii) Explain how the procedure of constructing syntax tree from SDD
3. What is three address codes. Mention the types. How would you implement the three
address statement with an example.
4. Write about Bottom-Up evaluation S-Attributed definitions.
5. What is L-attributed definition? Give some example.
6. Explain synthesized attribute and inherited attribute with suitable examples.
7. Generate an intermediate code for the following code segment with the required syntax-
directed translation scheme. if ( a > b) x = a + b else x = a – b
8. What is cross compiler, explain its issues and give T-diagram representation.
9. (i) What are the issues in the design of code generator?
(ii) Explain simple code generator with suitable example.
10. Write a code generation algorithm. Explain about the descriptor and function getreg().
Generate a code for x = (( a + b) / (b-c)) – ( a + b) * ( b-c) +f.
UNIT –V