10 M FLCD QuestionBank - Updated-1
10 M FLCD QuestionBank - Updated-1
ENGINEERING
(AUTONOMOUS)
Karakambadi Road, TIRUPATI – 517507
Unit – 1
1 Explain the phases of compiler with a neat diagram and example
Construct the NFA for the following regular expressions
2 i) L= (a+b)*(aa+bb) (a+b)* ii)L=ab+(aa+bb) (a+b)*b
Convert the following NFA to DFA
Unit – 2
Construct SLR Parsing table for the grammar:
E-> E+T/T, T->T*F/F, F->(E)/a
1 Show the moves of the parser for parsing the string a * a + a.
Construct CLR and LALR parsing table for the following grammar:
S→ AA
4 A→ aA/b
Unit – 3
Discuss the following in detail about the Syntax Directed Definitions with
example
1 i. Inherited Atrributes
ii. Synthesized attributes.
2 Explain about L attributed definition?
3 Construct syntax tree and postfix notation for the following expression (a+(b*c)^d-e/(f+g)
4 Write the quadruple, triple, indirect triple for the statement a := b* − c + b* − c.
5 Write the intermediate code for the expression a + a * ( b + c ) * d.
Write the short note on:
6 a. Abstract syntax tree b. Polish notation c. Three address code d. Backpatching e. DAG
What is a three address code? Mention its types. How would you implement the three address
7 statements? Explain with examples.
Convert the following expression into syntax tree and three address
8 code: h=(b*-(a+b)/d)-c+6.
9 Explain the role of intermediate code generator in compilation process.
Consider following expression grammar:
S -> E
E -> E + E/E * E/(E)/I
I -> Idigit/digit
10 Digit -> 0=1=2=::::=9
Write semantic rules to evaluate expression on decimal numbers that it
derives.
Use `val' attribute for storing the values & constant parse tree for
2*(21+1)+10.
Find S.val.
Unit – 4
1 What is Type Conversion? what are the two types of type conversion? Explain
2 What is activation record? Write the various fields of Activation Record.
3 Discuss in detail about the run time storage arrangement
4 Write the definition of symbol table and procedure to store the names in symbol table.
5 Explain in brief about equivalence of type expressions with examples
6 What is type checker? Explain the specification of a simple type checker
7 What are the data structures used in symbol table? Explain.
8 Explain the Storage Organization with simple examples
9 Explain Storage allocation strategies with suitable examples?
10 Explain about Dynamic Storage allocation Techniques?
Unit – 5
1 Explain code optimization techniques on Basic Blocks with simple examples?
Consider the following program code:
Prod=0;
i=1;
Do
2 {
Prod=prod+ a[i]*b[i];
i=i+1;
}while (i<=10);
a. Partition in into blocks b. Construct the flow graph
3 Explain the peephole optimization Technique?
4 What are basic blocks? Write the algorithm for partitioning into Blocks