Download PTU B.Tech 2020 March CSE-IT 7th and 8th Sem BTCS 913 Compiler Design Question Paper

Download PTU (I.K. Gujral Punjab Technical University Jalandhar (IKGPTU) ) BE/BTech CSE/IT (Computer Science And Engineering/ Information Technology) 2020 March 7th and 8th Sem BTCS 913 Compiler Design Previous Question Paper

1 | M - 7 1 9 0 5 ( S 2 ) - 9 1 7
Roll No. Total No. of Pages : 02
Total No. of Questions : 18
B.Tech.(CSE) (2012 to 2017 E-III) (Sem.?7,8)
B.Tech. (IT)
COMPILER DESIGN
Subject Code : BTCS-913
M.Code : 71905
Time : 3 Hrs. Max. Marks : 60
INSTRUCTION TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying TWO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
have to attempt any FOUR questions.
3. SECTION-C contains THREE questions carrying TEN marks each and students
have to attempt any TWO questions.

SECTION-A
Answer briefly :
1. Differentiate between stack allocation and static allocation.
2. Name two compiler construction tools.
3. Define ?Code Motion? and ?Constant Folding? with examples.
4. Define ?Basic Block? and write about its significance.
5. Write at least two differences between LR (0) parsers, SLR (1) parsers, CLR (1) and
LALR Parsers.
6. Show that the grammar is ambiguous: S ? Sa S ? bS S ? c
7. List the functions of a pre-processor.
8. How do Self Hosting Compilers work?
9. Name 3 forms of output of code generator.
10. Write the triple representation of x := y[i].

FirstRanker.com - FirstRanker's Choice
1 | M - 7 1 9 0 5 ( S 2 ) - 9 1 7
Roll No. Total No. of Pages : 02
Total No. of Questions : 18
B.Tech.(CSE) (2012 to 2017 E-III) (Sem.?7,8)
B.Tech. (IT)
COMPILER DESIGN
Subject Code : BTCS-913
M.Code : 71905
Time : 3 Hrs. Max. Marks : 60
INSTRUCTION TO CANDIDATES :
1. SECTION-A is COMPULSORY consisting of TEN questions carrying TWO marks
each.
2. SECTION-B contains FIVE questions carrying FIVE marks each and students
have to attempt any FOUR questions.
3. SECTION-C contains THREE questions carrying TEN marks each and students
have to attempt any TWO questions.

SECTION-A
Answer briefly :
1. Differentiate between stack allocation and static allocation.
2. Name two compiler construction tools.
3. Define ?Code Motion? and ?Constant Folding? with examples.
4. Define ?Basic Block? and write about its significance.
5. Write at least two differences between LR (0) parsers, SLR (1) parsers, CLR (1) and
LALR Parsers.
6. Show that the grammar is ambiguous: S ? Sa S ? bS S ? c
7. List the functions of a pre-processor.
8. How do Self Hosting Compilers work?
9. Name 3 forms of output of code generator.
10. Write the triple representation of x := y[i].

2 | M - 7 1 9 0 5 ( S 2 ) - 9 1 7
SECTION-B
11. Differentiate between top down and bottom up parsing. Show the steps of a shift reduce
parser on input (a,(a,a)) using the following grammar :
S ? (L) | a
L ? L, S | S
12. Translate the arithmetic expression a * ? (b + c ) into
a) Postfix notation
b) Three-address code
13. What is the role of the lexical analyzer? Explain the issues in lexical analysis.
14. What is Code Optimization? Describe the principle sources of optimization.
15. Explain the various storage allocation strategies applied to activation records.

SECTION-C
16. Explain in detail the process of compilation. Illustrate the output of each phase of
compilation for the input ?a = (b+c) * (b+c) * 2?.
17. What is the need of symbol table. Explain various data structures used for its storage.
18. Given the CFG G = {S, {S, U, V, W}, {a, b, c, d}, P} with P given as shown below :
S ? UVW
U ? (S) | aSb| d
V ? aV | ?
V ? cW | ?
a) Construct a table-based LL(1) predictive parser for G;
b) Give the parsing actions for the input string ?(dc)ac?.


NOTE : Disclosure of Identity by writing Mobile No. or Making of passing request on any
page of Answer Sheet will lead to UMC against the Student.
FirstRanker.com - FirstRanker's Choice

This post was last modified on 21 March 2020