JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III COMPILER DESIGN Previous Question Paper (February - 2023 - R16)

B.Tech | III | II | R16 | February - 2023

Answer PaperPaper Code: 136AQMaximum Marks: 75Time: 3 Hours

Note: i) Question paper consists of Part A, Part B.
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.

Part A

1.a

Define linker and loader.

2 marks

Answer

A linker is a system program that takes one or more object files generated by a compiler or assembler and combines them into a single executable file by resolving references to external symbols and library functions. A loader is a part of the operating system that takes the executable file from the disk, places it into the main memory (RAM), and prepares it for execution by setting up the necessary registers and memory addresses.

1.b

Write a short note on regular expression.

3 marks

Answer

A regular expression is a formal notation used to define and represent the set of strings that constitute a regular language. It provides a declarative way to describe patterns in strings, which are essential for specifying the lexical structure of programming languages, such as identifiers, constants, and keywords.

Regular expressions are constructed using three fundamental operations:

  • Union: The union of two regular expressions r and s, denoted as r|s, represents the set of strings in either r or s.
  • Concatenation: The concatenation of r and s, denoted as rs, represents the set of strings formed by taking a string from r followed by a string from s.
  • Kleene Closure: The closure of r, denoted as r*, represents the set of strings formed by concatenating r zero or more times.

These expressions serve as the input for lexical analyzers, which use them to generate finite automata that perform pattern matching during the scanning phase of compilation.

1.c

Explain context free grammar.

2 marks

Answer

Sign in to view the complete answer paper.

1.d

Compute FIRSTs and FOLLOWs for the following grammar

R→R+R, R→R*R, R→R/R, R→(R), R→id
3 marks

Answer

Sign in to view the complete answer paper.

1.e

What are the evaluation orders for syntax directed definitions?

2 marks

Answer

Sign in to view the complete answer paper.

1.f

Explain the variants of syntax trees.

3 marks

Answer

Sign in to view the complete answer paper.

1.g

What is trace based collection?

2 marks

Answer

Sign in to view the complete answer paper.

1.h

Explain the addresses in the target code.

3 marks

Answer

Sign in to view the complete answer paper.

1.i

Define strength reduction.

2 marks

Answer

Sign in to view the complete answer paper.

1.j

Discuss about common sub expression elimination.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

2

Define compiler. Explain various phases of compiler with neat sketch.

10 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Explain various error recovery strategies in lexical analysis.

5 marks

Answer

Sign in to view the complete answer paper.

b

Construct a Finite automata and scanning algorithm for recognizing identifiers, numerical constants in ‘C’ language.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

What is left recursion? Describe the algorithm used for eliminating left recursion.

5 marks

Answer

Sign in to view the complete answer paper.

b

Eliminate left recursion in the following grammar:

E → E + T / T, T → T * F / F, F → (E) / id
5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

Write an algorithm for computing LR(K) item sets.

5 marks

Answer

Sign in to view the complete answer paper.

b

Differentiate between Top down and Bottom up parsing techniques.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Construct a Quadruple, Triple and Indirect triple for the statement

a + a * (b – c) + (b – c) * d
6 marks

Answer

Sign in to view the complete answer paper.

b

How are inherited attributes differ from synthesized attributes?

4 marks

Answer

Sign in to view the complete answer paper.

OR
7

Give syntax directed translation scheme for simple desk calculator.

10 marks

Answer

Sign in to view the complete answer paper.

8

Explain various storage allocation strategies with an example.

10 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

What is a basic block? How to construct a basic block?

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain peephole optimization with an illustrative example.

5 marks

Answer

Sign in to view the complete answer paper.

10

Explain the following with an example

10 marks
a

Constant Propagation

5 marks

Answer

Sign in to view the complete answer paper.

b

Partial Redundancy Elimination.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

Explain loop optimization techniques with example.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain various notations used in data flow analysis.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of COMPILER DESIGN from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CSE III II, February - 2023, R16.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in COMPILER DESIGN

Loading Question Papers

Fetching data from database...