CD model CSE set 1
CD model CSE set 1
AnswerAllQuestions
PART– A(10X2=20)
11.a.(i) Construct the minimized DFA using the tabular method. (7)
(ii) Construct minimize DFA for regular expression (0+1)*(0+1)01 using thompson's
construction. (6)
(OR)
b.(i) Explain the role of lexical analyzer. (8)
(ii) Describe the languages denoted by the following regular expressions:
(1) a(a|b)*a
(2) ((ε|a)b*)*
(3) (a|b)*a(a|b)(a|b)
(4) a*ba*ba*ba*
(5) !!(aa|bb)((ab|ba)(aa|bb)(ab|ba)(aa|bb)*)*. (5)
12.a.(i) Consider context-free grammar.
S->SS+|SS*|a
and the string aa+a*
(1) Give a leftmost derivation for the string.
(2) Give a rightmost derivation for the string.
(3) Give a parse tree for the string.
(4) Is the grammar ambiguous or unambiguous? Justify your answer. (5)
(ii) Explain the error handling and error recovery mechanism of syntax analysers. (8)
.(OR)
b.(i) Show the following grammar.
S->SA|A
A-> a
is SLR(1) but not LL(1). (5)
(ii) State and explain the algorithm to eliminate left recursion from a grammar. (8)
13.a.(i)The expressions involving operator + and integer or floating-point operands.Floating-point
numbers are distinguished by having a decimal point.
E->E+T|T
T-> num.num num
Give an SDD to determine the type of each term T and expression E. (5)
(ii) Explain the S-Attribute Definitions with examples. (8)
(OR)
b.(i) Translate the arithmetic expression a + (b + c) into
(1) Syntax tree
(2) Quadruples. (5)
(ii) State and explain the translation of expressions and the addressing array elements with
example. (8)
14.a. Discuss about the run time storage management of a code generator in detail. (13)
(OR)
b.(i) What are the issues in the design of code generator? Explain in detail. (7)
(ii) Write the short notes on optimal code generation for the expression. (6)
15.a. What are induction variable and how to find the induction variable in loops and optimize their
computation .Explain with example. (13)
(OR)
b. Explain the optimization of basic blocks? How does the Directed Acyclic Graph(DAG)
representation of a basic block facilitate code improving transformations within the
represented code? (13)
PART – C (1 X 15=15)
16.a..Discuss the address code and its implementation, with examples. (15)
(OR)
b. Explain in detail about the design of a predictive translator. (15)