Btech Cse 7 8 Sem Compiler Design A2995 Dec 2018

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

http://www.ptustudy.

com

Roll No. Total No. of Pages : 02


Total No. of Questions : 18
B.Tech.(CSE) (2011 Onwards E-III) (Sem.–7,8)
COMPILER DESIGN
Subject Code : BTCS-913
Paper ID : [A2995]
Time : 3 Hrs. Max. Marks : 60

INSTRUCTION TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying T WO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
has to attempt any FOUR questions.
3. SECTION-C contains T HREE questions carrying T EN marks each and students
has to attempt any T WO questions.

SECTION-A

Answer briefly :

1. Write at least two differences between compiler and an interpreter.

2. What are different types of errors during compilation?

3. Define regular expression.

4. Define bootstrapping.

5. Differentiate between pass and phase of compiler.

6. Define LR(0) and LR(1) grammar.

7. What is advantage of removing left recursion from a grammar?

8. What is the advantage of Triples over Quadruples in intermediate code storage?

9. What is the purpose of code optimization phase of compiler?

10 What is the use of symbol table?

1|M - 7 1 9 0 5 (S2)-337

http://www.ptustudy.com
http://www.ptustudy.com

SECTION-B

11. Construct action and goto table for LR(0) parser :

(0) SEE (1) E eE (2) E  f (5)

12. a) Loop Optimization (2.5)

b) What is the significance of quadruples, triples? Write quadruples and triples for the
expression : (2.5)

(A + B) * (C + D) – (A + B + C)

13. What are three representations of IR (Intermediate Code)? Discuss SDT for three address
code generation with example. (5)

14. Discuss stack allocation of space and Activation Records. (5)

15. What is Context Free Grammar (CFG)? Discuss Shift-Reduce Parser with example. (5)

SECTION-C

16. Write a note on LEX and YACC compilers.

17. a) Discuss predictive parsing and Recursive descent parsing.

b) What is Handle Pruning? Write with an example, how handle is removed while
parsing a string?

18. a) Discuss various issues covered in code generation phase.

b) Discuss ambiguous and non-ambiguous parse trees. How ambiguity is removed from
a parse tree?

2|M - 7 1 9 0 5 (S2)-337

http://www.ptustudy.com

You might also like