JNTU

JNTU B.Tech III AUTOMATA AND COMPILER DESIGN Previous Question Paper (March - 2021 - R13/R15)

B.Tech | III | III-I | R13/R15 | March - 2021

Answer PaperPaper Code: 125DR/115DRMaximum Marks: 75Time: 3 hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

Write about the identity rules for regular expressions.

7 marks

Answer

Regular expression identities are algebraic laws used to manipulate and simplify expressions while maintaining language equivalence. The following are the fundamental identities:

  • ε-Closure Identities: ε + R = R + ε = R, and Rε = εR = R.
  • Annihilation: ∅R = R∅ = ∅ and ∅* = ε.
  • Idempotence: R + R = R.
  • Commutativity: R + S = S + R.
  • Associativity: (R + S) + T = R + (S + T) and (RS)T = R(ST).
  • Distributivity: R(S + T) = RS + RT and (S + T)R = SR + TR.
  • Kleene Star Identities: R* = (ε + R)* = (ε + R)R* = R*R + ε, and (R*S)*R* = (R + S)*.
  • Shifting Rule: (RS)*R = R(SR)*.
b

Explain in brief about LEX tool.

8 marks

Answer

LEX is a computer program generator designed to create lexical analyzers (scanners). It takes a set of high-level descriptions of tokens as input and produces a C program that implements a finite automaton to recognize those tokens.

The LEX process involves three main sections:

  • Definitions: Contains declarations of manifest constants, regular definitions, and start conditions.
  • Rules: The core section containing patterns (regular expressions) and the corresponding actions (C code) to be executed when a pattern is matched.
  • User Subroutines: Contains auxiliary C functions used by the actions in the rules section.

The input file, typically named lex.l, is processed by the LEX compiler to generate lex.yy.c. This file is then compiled by a standard C compiler to produce the executable lexical analyzer, which reads an input stream of characters and produces a stream of tokens for the parser.

215 marks
a

Construct Finite Automata for (0+1)*.

7 marks

Answer

Sign in to view the complete answer paper.

b

Define Regular Expression. Explain about the Properties of Regular Expressions.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Define Shift Reduce Parsing? Explain in brief about the four actions in shift reduce parser.

8 marks

Answer

Sign in to view the complete answer paper.

b

Construct a LALR parsing table for the Grammar E→E+T|T, T→T*F|F, F→(E)|id.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Explain in brief about YACC.

7 marks

Answer

Sign in to view the complete answer paper.

b

Construct STD for a basic calculator.

8 marks

Answer

Sign in to view the complete answer paper.

5

Write in detail about simple type checker.

15 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Discuss about equivalence of type expressions with examples.

8 marks

Answer

Sign in to view the complete answer paper.

b

Describe about function overloading.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Define scope of a variable.

3 marks

Answer

Sign in to view the complete answer paper.

b

Explain in brief about dynamic storage allocation strategy.

6 marks

Answer

Sign in to view the complete answer paper.

c

Write a brief note on peephole optimization.

6 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

What is DAG? Construct DAG for the following Basic block?

D := B*C; E := A+B; B := B+C; A := E-D;

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain generic code generation algorithm.

7 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of AUTOMATA AND COMPILER DESIGN from JNTU for B.Tech IT III III-I, March - 2021, R13/R15.

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

Other papers in AUTOMATA AND COMPILER DESIGN

Loading Question Papers

Fetching data from database...