JNTU
JNTU B.Tech III AUTOMATA AND COMPILER DESIGN Previous Question Paper (March - 2021 - R13/R15)
Answer any five questions
All questions carry equal marks
Main
Write about the identity rules for regular expressions.
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)*.
Explain in brief about LEX tool.
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.
Construct Finite Automata for (0+1)*.
Answer
Sign in to view the complete answer paper.
Define Regular Expression. Explain about the Properties of Regular Expressions.
Answer
Sign in to view the complete answer paper.
Define Shift Reduce Parsing? Explain in brief about the four actions in shift reduce parser.
Answer
Sign in to view the complete answer paper.
Construct a LALR parsing table for the Grammar E→E+T|T, T→T*F|F, F→(E)|id.
Answer
Sign in to view the complete answer paper.
Explain in brief about YACC.
Answer
Sign in to view the complete answer paper.
Construct STD for a basic calculator.
Answer
Sign in to view the complete answer paper.
Write in detail about simple type checker.
Answer
Sign in to view the complete answer paper.
Discuss about equivalence of type expressions with examples.
Answer
Sign in to view the complete answer paper.
Describe about function overloading.
Answer
Sign in to view the complete answer paper.
Define scope of a variable.
Answer
Sign in to view the complete answer paper.
Explain in brief about dynamic storage allocation strategy.
Answer
Sign in to view the complete answer paper.
Write a brief note on peephole optimization.
Answer
Sign in to view the complete answer paper.
What is DAG? Construct DAG for the following Basic block?
D := B*C; E := A+B; B := B+C; A := E-D;
Answer
Sign in to view the complete answer paper.
Explain generic code generation algorithm.
Answer
Sign in to view the complete answer paper.