JNTU
JNTU B.Tech III AUTOMATA AND COMPILER DESIGN Previous Question Paper (August - 2022 - R13)
Answer any five questions. All questions carry equal marks.
Main
Convert the following NFA into an equivalent DFA.
Answer
To convert an NFA to a DFA, we use the subset construction algorithm. Given an NFA with states {q0, q1, q2} and transitions, we define the DFA states as subsets of the NFA states. Starting with the epsilon-closure of the initial state, we compute the transition for each input symbol by finding the union of all reachable states in the NFA. For example, if the NFA has transitions δ(q0, a) = {q0, q1}, the DFA state {q0} on input 'a' transitions to the DFA state {q0, q1}. We repeat this process for every newly created subset until no new states are generated. Finally, any DFA state containing an NFA final state is marked as a final state in the DFA.
Find the NFA which accepts L(r) where r = (a+bb)*(ba* + b).
Answer
To construct an NFA for the regular expression r = (a + bb)*(ba* + b), we use Thompson's construction method by building smaller NFAs for each sub-expression and connecting them using epsilon transitions.
- Construct the NFA for (a + bb) by creating a union of the NFA for 'a' and the NFA for 'bb' (a sequence of two 'b' transitions), then apply the Kleene star closure.
- Construct the NFA for (ba* + b) by creating a union of the NFA for 'ba*' (a 'b' transition followed by 'a' star closure) and the NFA for 'b'.
- Concatenate the NFA from step 1 with the NFA from step 2 using an epsilon transition to represent the concatenation operator.
- The resulting NFA will have a start state with an epsilon transition to the Kleene star structure, which then transitions to the final part of the expression, ending in an accepting state.
Describe the role of lexical analysis in compiler design.
Answer
Sign in to view the complete answer paper.
Find out FIRST and FOLLOW for the following grammar:
A→ 1AC | 0C
B→ 0S
C→ 1
Answer
Sign in to view the complete answer paper.
List the different conflicts that occur in Bottom up parsing and give examples.
Answer
Sign in to view the complete answer paper.
Construct CLR parsing table for the following grammar:
A → bS | c
Answer
Sign in to view the complete answer paper.
What do you mean by attributed grammars? Discuss the translation scheme for converting an infix expression to its equivalent postfix form.
Answer
Sign in to view the complete answer paper.
What is intermediate code? Explain different types of intermediate code representations.
Answer
Sign in to view the complete answer paper.
Discuss in detail about the specification of simple type Checker.
Answer
Sign in to view the complete answer paper.
Define a type expression? Explain the equivalence of type expressions with an appropriate example.
Answer
Sign in to view the complete answer paper.
Write about Chomsky hierarchy of languages and recognizers.
Answer
Sign in to view the complete answer paper.
How do you check the expressions in polymorphic functions? Explain through an example.
Answer
Sign in to view the complete answer paper.
Explain the principle sources of code optimization in detail.
Answer
Sign in to view the complete answer paper.
List the advantages and disadvantages of Static storage allocation strategies.
Answer
Sign in to view the complete answer paper.
Write about the issues in code generation.
Answer
Sign in to view the complete answer paper.
Describe the various strategies in register allocation.
Answer
Sign in to view the complete answer paper.