You are on page 1of 4

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

RAMAPURAM
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
MODEL PRACTICAL EXAMINATION
ACADEMIC YEAR 2020-2021 (EVEN SEMESTER)
YEAR/SEM: III/VI

SUB. CODE/SUB. TITLE: 18CS304J/ COMPILER DESIGN

LIST OF QUESTIONS
1. Write a C Program to convert the following Regular Expression in to NFA: a/b
Reg No: 66, 91,116
2. Convert the following regular expression (RE) to deterministic finite automaton (DFA) using
c program : (a+b)*
Reg No: 67,92,117
3. Write a program to convert NFA to DFA . Consider the expression is : (a/b)*abb
Reg No: 68,93,118
4. Write a program to compute first an follow for the given grammar.
E -> E+T, E -> T, T -> T*F, T -> F, F -> (E) / id
Reg No: 69,94,119
5. write a C program to Compute of Follow and Trailing Sets for the following grammar:
E -> E+T, E -> T, T -> T*F, T -> F, F -> (E) / id
Reg No: 70,95,120
6. write a C program to Compute of Follow and Trailing Sets for the following grammar:
E ->TE’ , E’ -> +TE’/e , T -> FT’, T’ -> *FT’/e, F -> (E)/ id
Reg No: 71,96,121
7. Write a Program to compute Predictive Parsing for the given grammar. Give input string as
“ba”. S ->AaAb | BbBa, A -> Є, B->Є
Reg No: 72,97,122
8. Write a Program to compute Recursive Descent Parsing for the given grammar. Give input
string as “ba”.
S ->AaAb | BbBa, A -> Є, B->Є
Reg No: 73,98,123
9. Write a program to implement shift reduce parsing for the following grammar:
E -> E+E, E -> E/E, E -> E*E, E->a/b. Check whether the input string a+b is valid or not.
Reg No: 74,99,124
10. Write a program to implement shift reduce parsing for the following grammar:
E -> E+E, E -> E * E, E->i. Check whether the input string i+i*i is valid or not.
Reg No: 75,100,125
11. write a code for LR(0) Parser for Following Production:
E->E+T
                                    T->T*F/F
                                    F->(E)/char
Reg No: 76,101,126
12. Write a C program to construct DAG for the following expression:
((a*(b-c))+((b-c)*d))
Reg No: 77,102,127
13. Write a program to generate code generation from the following 3AC :
T1= a+b; T2=c+d; T3=T1+T2
Reg No: 78,103,128
14. Write a program to convert the following infix notation in to postfix :
a+b*c/(d-e^f)
Reg No: 79,104,129
15. Write a program to convert the following infix notation in to prefix :
a+b*c/(d-e^f).
Reg No: 80,105,130
16. Write a program to Compute LR(0) items for the string x*y+z.
Reg No: 81,106
17. Write a program to compute FOLLOW for the following grammar?
E ->TE’ , E’ -> +TE’/e , T -> FT’, T’ -> *FT’/e, F -> (E)/ id
Reg No: 82,107
18. Construct a recursive descent parser for the following grammar:
E ->TE’ , E’ -> +TE’/e , T -> FT’, T’ -> *FT’/e, F -> (E)/ id
Note: e represents null character
Reg No: 83,108
19. Write a c Program to construct LL(1) parsing for the given string : i*i+I
Reg No: 84,109
20. Write a program to construct recursive descent parser for the following grammar :
E ->E+T|T, T ->TF|F, F->F* |a|b
Reg No: 85,110
21. Write a program to construct Predictive Parser for 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.
Reg No: 86,111
22. Write a program to Construct A simple Code Generator for the following statement
x:= y + z.
Reg No: 87,112
23. Write a program to construct Shift reduce Parser for the following grammar:
S-> (L) |a, L-> L, S|S. Construct the behavior of the parser on the sentence(a, (a,a)) using
the grammar specified above.
Reg No: 88,113
24. Write a program to Construct A simple Code Generator for the following statement
x:= y – z, t=x.
Reg No: 89,114
25.Write a program to Implement Storage Allocation.
Reg No: 90,115

Marks Split-up:

Aim & Procedure 20 Marks


Programs 40 Marks
Output & Results 30 Marks
Viva 10 Marks
Total 100 Marks
EXAMINER-I EXAMINER-II

You might also like