JNTU

JNTU B.Tech III AUTOMATA AND COMPILER DESIGN Previous Question Paper (May/June - 2019 - R15)

B.Tech | III | III-I | R15 | May/June - 2019

Answer PaperPaper Code: 125DRMaximum Marks: 75Time: 3 hours

Note: This question paper contains two parts A and B. 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. Each question carries 10 marks and may have a, b, c as sub questions.

Part A

125 marks
a

Define the term lexical analyzer.

2 marks

Answer

A lexical analyzer, or scanner, is the first phase of a compiler that reads the input source program character by character and groups them into meaningful sequences called lexemes, which are then converted into tokens for the syntax analyzer.

b

Construct NFA corresponding the regular expression a(a+b)*ab .

3 marks

Answer

The NFA for the regular expression a(a+b)*ab is constructed as follows:

  1. Start state 0 transitions to state 1 on input 'a'.
  2. State 1 transitions to itself on 'a' or 'b' (representing (a+b)*).
  3. State 1 transitions to state 2 on input 'a'.
  4. State 2 transitions to state 3 on input 'b'.
  5. State 3 is the final accepting state.
c

What do you mean by Handle pruning?

2 marks

Answer

Sign in to view the complete answer paper.

d

Write the procedure to find CLOSURE of an LR(0) item.

3 marks

Answer

Sign in to view the complete answer paper.

e

Define context sensitive grammar? What language does the grammar S →aSa | bSb | c generate?

2 marks

Answer

Sign in to view the complete answer paper.

f

Define type 3 grammar.

3 marks

Answer

Sign in to view the complete answer paper.

g

What do you mean by dead code?

2 marks

Answer

Sign in to view the complete answer paper.

h

What are the rules to determine the leaders of basic blocks? What are the primary structure preserving transformations on basic blocks?

3 marks

Answer

Sign in to view the complete answer paper.

i

Mention the applications of DAGs.

2 marks

Answer

Sign in to view the complete answer paper.

j

What do you mean by machine dependant code generation?

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Construct DFA equivalent to the NFA { { P, Q, R, S }, {0, 1 }, , P, {P, Q} } , where the transition function given by table.

5 marks

Answer

Sign in to view the complete answer paper.

b

Construct an LL(1) parsing Table for the grammar: E → E+T | T; T → T*F | F; F → (E) | id

5 marks

Answer

Sign in to view the complete answer paper.

OR
3

Consider the grammar: lexp → atom | list; atom → number | identifier; list → ( lexp_seq ); lexp_seq → lexp_seq lexp | lexp. Answer: a) Remove left recursion, b) Construct FIRST and FOLLOW set, c) Construct LL(1) parsing table.

10 marks

Answer

Sign in to view the complete answer paper.

4

Construct SLR parser for the grammar: E → (L) | a; L → L, E | E. Check the behavior of parser with an example string.

10 marks

Answer

Sign in to view the complete answer paper.

OR
5

Consider the grammar: E → (L) | a; L → L, E | E. Construct LR(1) items and LR(1) parsing table.

10 marks

Answer

Sign in to view the complete answer paper.

6

Give syntax Directed Translation definition for type checking of an expression.

10 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

What is phase structure grammar? Explain Chomsky classification of grammar with examples.

5 marks

Answer

Sign in to view the complete answer paper.

b

Define phrase structure grammar and explain Chomsky classification in detail.

5 marks

Answer

Sign in to view the complete answer paper.

8

Explain in detail about peephole optimization.

10 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Differentiate between static scope and dynamic scope. Explain the implementation of static scoping.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is code optimization? Differentiate between machine dependent and machine independent code optimization.

5 marks

Answer

Sign in to view the complete answer paper.

10

Construct the DAG for the following basic block and apply common sub-expression and dead code elimination: a = b + c; b = b – d; c = c + d; e = b + c. Assume a, b are live and c, e are non-live on exit.

10 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

What is DAG? Why is it used? Construct DAG for: Z = X – Y + X * Y * U – V/W + X + V

5 marks

Answer

Sign in to view the complete answer paper.

b

Consider the sequence of three address instructions provided. If we have ONE register available, which variables would you put into a register assuming memory operations are twice as slow?

5 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, May/June - 2019, 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...