CAT-1_QB_191CSC603T_COMPILER_DESIGN
CAT-1_QB_191CSC603T_COMPILER_DESIGN
Bloom’s
Q.No Questions CO’s
Level
PART-B
Illustrate the various phases of compiler and trace it with the
1. CO1 K4
program segment (position: =initial rate*60)
2. Summarize the concept of token specification. CO1 K5
i) Outline how input buffering can be explained with an example.
3. CO1 K4
ii) Assess the process of token recognition.
Analyze the role of Lexical Analyzer in detail with necessary
4. CO1 K4
examples.
Summarize in detail about how the tokens are specified by the
5. CO1 K5
compiler with suitable example.
Construct the minimized DFA for the following expression.
6. CO1 K5
(a | b)* abb.
7. CO1 K4
8. CO1 K4
Bloom’s
Q.No Questions CO’s
Level
PART C
Create a Deterministic Finite Automata for the given regular
1. CO1 K6
expression. (0+1)* 01
Build an NFA from a regular expression using Thompson's
construction.
2. CO1 K6
i)(a/b)* abb (a/b)*.
ii)ab*/ab
UNIT II : SYNTAX ANALYSIS
Q.N Bloom’s
Questions CO’s
o Level
PART A
1. Define a context free grammar. CO2 K1
2. Write the basic issues in parsing. CO2 K1
3. Explain ambiguous grammar. CO2 K2
4. Write the algorithm for FIRST and FOLLOW. CO2 K1
Apply Elimination of left recursion from the following grammar. A-
5. CO2 K3
>Ac/Aad/bd
6. Show the parse tree for the given expression -(id + id ) CO2 K3
7. Draw syntax tree for the expression a=b*-c+b*-c. CO2 K1
Let Σ={ a, b}
Write down the language generated by the following
i) a/b
8. CO2 K1
ii) a*
iii) (a/b)*
iv) (a/b)(a/b)
9. What is meant by handle pruning? CO2 K1
Derive the string and construct a syntax tree for the input string
ceaedae using the grammar
10. S->SaA|A, CO2 K3
A->AbB|B,
B- >cSd|e
Compute FIRST for all the non-terminals for the following grammar.
11. S→ (L) | a CO2 K3
L→ L, S | S
12. Draw the transition diagram for identifier and keyword CO2 K1
Apply Elimination of left recursion for the following grammar
E-->E+T/T
13. CO2 K2
T-->T*F/F
F-->(E)/id
14. What do you mean by a syntax tree? CO2 K1
15. Write the rules to construct the SLR parsing table. CO2 K1
Q.N Bloom’s
Questions CO’s
o Level
PART B
Check whether the following grammar can be implemented using
predictive parser. Check whether the string “abfg” is accepted or not
using predictive parsing.
1. A→A CO2 K4
A→aB|Ad
B→bBC|f
C→g
Construct LR (0) parsing table for the grammar. Also assess whether
the input string “aabb” is accepted or not.
2. CO2 K5
S→AA
A→aA|b
Analyze and evaluate the leftmost derivation, rightmost derivation, and
derivation tree for the string "aaabbabbba" with respect to the given
grammar.
3. CO2 K4
S→aB | bA
A→aS| bAA|a
B→bS | aBB | b
Analyze and evaluate the predictive parsing table for the grammar:
S → (L) | a
4. CO2 K4
L → L, S | S
Then, determine if the string "(a, (a, (a, a)))" will be accepted.
Consider the following grammar
E→E+E
5. E→E*E CO2 K4
E→id
Perform shift reducing parser for the input string “id1+id2*id3”
Construct stack implementation of shift reduce parsing for the
grammar
E->E+S
6. CO2 K5
E->E*E
E->( E )
E->id and the input string id1+id2*id3
Construct LR(0) items for this following grammar and draw the
transition Representing transition among CLR items
7 S→CC CO2 K4
C→cC
C→d
Generate SLR Parsing table for the following grammar.
S->As|bAc|Bc|bBa
8 CO2 K4
A-> d
B->d
Q.N Bloom’s
Questions CO’s
o Level
PART- C
Create a Parsing table for the grammar and find states made by
predictive parser on input “id + id * id” and find FIRST and
FOLLOW.
1. E -> E + T | T CO2 K6
T -> T * F | F
F -> (E)
F-> id
Compose the analysis to determine if the following grammar is LL(1):
S → iEtS | iEtSeS | a
2. CO2 K6
E→b
Additionally, formulate the FIRST and FOLLOW procedures.