Subject Code: 2170701
GUJARAT TECHNOLOGICAL UNIVERSITY
--- Content provided by FirstRanker.com ---
BE - SEMESTER-VII (NEW) EXAMINATION - WINTER 2018
Subject Name: Compiler Design
Time: 10:30 AM TO 01:00 PM
Instructions:
- Attempt all questions.
- Make suitable assumptions wherever necessary.
- Figures to the right indicate full marks.
--- Content provided by FirstRanker.com ---
Q.1
- List the cousins of compiler and explain the role of any one of them. (03 MARKS)
- Write a brief note on input buffering techniques. (04 MARKS)
- Explain front end and back end of compiler in detail. (07 MARKS)
--- Content provided by FirstRanker.com ---
Q.2
- Define the following terms and give suitable example for it. (03 MARKS)
- Handle
- Handle pruning
- Left Factoring
--- Content provided by FirstRanker.com ---
- Explain all error recovery strategies used by parser. (04 MARKS)
- Construct LL(1) parsing table for the following Grammar: (07 MARKS)
E->E+T|T
T->T*F | F--- Content provided by FirstRanker.com ---
F->(E)|a
OR
Construct NFA for following regular expression using Thompson’s notation and then convert it into DFA.
(a/b)*abb#
Q.3
--- Content provided by FirstRanker.com ---
- Define the following terms and give suitable example for it. (03 MARKS)
- Augmented Grammar
- LR(0) Item
- LR(1) Item
- Differentiate Top Down Parsing and Bottom up parsing (04 MARKS)
- Construct SLR parsing table for the following grammar : (07 MARKS)
S ->(L)|a
L->L,S|S
OR
Give the difference between SLR and CLR Parser.--- Content provided by FirstRanker.com ---
List the different conflicts that occur in Bottom up parsing and give examples for that:
--- Content provided by FirstRanker.com ---
Q.4
- Implement the following grammar using Recursive Descent Parser. (03 MARKS)
S -> Aa|bAc|bBa
A->d--- Content provided by FirstRanker.com ---
B->d - What is Ambiguous Grammar? Describe with example. (04 MARKS)
- Give the difference between synthesized attributes and inherited attributes (07 MARKS)
Construct CLR parsing table for the following grammar :
S ->AA--- Content provided by FirstRanker.com ---
A->aA|b
OR
List the different issues in code generation phase and describe any two issues.
Q.5
- Explain parameter passing techniques for procedure. (03 MARKS)
- Explain Quadruple, triple and indirect triple with suitable example. (04 MARKS)
- x=(a+b)*(a+b+c)*(a+b+c+d) (07 MARKS)
Explain dynamic memory allocation strategy.
What is an activation record? Explain how they are used to access local and global variables.
OR--- Content provided by FirstRanker.com ---
Write a note on stack allocation strategy.
Give the translation scheme that converts infix to postfix expression for the following grammar and also generate the annotated parse tree for input string “id+id*id”
E->E+T|T
T->T*F | F
F->id--- Content provided by FirstRanker.com ---
Discuss various code optimization techniques with examples.
--- Content provided by FirstRanker.com ---
Date: 15/11/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