JNTU

JNTU B.Tech III COMPILER DESIGN Previous Question Paper (July/August - 2023 - R13)

B.Tech | III | I | R13 | July/August - 2023

Answer PaperPaper Code: 115APMaximum 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

25 Marks

125 marks
a

Define the term Tokens in lexical analysis phase.

2 marks

Answer

A token is a sequence of characters in the source program that can be treated as a single logical unit. Examples include keywords, identifiers, operators, constants, and punctuation marks.

b

Write a short note on Context Free Grammar.

3 marks

Answer

A Context-Free Grammar (CFG) is a formal grammar used to define the syntax of programming languages. It consists of a set of recursive rules (productions) used to generate patterns of strings. A CFG is defined by a 4-tuple (V, Σ, R, S), where V is a set of non-terminals, Σ is a set of terminals, R is a set of production rules of the form A → α, and S is the start symbol.

c

List different rules to compute FIRSTSET.

2 marks

Answer

Sign in to view the complete answer paper.

d

Brief different types of LR parsers.

3 marks

Answer

Sign in to view the complete answer paper.

e

List different data structures used for symbol table.

2 marks

Answer

Sign in to view the complete answer paper.

f

Define syntax tree? Draw the syntax tree for the assignment statement a := b * -c + b * -c.

3 marks

Answer

Sign in to view the complete answer paper.

g

Define DAG.

2 marks

Answer

Sign in to view the complete answer paper.

h

Write a short note on global optimization.

3 marks

Answer

Sign in to view the complete answer paper.

i

Write in detail the issues in the design of code generator.

2 marks

Answer

Sign in to view the complete answer paper.

j

List the properties of code generation.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

50 Marks

210 marks
a

Differentiate between the Pass and Phase in compiler construction.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain the general format of a LEX program with example.

5 marks

Answer

Sign in to view the complete answer paper.

OR
3

Prepare the predictive parser for the following grammar: S→a|b|(T), T →T, S|S. Write down the necessary algorithms and define FIRST and FOLLOW. Show the behavior of the parser in the sentences: a) (a,(a,a)) b) ((a,a),a,(a),a).

10 marks

Answer

Sign in to view the complete answer paper.

4

State shift-reduce parsing? Explain in detail the conflicts that may occur during shift-reduce parsing. Illustrate with an example.

10 marks

Answer

Sign in to view the complete answer paper.

OR
5

Construct SLR parsing table for the following grammar: E→E+T|T, T→T*F|F, F→(E)|id.

10 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Explain Intermediate code generation for Basic block.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write the advantages and disadvantages of heap storage allocation strategies.

5 marks

Answer

Sign in to view the complete answer paper.

OR
7

Explain three address codes and mention its types. Generate the three-address code for the following C program fragment: while(a > b) { if (c < d) x = y + z; else x = y - z; }

10 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Explain the principle sources of code optimization in detail.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a brief note on Data Flow Analysis of structural programs.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Construct the DAG for the following basic block: D:=B*C, E:=A+B, B:=B+C, A:=E-D

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain in detail about Copy Propagation.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

Discuss various object code forms.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a short note on DAG for register allocation.

5 marks

Answer

Sign in to view the complete answer paper.

OR
11

Explain Machine dependent code optimization in detail with an example.

10 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of COMPILER DESIGN from JNTU for B.Tech CSE(AIML) III I, July/August - 2023, R13.

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...