Difference between compiler and interpreter. "Symbol table is necessary component of compiler". Justify this statement with examples.[6]
2.
What is activation record? Discuss the different activities performed by caller and callee during procedure call and return.[6]
S2
1.
List out the major tasks carried out in Lexical Analysis Phase. Convert the following NFA to DFA.
[6]
2.
Differentiate between recursive descent and non-recursive predictive parsing method. Find first and follow of all the non-terminals in the following grammar.
E→TA;A→+TA∣ε;T→FB;B→∗FB∣ε;F→(E)∣id
[6]
3.
Construct SLR parse table for the following grammar
S→E
E→E+T∣T
T→T∗F∣F
F→id
[6]
4.
Define Syntax directed definition. Construct annotated parse tree for the input expression (5*3+2)*5 according to the following syntax directed definition.
Differentiate between static and dynamic type checking. How can we carry out type checking for the following expression using syntax-directed definition?
S→id=E
S→ifEthenS1
S→whileEdoS1
S→S1;S2
[6]
S3
1.
Define three address codes. write three address codes for
S=dom=n+pwhilea<=b
[6]
2.
Define code optimization. Discuss about any three code optimization techniques with example.[6]
3.
Discuss about the different factors affecting target code generation.[6]