DLP Assignment 2
DLP Assignment 2
: 2024-25
Sr. Aim CO
No.
1. Differentiate between top down parser and bottom up parser. 3
2. Explain handle and handle pruning 4
3. Consider the following grammar 3
S -> AA
A -> aA
A -> b
And construct the LALR parsing table.
4. Differentiate between S attributes and L attributes 4
5. Differentiate between parse tree and syntax tree 3
6. What is DAG? What are its advantages in context of optimization? How 5
does it help in eliminating common sub expression?
7. What is peephole optimization? Explain with example 5
8. What is global optimization? Name the 2 types of analysis performed for 4
global optimization
9. Discuss the functions of error handler. 4
10. Show the following grammar is LR(1) but not LALR(1). 3
S->Aa │bAc │Bc│bBa
A->d
B->d
11. Construct SLR parsing table for the following grammar : 3
S → (L) | a
L→ L,S | S
12. Construct syntax tree and DAG for following expression: 4
X = a * (b+c)- (b+c)* d
13. Explain various parameter passing methods. 5
14. Explain various issues in design of code generator. 5
15. Explain Basic Block and Flow Graph with example. 5