Compare and contrast compilers and interpreters.
[3 marks]Explain in detail LEX Specification.
[4 marks]Explain Phases of Compilers with suitable example.
[7 marks]Describe language denoted by the following regular expression :
[3 marks]0 (0|1)*0 ii) ((ε|0)1*)*
[ marks]Draw transition diagram for following tokens.
[4 marks]Relop ii) Identifier iii) Unsigned number iv) Whitespace
[ marks]Write the two methods used in lexical analyzer for buffering the input. Which technique is used for speeding up the lexical analyzer?
[7 marks]Construct nondeterministic finite automata for following regular expression using Thomson‟s Construction. Show the sequence of moves made by each in Processing the input string ababbab. (a|b)*
[7 marks]Consider the grammar S->aSbS|bSaS|ε
[3 marks]Show that this grammar is ambiguous by constructing two different leftmost derivations for the sentence abab. ii) Construct the corresponding rightmost derivations for abab. iii) Construct the corresponding parse trees for abab.
[ marks]Define: Left Recursive Grammar. Check Following grammar is left recursive or not, if yes, Remove left recursive from it. S→aBDh B→Bb|c D→EF E→g| ε F→f| ε
[4 marks]Construct CLR Parsing table for the following grammar. S→CC1 C→cC|d
[7 marks]Explain following terms:
[3 marks]Ambiguous grammar ii) Left-Factoring grammar
[ marks]Write a difference(s) between CLR, SLR and LALR methods.
[4 marks]Construct the dag for following arithmetic expression: a+a+(a+a+a)
[3 marks]Discuss synthesized and inherited attributes using a suitable grammar.
[4 marks]For the input expression (4*7+1)*2, construct on annotated Parse tree according to the syntax directed definition of figure given below. Production Semantic Rules L->En Print(E.val) E->E1+T E.val:=E.val+T.val E->T E.val:=T.val T->T1 *F T.val:= T1.val * F.val T->(E) T.val:=E.val F->digit F.val:=digit.lexval T->F T.val:=F.val
[7 marks]Explain dynamic memory allocation strategy.
[3 marks]Explain performance for bottom up evaluation of an inherited attributes.
[4 marks]Explain various parameter passing methods.
[7 marks]Explain activation record. How is task divided between calling & called program for stack updating?
[3 marks]Explain any two code optimization methods with examples.
[4 marks]What is Intermediate form of the code? What are the advantages of it? What are generally used intermediate forms? Write three address code for following expression. (a+b)*(c+d)
[7 marks]How symbol table differs from other data structures?
[3 marks]Compare: Static v/s Dynamic Memory Allocation.
[4 marks]Explain various issues in design of code generator.
[7 marks]Explain operator precedence parsing method with example.
[7 marks]