Download GTU BE/B.Tech 2019 Winter 7th Sem New 2170701 Compiler Design Question Paper

Download GTU (Gujarat Technological University) BE/BTech (Bachelor of Engineering / Bachelor of Technology) 2019 Winter 7th Sem New 2170701 Compiler Design Previous Question Paper

1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ? VII (New) EXAMINATION ? WINTER 2019
Subject Code: 2170701 Date: 23/11/2019

Subject Name: Compiler Design
Time: 10:30 AM TO 01:00 PM Total Marks: 70

Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.


MARKS

Q.1 (a) Explain tokens, lexemes, Pattern with example. 03
(b) Distinguish between ambiguous and unambiguous grammar? 04
(c) Explain the analysis synthesis model of compilation. List the factors that
affect the design of compiler. Also List major functions done by compiler.
07

Q.2 (a) Write a regular definition for
1. The Language of all strings that do not end with 01.
2. All strings of digit that contain no leading 0?s.
03
(b) Explain backtracking with example. 04
(c) Construct a DFA for a given regular expression (a|b)*abb. 07
OR
(c) Construct DFA without constructing NFA for following regular expression:
a*b*a(a | b)b*a#.
07
Q.3 (a) Perform the Left factoring of following Grammar.
S ? iEtS / iEtSeS / a E ? b
03
(b) Write a brief note on input buffering techniques. 04
(c) Explain Recursive Descent Parser with example. 07
OR
Q.3 (a) Explain the following:
1. Handle
2. Forward Reference
3. Conflicts in LR Parsing
03
(b) Explain non-recursive predictive parsers. Draw the block diagram of it. 04
(c) Generate the SLR parsing table for the following Grammar.
S?Aa | bAc | bBa
A?d
B?d
07
Q.4 (a) Define attributed grammar? Which phase of the compilation process
does it facilitate? Explain with example.
03
(b) Explain Stack Allocation and Activation Record Organization in brief. 04
(c) Write down steps to set precedence relationship for Operator Precedence
Grammar. Design precedence table for:
E?E+E | E*E | E^E | id.
07
OR
Q.4 (a) Construct a DAG for (a+b)* (a+b+c). 03
(b) Explain Error Recovery Strategies in Compiler in brief. 04
(c) Show syntax directed definition for simple desk calculator. Also show
annotated parse tree for 3*5+4n, where n indicates newline.
07
Q.5 (a) Differentiate: static v/s dynamic memory allocations. 03
(b) Discuss symbol table management in detail. 04
FirstRanker.com - FirstRanker's Choice
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ? VII (New) EXAMINATION ? WINTER 2019
Subject Code: 2170701 Date: 23/11/2019

Subject Name: Compiler Design
Time: 10:30 AM TO 01:00 PM Total Marks: 70

Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.


MARKS

Q.1 (a) Explain tokens, lexemes, Pattern with example. 03
(b) Distinguish between ambiguous and unambiguous grammar? 04
(c) Explain the analysis synthesis model of compilation. List the factors that
affect the design of compiler. Also List major functions done by compiler.
07

Q.2 (a) Write a regular definition for
1. The Language of all strings that do not end with 01.
2. All strings of digit that contain no leading 0?s.
03
(b) Explain backtracking with example. 04
(c) Construct a DFA for a given regular expression (a|b)*abb. 07
OR
(c) Construct DFA without constructing NFA for following regular expression:
a*b*a(a | b)b*a#.
07
Q.3 (a) Perform the Left factoring of following Grammar.
S ? iEtS / iEtSeS / a E ? b
03
(b) Write a brief note on input buffering techniques. 04
(c) Explain Recursive Descent Parser with example. 07
OR
Q.3 (a) Explain the following:
1. Handle
2. Forward Reference
3. Conflicts in LR Parsing
03
(b) Explain non-recursive predictive parsers. Draw the block diagram of it. 04
(c) Generate the SLR parsing table for the following Grammar.
S?Aa | bAc | bBa
A?d
B?d
07
Q.4 (a) Define attributed grammar? Which phase of the compilation process
does it facilitate? Explain with example.
03
(b) Explain Stack Allocation and Activation Record Organization in brief. 04
(c) Write down steps to set precedence relationship for Operator Precedence
Grammar. Design precedence table for:
E?E+E | E*E | E^E | id.
07
OR
Q.4 (a) Construct a DAG for (a+b)* (a+b+c). 03
(b) Explain Error Recovery Strategies in Compiler in brief. 04
(c) Show syntax directed definition for simple desk calculator. Also show
annotated parse tree for 3*5+4n, where n indicates newline.
07
Q.5 (a) Differentiate: static v/s dynamic memory allocations. 03
(b) Discuss symbol table management in detail. 04
2
(c) Translate following arithmetic expression ( a * b ) + ( c + d ) - ( a + b) into
1] Quadruples
2] Triple
3] Indirect Triple
07
OR


Q.5 (a) Explain any three code optimization techniques with example. 03
(b) Explain various parameter passing methods. 04
(c) Explain various issues in design of code generator.

07

*************
FirstRanker.com - FirstRanker's Choice

This post was last modified on 20 February 2020