This download link is referred from the post: GTU BE/B.Tech 2017 Winter Question Papers || Gujarat Technological University
Subject Code: 2170701
GUJARAT TECHNOLOGICAL UNIVERSITY
--- Content provided by FirstRanker.com ---
BE - SEMESTER-VII (NEW) EXAMINATION — WINTER 2017
Subject Name: Complier Design
Date: 02/11/2017
Time: 10:30 AM TO 01:00 PM
Total Marks: 70
--- Content provided by FirstRanker.com ---
Instructions:
- Attempt all questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
Q.1
--- Content provided by FirstRanker.com ---
- What is the difference between compiler and interpreter? (03 MARKS)
- Explain analysis phase of the source program with example. (04 MARKS)
- Write an algorithm for Thompson’s construction method. Apply the algorithm to construct NFA for following regular expression. (a | b)*abb. (07 MARKS)
Q.2
- What is a pass in a compiler? What is the effect of reducing the number of passes? (03 MARKS)
- Explain error recovery strategies used by parser. (04 MARKS)
- What is operator grammar? Generate precedence function table for following grammar. (07 MARKS)
E -> EAE | id
A -> + | *
--- Content provided by FirstRanker.com ---
OR
--- Content provided by FirstRanker.com ---
- Define handle and handle pruning. Explain the stack implementation of shift reduce parser with the help of example: (07 MARKS)
Q.3
- Give the translation scheme that converts infix to postfix notation. Generate the annotated parse tree for input string 3-5+4. (03 MARKS)
- Explain buffer pairs and sentinels. (04 MARKS)
- Check given grammar is LL(1) but not SLR(1). (07 MARKS)
--- Content provided by FirstRanker.com ---
S -> AaAb | BbBa
A -> €
B -> €
OR
- Write a rule of Left factoring a grammar and give example. (03 MARKS)
- Explain role of lexical analyzer. (04 MARKS)
- Define syntax tree. What is s-attributed definition? Explain construction of syntax tree for the expression a-4+c using SDD. (07 MARKS)
--- Content provided by FirstRanker.com ---
Q.4
- Translate the arithmetic expression a*-(b+c) into (03 MARKS)
- Syntax tree
- Postfix notation
- Three address code
--- Content provided by FirstRanker.com ---
- Write Syntax Directed Definition to produce three address code for the expression containing the operators :=, +, - (unary minus), ( ) and id. (04 MARKS)
- What is activation record? Explain stack allocation of activation records using example. (07 MARKS)
OR
--- Content provided by FirstRanker.com ---
- What is activation tree? (03 MARKS)
- Explain parameter passing techniques for procedure. (04 MARKS)
- What is importance of intermediate code? Discuss various representations of three address code using the given expression. a=b *-c+b * -c . (07 MARKS)
Q.5
- What is code optimization? Explain data flow equation. (03 MARKS)
- Describe code generator design issues. (04 MARKS)
--- Content provided by FirstRanker.com ---
OR
- Define following : DAG, Basic Blocks, Flow graph (03 MARKS)
- Explain peephole optimization. (04 MARKS)
- Explain function preserving transformations with example. (07 MARKS)
--- Content provided by FirstRanker.com ---
This download link is referred from the post: GTU BE/B.Tech 2017 Winter Question Papers || Gujarat Technological University
--- Content provided by FirstRanker.com ---