Professional Documents
Culture Documents
or
ld
www.alljntuworld.in
TU
UNIT I
Define Complier briefly?
Explain the cousins of compiler?
Define the two main parts of compilation? What they perform?
How many phases does analysis consists?
Define and explain the Loader?
Explain about preprocessor?
State the general phases of a compiler?
State the rules, and define regular expression?
Explain a lexeme and Define regular sets?
Explain the issues of lexical analyzer?
State some compiler construction tools?
Define the term Symbol table?
Define the term Interpreter?
JN
1
2
3
4
5
6
7
8
9
10
11
12
13
Questions
Blooms
Taxonomy
Level
Course
Outcome
Understand
Understand
Understand
Understand
Remember
Remember
Understand
Remember
Remember
Understand
Understand
Understand
Remember
1
1
1
1
3
1
3
2
2
2
3
1
1
www.alljntuworld.in
JNTU World
Questions
14
15
16
17
18
19
20
21
26
27
28
29
30
UNIT - II
Define the term handle used in operator precedence?
Define LR(0) items in bottom up parsing?
State the disadvantages of operator precedence parsing?
LR(k) parsing stands for what?
Why LR parsing is attractive one and explain?
Define goto function in LR parser with an example?
Why SLR and LALR are more economical to construct Cananonical
LR?
Explain about handle pruning?
Explain types of LR parsers?
List down the conflicts during shift-reduce parsing.
UNIT III
State the benefits of using machine-independent intermediate form?
List the three kinds of intermediate representation?
How can you generate three-address code?
Define syntax tree? Draw the syntax tree for the assignment
statement. a :=b * -c + b * -c.
Explain postfix notation?
Explain the usage of syntax directed definition?
Define abstract or syntax tree?
Show the DAG for a: =b *-c + b * -c?
TU
1
2
3
4
5
6
7
JN
8
9
10
1
2
3
4
5
6
7
8
Course
Outcome
1
1
1
1
2
1
3
1
Understand
Understand
Remember
Remember
3
3
2
Understand
Understand
Apply
Apply
Remember
4
1
1
4
1
Understand
Remember
Remember
Understand
Understand
Understand
Understand
or
23
24
25
22
Blooms
Taxonomy
Level
Understand
Understand
Understand
Understand
Remember
Understand
Understand
Remember
ld
S. No.
5
5
5
5
5
5
Understand
Understand
Remember
5
5
5
Remember
Understand
Understand
Apply
8
8
8
6
Remember
Apply
Understand
Apply
8
7
7
7
www.alljntuworld.in
JNTU World
Questions
9
10
11
12
TU
10
JN
11
12
13
14
15
16
17
18
19
20
1
2
3
Course
Outcome
8
9
8
8
Understand
Remember
Understand
Remember
Understand
Understand
Understand
Understand
8
8
8
9
9
7
9
9
Understand
Understand
Understand
Understand
Understand
Understand
Understand
Understand
Understand
10
10
10
10
10
10
10
10
12
Understand
12
Understand
Understand
Understand
Understand
Understand
Understand
Understand
Understand
Understand
Understand
11
11
11
12
12
12
11
10
11
11
or
1
2
3
4
5
6
7
8
9
13
14
15
16
17
18
19
20
Blooms
Taxonomy
Level
Apply
Understand
Understand
Understand
ld
S. No.
UNIT V
Remember
Understand
Apply
14
13
13
www.alljntuworld.in
JNTU World
S. No.
7
8
9
10
Course
Outcome
Understand
Understand
14
13
Apply
Understand
Understand
Understand
13
14
14
14
Blooms
Taxonomy
Level
Course
Outcome
Understand
Apply
Understand
Remember
1
3
Apply
Remember
Remember
Understand
Understand
Understand
Apply
1
1
1
1
3
4
13
ld
5
6
Blooms
Taxonomy
Level
Apply
or
Questions
S. No.
1
2
UNIT - I
Define compiler? State various phases of a compiler and explain
them in detail.
Explain the various phases of a compiler in detail. Also Write down
the output for the following expression after each phase a: =b*c-d.
Explain the cousins of a Compiler? Explain them in detail.
Describe how various phases could be combined as a pass in a
compiler? Also briefly explain Compiler construction tools.
For the following expression
Position:=initial+ rate*60
Write down the output after each phase
Explain the role Lexical Analyzer and issues of Lexical Analyzer.
Differentiate the pass and phase in compiler construction?
Explain single pass and multi pass compiler? with example?
Define bootstrapping concept in brief?
Explain the general format of a LEX program with example?
Construct the predictive parser the following grammar:
S->(L)|a
L->L,S|S.
Construct the behavior of the parser on the sentence (a, a) using the
grammar specified above
TU
3
4
Questions
JN
6
7
8
9
10
11
www.alljntuworld.in
JNTU World
13
Course
Outcome
4
Apply
Understand
Analysis
Apply
Understand
14
Blooms
Taxonomy
Level
Understand
ld
12
Questions
or
S. No.
TU
15
L
L
*R
id
L.
UNIT - II
Consider the grammar E E + E|E *E|(E)| id
Show the sequence of moves made by the shift-reduce parser on the
input id1+id2*id3 and determine whether the given string is
accepted
by the parser or not.
i) State shift-reduce parsing? Explain in detail the conflicts that may
occur during shift-reduce parsing.
ii)For the grammar given below, calculate the operator precedence
relation and the precedence functions
JN
L,R
www.alljntuworld.in
JNTU World
S
C
L
L
L,R
R
*R
id
L.
E+T
T
T*F
F
(E)
id
Prepare LR parsing table for the above grammar .Give the moves of
LR parser on id * id + id
ii) Briefly explain error recovery in LR parsing.
UNIT III
Explain with an example to generate the intermediate code for the
flow of control statements?
List the various ways of calling the procedures? Explain in detail?
Explain 3addresscodes and mention its types. How would you
implement the three address statements? Explain with suitable
examples?
Explain how declaration is done in a procedure using syntax
directed translation?
a) Write a note on the specification of a simple type checker.
b) Define a type expression? Explain the equivalence of type
expressions with an appropriate example.
Generate the three-address code for the following C program
fragment
while(a > b)
{
if (c < d)
x = y + z;
else
x = y - z;
}
Generate the code for the following C statements using its
equivalent
three address code.
a=b+1
x = y+3
y = a/b
a = b+c
TU
2
3
4
5
JN
cC|d
Apply
CC
Course
Outcome
ld
Blooms
Taxonomy
Level
Analysis
Apply
or
Questions
S. No.
Apply
Analysis
Apply
6
8
Apply
Analysis
Understand
Understand
www.alljntuworld.in
JNTU World
10
11
12
13
14
15
1
2
3
i.
ii.
iii.
4
5
6
7
8
TU
9
10
11
12
13
14
Understand
Apply
Apply
Understand
Apply
8
9
9
Understand
Understand
9
9
Understand
Understand
Understand
10
10
10
Understand
Understand
Understand
Understand
Apply
11
11
12
12
11
Understand
Understand
Understand
Apply
Understand
Understand
11
10
13
13
12
11
Understand
11
Apply
13
Understand
14
JN
15
Course
Outcome
ld
Blooms
Taxonomy
Level
Understand
or
Questions
S. No.
www.alljntuworld.in
JNTU World
S. No.
3
4
Blooms
Taxonomy
Level
Understand
Course
Outcome
Understand
14
Apply
13
13
ld
Questions
Questions
S. No.
2
3
Blooms
Taxonomy
Level
Course
Outcome
Apply
Remember
Remember
Apply
Apply
Apply
Apply
Remember
Apply
4
4
Apply
TU
i.
ii.
4
UNIT I
Consider the following fragment of C code:
float i, j;
i = i*70+j+2;
Write the output at all phases of the compiler for above C code.
Construct an NFA for regular expression R= (aa | b) * ab convert it
into an equivalent DFA.
Describe the languages denoted by the following regular
expressions.
(0+1)*0(0+1)(0+1)
0*10*10*10*
Explain with one example how LEX program perform lexical
analysis for the following PASCAL patterns Identifiers, Comments,
Numerical constants, Keywords, Arithmetic operators?
Check whether the following grammar is a LL(1)grammar
S iEtS|iEtSeS|a
E b
Also define the FIRST and Followers.
Consider the grammar below
E->E+E|E-E|E*E|E/E|a|b
Obtain left most and right most derivation for the string a+b*a+b.
Define ambiguous grammar? Test whether the following grammar is
ambiguous or not.
E->E+E|E-E|E*E|E/E|E|(E)|-E|id
State the limitations of recursive descent parser?
Convert the following grammar into LL(1)grammar,
S->ABC A->aA|C B->b C->c.
Write a recursive descent parser for the grammar.
bexpr->bexpr or bterm|bterm
bterm->bterm and bfactor|bfactor
bfactor->notebfactor|(bexpr)|true|false.
Where or, and , not,(,),true, false are terminals of the grammar.
or
JN
8
9
10
www.alljntuworld.in
JNTU World
Questions
S. No.
5
1
TU
JN
4
5
6
7
8
9
10
11
Apply
ld
3
4
Apply
Remember
Analysis
or
Course
Outcome
UNIT - II
Explain the common conflicts that can be encountered in a shiftreduce parser?
Explain briefly, precedence functions. Construct the precedence
graph using the following precedence tables.
+
*
)
Id
$
f
2
3
4
4
0
g
1
3
4
5
0
Blooms
Taxonomy
Level
5
5
Remember
Understand
Understand
Apply
Apply
Remember
Remember
Remember
Apply
8
9
9
Understand
Remember
Apply
www.alljntuworld.in
JNTU World
Questions
S. No.
14
15
i)
ii)
1
2
Understand
Understand
Understand
Apply
10
Apply
Understand
11
12
Apply
11
Apply
12
Apply
10
TU
Understand
ld
13
allocation?
Explain the use of Symbol table in compilation process? List out
various attributes stored in the symbol table?
List the advantages and disadvantages of Static storage allocation
strategies?
Explain the data structure used for implementing Symbol Table?
Explain the following:
Static and Dynamic Checking of types
Over loading of Operators & Functions
UNIT IV
Course
Outcome
or
12
Blooms
Taxonomy
Level
JN
www.alljntuworld.in
JNTU World
Questions
S. No.
9
10
1
2
3
4
10
Understand
10
Understand
11
Apply
Apply
13
13
Apply
14
Understand
Apply
13
14
JN
TU
Understand
11
ld
Course
Outcome
or
Blooms
Taxonomy
Level
Apply