Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech III COMPILER DESIGN Previous Question Paper (May - 2018 - R13)

B.Tech | III | I | R13 | May - 2018

Answer PaperPaper Code: 115APMaximum Marks: 75Time: 3 hours

Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit.

Part A

125 marks
a

What are the two parts of a compilation? Explain briefly.

2 marks

Answer

The two main parts of a compilation are the Analysis (or front end) and the Synthesis (or back end).

The Analysis part breaks the source code into smaller pieces and creates an intermediate representation. It typically includes lexical analysis, syntax analysis, and semantic analysis.

The Synthesis part takes the intermediate representation and generates the target code. It typically includes intermediate code generation, code optimization, and code generation.

b

Define a context free grammar.

3 marks

Answer

A Context-Free Grammar (CFG) is a formal grammar that can be used to generate all of the strings in a given formal language. It is a set of production rules that describe how to form strings in the language. A CFG is defined by four components: a set of non-terminal symbols, a set of terminal symbols, a set of production rules, and a start symbol.

c

List the properties of LR parser.

2 marks

Answer

Sign in to view the complete answer paper.

d

Write short notes on YACC.

3 marks

Answer

Sign in to view the complete answer paper.

e

What are the various types of intermediate code representation?

2 marks

Answer

Sign in to view the complete answer paper.

f

Give the format of symbol table

3 marks

Answer

Sign in to view the complete answer paper.

g

List the terminologies used in basic blocks.

2 marks

Answer

Sign in to view the complete answer paper.

h

What is a flow graph?

3 marks

Answer

Sign in to view the complete answer paper.

i

Mention the properties that a code generator should possess.

2 marks

Answer

Sign in to view the complete answer paper.

j

What is a DAG? Mention its applications.

3 marks

Answer

Sign in to view the complete answer paper.

Unit I

2

Explain in detail about the role of Lexical analyzer with the possible error Recovery actions.

10 marks

Answer

Sign in to view the complete answer paper.

OR
3

Construct Predictive parsing table for the following grammar and check whether the (a, a) belong to that grammar or not.

S -> (L) | a
L -> L, S | S
10 marks

Answer

Sign in to view the complete answer paper.

Unit II

4

Give the LALR parsing table for the grammar.

S -> L = R | R
L -> * R | id
R -> L
10 marks

Answer

Sign in to view the complete answer paper.

OR
5

Compare and contrast between SLR, LALR and LR parses.

10 marks

Answer

Sign in to view the complete answer paper.

Unit III

6

How would you generate the intermediate code for the flow of control statements? Explain with examples.

10 marks

Answer

Sign in to view the complete answer paper.

OR
7

Explain how the types and relative addresses of declared names are computed and how scope information is dealt with.

10 marks

Answer

Sign in to view the complete answer paper.

Unit IV

8

Write about Data flow analysis of structural programs.

10 marks

Answer

Sign in to view the complete answer paper.

OR
9

Explain the principle sources of optimization in detail.

10 marks

Answer

Sign in to view the complete answer paper.

Unit V

10

Give an example to explain in detail about machine dependent code optimization.

10 marks

Answer

Sign in to view the complete answer paper.

OR
11

Describe how DAG can be used in register allocation process? Give examples.

10 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of COMPILER DESIGN from Jawaharlal Nehru Technological University Hyderabad for B.Tech CSE III I, May - 2018, R13.

For the question paper without answers, switch to the Question Paper tab.

Other papers in COMPILER DESIGN

Loading Question Papers

Fetching data from database...