0% found this document useful (0 votes)
50 views2 pages

2170701

This document appears to be an exam for a Compiler Design course. It contains 5 questions assessing various topics related to compilers. The topics covered include: tokenization and parsing; regular expressions and finite automata; grammar analysis techniques like left factoring, recursive descent parsing, LR parsing; symbol tables; code generation through techniques like quadruples and triples; optimization; and code generator design issues. The exam tests students' understanding of fundamental compiler design concepts and their ability to apply techniques like constructing parsing tables and syntax-directed translations.

Uploaded by

rinkal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

2170701

This document appears to be an exam for a Compiler Design course. It contains 5 questions assessing various topics related to compilers. The topics covered include: tokenization and parsing; regular expressions and finite automata; grammar analysis techniques like left factoring, recursive descent parsing, LR parsing; symbol tables; code generation through techniques like quadruples and triples; optimization; and code generator design issues. The exam tests students' understanding of fundamental compiler design concepts and their ability to apply techniques like constructing parsing tables and syntax-directed translations.

Uploaded by

rinkal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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 07
affect the design of compiler. Also List major functions done by compiler.

Q.2 (a) Write a regular definition for 03


1. The Language of all strings that do not end with 01.
2. All strings of digit that contain no leading 0’s.
(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: 07
a*b*a(a | b)b*a#.
Q.3 (a) Perform the Left factoring of following Grammar. 03
S → iEtS / iEtSeS / a E→b
(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: 03
1. Handle
2. Forward Reference
3. Conflicts in LR Parsing
(b) Explain non-recursive predictive parsers. Draw the block diagram of it. 04
(c) Generate the SLR parsing table for the following Grammar. 07
S→Aa | bAc | bBa
A→d
B→d
Q.4 (a) Define attributed grammar? Which phase of the compilation process 03
does it facilitate? Explain with example.
(b) Explain Stack Allocation and Activation Record Organization in brief. 04
(c) Write down steps to set precedence relationship for Operator Precedence 07
Grammar. Design precedence table for:
E→E+E | E*E | E^E | id.
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 07
annotated parse tree for 3*5+4n, where n indicates newline.
Q.5 (a) Differentiate: static v/s dynamic memory allocations. 03
(b) Discuss symbol table management in detail. 04

1
(c) Translate following arithmetic expression ( a * b ) + ( c + d ) - ( a + b) into 07
1] Quadruples
2] Triple
3] Indirect Triple
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

*************

You might also like