Enrolment No.
Subject Code: 170701
--- Content provided by FirstRanker.com ---
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER-VII (OLD) EXAMINATION — WINTER 2018
Subject Name: Compiler Design
Time: 10:30 AM TO 01:00 PM
Instructions:
--- Content provided by FirstRanker.com ---
- Attempt all questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
- (a) Discuss the phases of a compiler with sketch. (07)
(b) I. Discuss Input Buffer Pairs for Lexical Analyzer. (07)--- Content provided by FirstRanker.com ---
II. List and Explain Cousins of Compiler. - (a) Explain working of non-Recursive Predictive Parser with diagram. (07)
(b) What do you mean by ambiguous grammar? Show that following is an ambiguous grammar. (07)
E—E+E |E*E |E-E |E/E | (E) | id
OR--- Content provided by FirstRanker.com ---
Construct a DFA without constructing NFA for the following regular expression.
a(a|b)*ab - (a) How do you check whether the grammar is LL (1) or not? Generate LL(1) parsing table for given Grammar (07)
S — iEtS | iEtSeS | a
E—b--- Content provided by FirstRanker.com ---
Is Grammar LL(1) or not?
(b) Explain subset construction method for constructing DFA from an NFA with an example. (07)
OR
Show that the following grammar
S— AaAb | BbBa--- Content provided by FirstRanker.com ---
A—e
B—e
is LL(1) but not SLR(1). - (a) Write a short note on operator precedence parsing for +, *, $, id. (07)
(b) Explain syntax directed translation scheme for Infix to Postfix conversation with example. (07) - (a) Write a syntax directed definition of a simple desk calculator and draw an annotated parse tree for 4 * 3 +2 n. (07)
OR
Explain Inherited attributes with the help of an example.
(b) I. Explain various parameter passing methods. (07)
II. What is left factoring? Discuss it with the help of an example. - (a) What is Intermediate Code? Discuss various representations of three address code for (07)
a=(a+b*c)*(b*c)+(b+c)*a
(b) Explain activation record. How is task divided between calling & called program for stack updating? (07)
OR
Discuss code optimization with an example. - (a) Discuss Design Issues of Code Generator. (07)
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
Date: 03/12/2018
Total Marks: 70
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE/B.Tech 2018 Winter Question Papers || Gujarat Technological University