Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech III AUTOMATA AND COMPILER DESIGN Previous Question Paper (September - 2021 - R13)

B.Tech | III | I | R13 | September - 2021

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

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Find the First and Follow sets for the following grammar:

E → TA, A → +TA | ε, T → FB, B → *FB | ε, F → (E) | id
7 marks

Answer

To compute the First and Follow sets, we analyze the productions:

  • First(F) = { (, id }
  • First(B) = { *, ε }
  • First(T) = First(F) = { (, id }
  • First(A) = { +, ε }
  • First(E) = First(T) = { (, id }

Follow sets:

  • Follow(E) = { $, ) }
  • Follow(A) = Follow(E) = { $, ) }
  • Follow(T) = First(A) ∪ Follow(A) = { +, $, ) }
  • Follow(B) = Follow(T) = { +, $, ) }
  • Follow(F) = First(B) ∪ Follow(B) = { *, +, $, ) }
b

Draw NFA for recognizing the language generated by (0+1) (01)*(011)*. Convert it into DFA. Check the acceptance of 1011 by both FAs.

8 marks

Answer

The NFA for (0+1)(01)*(011)* consists of a start state q0 transitioning to q1 on 0 or 1. From q1, transitions are defined for (01)* and (011)* using intermediate states to track the sequences. Conversion to DFA involves creating subset states: State A={q0}, State B={q1}, State C={q2} (after 0), State D={q3} (after 1), etc., until all transitions are deterministic.

For the input 1011:

  • NFA: Start at q0, take transition 1 to q1, then follow the path for 0, 1, 1. Since the final state reached is an accepting state, 1011 is accepted.
  • DFA: Starting from the initial state, follow the transitions corresponding to 1, 0, 1, 1. If the resulting state is in the set of accepting states (those containing the NFA final state), the string is accepted.
2

Check whether the following grammar is LL(1) or not by constructing the predictive parsing table.

S → iCtS | iCtSeS | a, C → b

Show the moves of the parser for ibta.

15 marks

Answer

Sign in to view the complete answer paper.

3

Construct LALR parsing table for the following grammar. Show the actions of the parser for the string abde.

S → aABe, A → Abc | b, B → d
15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

With an example, explain the process of bottom up evaluation of S-attributed definitions.

8 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about the method of resolving ambiguities in YACC with an example.

7 marks

Answer

Sign in to view the complete answer paper.

5

Discuss the Chomsky hierarchy of languages and recognizers.

15 marks

Answer

Sign in to view the complete answer paper.

6

List and explain the overloading of functions and operations.

15 marks

Answer

Sign in to view the complete answer paper.

7

Discuss the term Run Time Support and Storage Organization.

15 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Illustrate the Machine dependent code generation.

8 marks

Answer

Sign in to view the complete answer paper.

b

Give a brief note on object code forms.

7 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of AUTOMATA AND COMPILER DESIGN from Jawaharlal Nehru Technological University Hyderabad for B.Tech IT III I, September - 2021, R13.

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

Other papers in AUTOMATA AND COMPILER DESIGN

Loading Question Papers

Fetching data from database...