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

Compiler Put

This document is an examination paper for a Compiler Design course at R.D. Engineering College, Ghaziabad, for B.Tech students. It consists of three sections with questions covering various topics such as compiler writing tools, parsing techniques, semantic errors, and code optimization. Students are required to answer questions from each section, with varying marks allocated to each question.

Uploaded by

Khushboo Garg
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)
6 views2 pages

Compiler Put

This document is an examination paper for a Compiler Design course at R.D. Engineering College, Ghaziabad, for B.Tech students. It consists of three sections with questions covering various topics such as compiler writing tools, parsing techniques, semantic errors, and code optimization. Students are required to answer questions from each section, with varying marks allocated to each question.

Uploaded by

Khushboo Garg
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

ROLL NO.

R.D. Engineering College, Ghaziabad


B.Tech.(CSE/IT)
(Sem-V) Pre University Test(2021-2022)
Compiler Design

Time:3:00 hrs Max Marks: 100


Note:- Attempt questions from each section as per instructions.
-----------------------------------------------------------------------------------------------------------------------------------

Section-A

1) Answer all questions. Each question carry equal marks (10*2=20)


a) Name various Compiler Writing Tools?
b) How YACC can be used to generate Parser?
c) Differentiate between Top Down Parser and Bottom Up Parser.
d) Consider the following grammar and remover left factoring from it
A->xByA |xByAzA |a
B-> b
e) What is activation record?
f) Draw the syntax tree and DAG for the expression
(a * b) + (c-d) * (a*b) +b
g) Define Backpatching.
h) Discuss Semantic Erros.
i) What is Dead Code Elimination?
j) Why we need Code Optimization? Discuss.

Section-B

2) Answer any six questions. Each question carries equal marks. (6*5=30)
a) What is Compiler? Explain all the necessary phases and passes in a Compiler Design.
b) Consider the Grammar
S ->( L) | a
L ->L,S|S
Find parse tree for the following string
(i) (a,(a,a))
(ii) (a,((a,a,)(a,a,)))
c) Translate the expression
–(a+b)*(c+d)+(a+b+c) into Quadruples, Triples and Indirect Triples
d) Find the LEADING and TRAILING of the grammar
A->AcB |cC |C
B ->bB |id
C-> c|€
e) Discuss Symbol Table and various data structures for symbol table.
f) What is Cross Compiler? Discuss Bootstrapping with example.
g) Explain Loop Optimization and various methods of loop optimization.
h) Define Runtime Storage Organization.

Section-C

3) Attempt all questions. Each question carries equal marks. (5*10=50)


a) Write Short note on
(i) LEX Compiler
(ii) Single Pass Compiler Vs. Multi Pass Compiler
OR
Design FA for the following regular expression
(i) R1= ab*(ab+b) + b+ (a+bb)
(ii) R2=(a + b* ab)abb
b) Check the following grammar is LL(i)
S->aSA | €
A-> bB |bAC
B-> bd | €
OR
Desing CLRParsing table and LALR parsing table for the grammar
E-> BB
B->cB |d

c) Generate the three address code the following fragment


While (A< C and B>D) do
If A=1 then C =C +1
Else while A<=D do
A=A +B
OR
Discuss the role of Syntax Directed Translation in detail.
d) What is Error detection and recovery? Explain lexical and syntax phase errors and its recovery.
OR
Discuss various Storage Allocation Strategies.
e) What is Code Generation? Discuss various design issues of a Code Generator.
OR
Discuss various Code Optimization techniques with example.

You might also like