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

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

1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?VII (NEW) EXAMINATION ? WINTER 2017
Subject Code: 2170701 Date:02/11/2017

Subject Name: Complier 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) What is the difference between compiler and interpreter? 03
(b) Explain analysis phase of the source program with example. 04
(c) Write an algorithm for Thompson?s construction method. Apply the
algorithm to construct NFA for following regular expression. (a | b)*abb.
07

Q.2 (a) What is a pass in a compiler? What is the effect of reducing the number of
passes?
03
(b) Explain error recovery strategies used by parser. 04
(c) What is operator grammar? Generate precedence function table for
following grammar.
E -> EAE | id
A -> + | *
07
OR
(c) Define handle and handle pruning. Explain the stack implementation of
shift reduce parser with the help of example.
07
Q.3 (a) Give the translation scheme that converts infix to postfix notation.
Generate the annotated parse tree for input string 3-5+4.
03
(b) Explain buffer pairs and sentinels. 04
(c) Check given grammar is LL(1) but not SLR(1).
S -> AaAb | BbBa
A -> ?
B -> ?
07
OR
Q.3 (a) Write a rule of Left factoring a grammar and give example. 03
(b) Explain role of lexical analyzer. 04
(c) Define syntax tree. What is s-attributed definition? Explain construction of
syntax tree for the expression a-4+c using SDD.
07
Q.4 (a) Translate the arithmetic expression a*-(b+c) into
1. Syntax tree
2. Postfix notation
3. Three address code
03
(b) Write Syntax Directed Definition to produce three address code for the
expression containing the operators := , + , - (unary minus), ( ) and id.
04
(c) What is activation record? Explain stack allocation of activation records
using example.
07
OR
Q.4 (a) What is activation tree? 03
(b) Explain parameter passing techniques for procedure. 04
(c) What is importance of intermediate code? Discuss various representations
of three address code using the given expression. a = b * -c + b * -c .
07
FirstRanker.com - FirstRanker's Choice
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?VII (NEW) EXAMINATION ? WINTER 2017
Subject Code: 2170701 Date:02/11/2017

Subject Name: Complier 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) What is the difference between compiler and interpreter? 03
(b) Explain analysis phase of the source program with example. 04
(c) Write an algorithm for Thompson?s construction method. Apply the
algorithm to construct NFA for following regular expression. (a | b)*abb.
07

Q.2 (a) What is a pass in a compiler? What is the effect of reducing the number of
passes?
03
(b) Explain error recovery strategies used by parser. 04
(c) What is operator grammar? Generate precedence function table for
following grammar.
E -> EAE | id
A -> + | *
07
OR
(c) Define handle and handle pruning. Explain the stack implementation of
shift reduce parser with the help of example.
07
Q.3 (a) Give the translation scheme that converts infix to postfix notation.
Generate the annotated parse tree for input string 3-5+4.
03
(b) Explain buffer pairs and sentinels. 04
(c) Check given grammar is LL(1) but not SLR(1).
S -> AaAb | BbBa
A -> ?
B -> ?
07
OR
Q.3 (a) Write a rule of Left factoring a grammar and give example. 03
(b) Explain role of lexical analyzer. 04
(c) Define syntax tree. What is s-attributed definition? Explain construction of
syntax tree for the expression a-4+c using SDD.
07
Q.4 (a) Translate the arithmetic expression a*-(b+c) into
1. Syntax tree
2. Postfix notation
3. Three address code
03
(b) Write Syntax Directed Definition to produce three address code for the
expression containing the operators := , + , - (unary minus), ( ) and id.
04
(c) What is activation record? Explain stack allocation of activation records
using example.
07
OR
Q.4 (a) What is activation tree? 03
(b) Explain parameter passing techniques for procedure. 04
(c) What is importance of intermediate code? Discuss various representations
of three address code using the given expression. a = b * -c + b * -c .
07
2
Q.5 (a) Explain three loop optimization techniques with example. 03
(b) What is code optimization? Explain data flow equation. 04
(c) Describe code generator design issues. 07
OR

Q.5 (a) Define following : DAG, Basic Blocks, Flow graph 03
(b) Explain peephole optimization. 04
(c) Explain function preserving transformations with example. 07

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

This post was last modified on 20 February 2020