0% found this document useful (0 votes)
75 views28 pages

2025-2026 Assignment I - Compiler Design

Uploaded by

arunthathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views28 pages

2025-2026 Assignment I - Compiler Design

Uploaded by

arunthathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

1

RAMCO INSTITUTE OF TECHNOLOGY


Department of Computer Science and Engineering

Academic Year: 2025-2026 (Odd Semester)

ASSIGNMENT SHEET

Degree, Semester& Branch: V Semester B.E. CSE-B


Course Code & Title: CS3501 Compiler Design
Name of the Faculty member: Mrs.M.Arunthathi AP/CSE
Assignment No.: 1 Date: 15.08.2025
Submission Date:
Questions Set

Set 1:

a. Convert the Regular Expression (a|b)* a into DFA.( May-June 2016) [CO1,L3]
b. Check whether the following grammar can be implemented using predictive
parser. Check whether the string “(a,a)” is accepted or not using predictive
parsing.
S (L)|a
LL,S|S [CO2,L3]

Set 2:

a. Consider the set of strings on {0,1} in which, every substring of 3 symbols has at
most two zeros. For example, 001110 and 011001 are in the language, but 100010 is
not. All strings of length less than 3 are also in the language. A partially completed
DFA that accepts this language is shown below. GATE 2012, SET 1[CO1, L3]

Complete the DFA and reduce the number of states so that the meaning does not change.

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


2

a. Consider the following context-free grammar where the start symbol is S and the set of
terminals is {a,b,c,d}.
SAaAb|BbBa
AcS|Epsilon
BdS|Epsilon
Construct LL(1) Parsing Table (GATE 2024 SET 2) [CO2, L3][CO2, L3]

Set 3:

a. Convert the following NFA to DFA

[CO1, L3]

b. Consider the grammar S → ABD, A → a | Db | ε, B → gD |dA | ε , D → e | f


i) Construct FIRST and FOLLOW for each nonterminal of the
above grammar.
ii) Construct the predictive parsing table for the grammar.
iii) Show the parsing action on a valid string and on an invalid string
iv) Check whether the grammar is LL (1). Give justification
[CO2, L3]
Set 4:

a. Construct NFA for the regular expression 10+(0+11)0*1 and convert it into DFA.
Further, formulate a minimized DFA it.
[CO1, L3]

b. Construct parsing table for the following grammar and find moves made by
predictive parser on input id+id*id. Compute and find FIRST and FOLLOW.
(Nov/Dec 2016)
E→E+T
E→ T
T→T*F

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


3

T→F
F→(E)/id
[CO2,L3]

a. Find the equivalent regular expression for the language L={ w |w ∈ {0,1} and w is
Set 5:

the set of all strings containing at least two 0’s.}. Construct a minimized DFA for this
Regular expression.
[CO1, L3]
b. Check whether the following grammar can be implemented using predictive
parser.Check whether the string “abfg” is accepted or not using predictive parsing.
(April/May 2022)
SA
AaB|Ad
B bBC|f
Cg
[CO2,L3]
Set 6:
a. Consider the Deterministic Finite-state Automaton (DFA) A shown below. The DFA
runs on the alphabet {0, 1}, and has the set of states {s, p, q, r}, with s being the start
state and p being the only final state. [GATE CSE 2023]

Minimize the DFA A given above.


[CO1, L3]

b. Construct the 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. And show whether the following string will be accepted or not. (a,(a,(a,a))).
[CO2,L3]
Set 7:

a. Convert the Regular Expression abb|(a|b)* to DFA and minimize it. (April May
2017)
[CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


4

b. Construct the Predictive parser for the given grammar. [GATE CS 2003][CO2,L3]
S iEtS | iEtSeS | a
Eb
Set 8:

a. A cybersecurity analyst is designing a pattern matching system and needs to convert the
regular expression (01∣10)+ into an NFA. Create an NFA that accepts all strings that
match this regular expression, where the strings must contain at least one occurrence of
either "01" or "10". Show all states and transitions in your NFA diagram.
[CO1, L3]
b. Consider the following grammar,
S→uBDz
B→Bv|w
D→EF
E→y|€
F→x|€
1. Find First and Follow sets for above grammar.
2. Construct LL (1) parsing table.
[CO2,L3]
Set 9:

a. Construct the minimized DFA for the Regular Expression (0+1)*(0+1) 01


[CO1, L3]

b. Find FIRST, and FOLLOW sets for this grammar; then construct the LL(1) parsing
table.
0. S′ → S $
1. S → ε
2. S → XS
3. B → \ begin {WORD}
4. E → \ end {WORD}
5. X → BSE
6. X → {S}
7. X → WORD
8. X → begin
9. X → end
10. X → \ WORD
Parse the input “{\begin{WORD}\end{WORD}} $” using LL (1) Parse table.
[CO2,L3]
Set 10:

a. Construct a NFA for the regular expression (ba*a+ ab*b)* (ab* + ba*) and convert it
into DFA.
[CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


5

b. Check whether the following grammar is a LL(1)grammar/Explain LL(1) grammar


for the sentence.

SiEtS|iEtSeS|a
E b
Also define the FIRST and FOLLOW procedures.
[CO2,L3]
Set 11:

a. A DFA is given below. Find the minimal DFA for the given DFA.

[GATE | GATE CS 2011 | Question 45] [CO1, L3]


b. Construct the LL(1) parsing table for the grammar [CO2,L3]
S→Aa|bAc|Bc|bBa
A→d
B→d
Set 12

a. Find a regular expression that represents the set of all binary numbers that are
divisible by three. Assume that the string ϵ is divisible by three. Construct a
NFA for the same. Also, construct an equivalent minimized DFA for the NFA.
[GATE CSE 2021 SET 2[ [CO1, L3]

b. Construct the Predictive parser for the given grammar. [CO2,L3]


S  iEtS | iEtSeS | a
E b

Set 13:

a. Find the equivalent regular expression for the language L={ w |w ∈ {0,1} and
w is the set of all strings containing at least two 0’s.}. Construct a minimized
DFA for this Regular expression.
[CO1, L3]
b. Show that the following grammar
SAa|bAc|dc|bda
Aa
is LALR but not SLR(1)
[CO2,L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


6

Set 14

a. Let L= {w ∈ (0 + 1)*|w has even number of 1s}. Construct a minimized DFA for L.
[CO1, L3]

b. Give the algorithm for construction of LALR parsing table for the given grammar.
Using the algorithm for construction of LALR parsing table, construct the LALR
parsing table for the following grammar.
S’S
SaAd|bBd|aBe|bAc
Ac
Bc
[CO2,L3]

Set 15

a. Using the following lexical rules, specify the regular expressions for each:
(i) A floating-point number (e.g., 3.14, .25, 0.001)
(ii) A single-line comment that starts with // and continues to the end of a line
[CO1, L3]
b. Draw LR(1) states for the following grammar without left factoring and construct the
LR(1) parse table. Clearly indicate any conflicts. [CO2, L3]
1. S → G $
2. G → P
3. G → PG
4. P → id : R
5. R → id
6. R → id R
Set 16:

a. Write regular Expression for the set of strings that ends with 00 over the input alphabets
Σ={0,1}. Convert the obtained the regular expression to DFA.
[CO1, L3]

b. Write down the algorithm to eliminate left recursion and left factoring and apply both to
the following grammar and construct the predictive parsing table. [CO2,L3]
E→E+T|E-T|T,
T→a|b|(E)

Set 17:

a. Give DFAs accepting the languages over the alphabet {0,1} containing the set of all
strings such that the number of 1’s is even and the number of 0’s is a multiple of 3.
[CO1, L3]
b. Construct a LL(1) parsing table for the following grammar.
E --> TE'
E' --> +TE' | ε

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


7

T --> FT'
T' --> *FT' | ε
F --> id | (E)
[CO2,L3]
Set 18:
a. Construct RE for the language over the set z={a,b} in which total number of a’s are
divisible by 3 and convert the same to DFA.
[CO1, L3]
b. Design a LALR Parser for the following grammar and parse the input id=id.
SL=R|R
L *R|id
R L
[CO2,L3]
Set 19:
a. Convert the following ε-NFA to NFA and then convert the resultant NFA to DFA

[CO1, L3]
b. Consider the following grammar
SL=R
SR
L*R
Lid
RL
Discuss the LALR Parsing method for this grammar. List out canonical collections and
also construct a parsing table.
[CO2,L3]
Set 20:
a.Write regular Expression for the set of strings that ends with 01 over the input alphabets
Σ={0,1}. Convert the obtained the regular expression to DFA
[CO1, L3]

b. Consider CFG depicted below where “begin”, “end”, ”x” are all terminal symbol for the
grammar and stat is considered as the starting symbol for this grammar. Productions are
numbered in parenthesis and you can abbreviate “begin” to “b” and end to “e” respectively.
StatBlock

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


8

Blockbegin Block end


BlockBody
Bodyx
i) Compute the set of LR(1) items for this grammar and draw the corresponding DFA.
Do not forget to augment the grammar with the initial production SStat as the
production(0).
ii) Construct the corresponding LR parsing Table.
[CO2, L3]
Set 21:

a. Convert it into DFA

[CO1, L3]

b. Construct CLR parsing table from


S AA
AAa|b
[CO2,L3]
Set 22:
a. Convert the regular expression (0+1)*(00+11) to Deterministic Finite Automaton.
[CO1, L3]
b. Generate LALR parsing table for the following grammar. [CO2,L3]
S→Aa|bAc|Bc|bBa
A→d
B→d and parse the sentence “bdc” and “dd”.

Set 23:
a. Convert the given NFA to DFA

0 1

p {p.q} {p}

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


9

q {r,s} {t}

r {p,r} {t}

*s φ Φ

*t Φ φ

[CO1, L3]
b. Consider the following grammar
S AS|b
A SA|a
Construct the SLR Table for the grammar. Show the actions of the parser for the input
string “abab”.
[CO2,L3]
Set 24:

a. Convert the following regular expression to DFA [CO1, L3]

(01+1)*
Minimize the obtained DFA if possible.
b. Generate SLR parsing table for the following grammar [CO2, L3]
SAa|bAc|Bc|bBa
Ad
Bd
and parse the sentence ‘bdc’ and ‘dd’
[CO2,L3]
Set 25:
a. Construct a Deterministic Finite Automaton from the regular expression (x+y)x(x+y)* over
input alphabets Σ={x,y} [CO1, L3]
b. Consider the following grammar
S TL
Tint|float
L L,id|id
Parse the input string ‘int id,id’ using Shift Reduce Parser.
[GATE CS 2019][CO2,L3]
Set 26:
a. Minimize the following DFA [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


10

b. Compute closure(I) and goto(I) for the following grammar


SAS|b
ASA|a
[CO2,L3]
Set 27:
a. Minimize the following Deterministic Finite Automaton [CO1, L3]

b. Construct SLR parsing Table for the following grammar:


G: E→E+T| TT→T*F| FF→(E) | id.
[CO2, L3]
Set 28:
a. Given Transition Table construct the minimized DFA [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


11

0 1

2 3
1

2 4 5

3 6 7

4 4 5

5 6 7

*6 4 5

7 6 7

b. Consider the following grammar G: [CO2,L3]


S’S
SCC
CcC|d
Construct the LALR parsing table for the grammar G. Show the moves of the parser on
string ccd.
Set 29:
a. Write the regular expression to represent set of all strings that are multiples of 4 when
represented in binary. Convert the same to DFA. [CO1, L3]
b. Prove that the following grammar is LALR(1) and not SLR(1)
S → Aa | bAc | dc | bda
A→d GATE 2025 Set 2 [CO2,L3]
Set 30:
a. Convert the following € NFA to a DFA [CO1, L3]

δ € a b c

→p ɸ {p} {q} {r}

q {p} {q} {r} ɸ

*r {q} {r} ɸ {p}

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


12

b. Build the LR(0) DFA for this grammar: [CO2,L3]


0. S → E $
1. E → id
2. E → id (E)
3. E → E + id
a. Is this an LR(0) grammar? Give evidence.
b. Is this an SLR grammar? Give evidence.
c. Is this an LR(1) grammar? Give evidence.
Set 31:
a. Convert the regular expression “a(a+b)* ab” to DFA. [CO1, L3]

b. Show that this grammar is LALR(1) but not SLR: [CO2,L3]


0. S → X $
1. X → Ma
2. X → bMc
3. X → dc
4. X → bda
5. M → d
Set 32:
a. Minimize the given DFA [CO1, L3]

b. In the following grammar for certain statements, e and s are terminals standing for
conditional expressions and “other statements,” respectively.
stmt →if e then stmt
| if e then stmt else stmt
| while e do stmt
| begin list end
|s

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


13

list →list; stmt


| stmt
a) Build an LR parsing table for this grammar, resolving conflicts in the usual way for
the dangling-else problem.
b) Show the behavior of your parser on the following inputs:
i) if e then s; if e then s end
ii) |bwhile e do begin s; if e then s; end
[CO2,L3]
Set 33:
a. Construct NFA for the regular expression (a+b) * abb and convert it into DFA.
[CO1, L3]
b. Consider the following CFG grammar, [CO2,L3]
S→aABe
A→Abc|b
B→d
Where a,b,c,d are terminals,”S”(start symbol),A and B are non-terminals. Find the LALR
sets of Items.

Set 34:
a. Convert the regular expression. (a|b) * into minimized DFA [CO1, L3]
b. Consider the following grammar:
SS
SSS|a|ε
i) Construct the collection of sets of LR(0) items for this grammar and draw its goto
graph .
ii) Indicate the shift reduce and reduce and reduce- reduce conflict (if any) in the
various state of LR(0) parser.
[CO2,L3]

Set 35:
a. Convert the regular expression ((a|c)*)ac(ba)* into minimized DFA [CO1, L3]
b. Construct stack implementation of shift reduce parsing for the grammar. [CO2, L3]
E →E +E
E →E *E
E → (E)
E →id and the input string id1+id2*id3

Set 36:
a. Minimize the following DFA [CO1, L3]

Current Input Symbol


State
a b

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


14

q0 q5 q1
q1 q2 q6
*q2 q2 q0
q4 q5 q7
q5 q6 q2
q6 q6 q2
q7 q4 q6
q3 q2 q6

b. Construct predictive parser for the following grammar


S a|↑| (T)
TT,S|S
Show the behavior of the parser in the sentence
i) (a,(a,a))
ii) (((a,a), ↑,(a),a)
iii) (a,a)
[CO2,L3]
Set 37:
a. Construct a minimum state automaton equivalent to the finite automaton [CO1, L3]

b. Convert the following pascal like grammar where terminals are in boldface:

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


15

i) Eliminate left recursion


ii) Determine FIRST and FOLLOW set.
iii) Construct the predictive parsing table
iv) Show the moves of the parser on
a. var id,id:id
b. var id,id
[CO2,L3]
Set 38:
a. Convert the following NFA with epsilon to equivalent DFA [CO1, L3]

b. Consider the grammar


textp atom|list
atom number|identifier
list(textp-seg)
textp-segtextp,textp-seg|textp
i) Left factor this grammar.
ii) Construct FIRST and FOLLOW set for the non-terminals
iii) Show that resulting grammar is LL(1)
iv) Construct LL(1) parsing table for the resulting grammar.
[CO2,L3]
Set 39:
a. Write regular Expression for binary strings having second symbol from right as 1.
Construct DFA for the same. [CO1, L3]
b. Construct LR(0) parsing table for the given grammar.

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


16

EE*B
EE+B
EB
B0
B1 [CO2, L3]
Set 40:
a. Convert the NFA with ε into its equivalent DFA. [CO1, L3]

b. Consider the grammar given below:

S → Aa

A → BD

B→b|ε

D→d|ε
Let a, b, d, and $ be indexed as follows:

a b d $
3 2 1 0

Compute the FOLLOW set of the non-terminal B and write the index values for the
symbols in the FOLLOW set in the descending order. (For example, if the FOLLOW set
is {a, b, d, $}, then the answer should be 3210)
[GATE CS 2019] [CO2, L3]
Set 41:
a. Formulate the regular expression to represent the set of all strings that begin with
01 and ends with 11. Convert this regular expression to DFA. [CO1, L3]
b. Find LALR for the given grammar and parse the sentence (a+b)*c.

E→E+T|T, T→T*F|F, F→( E)|id

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


17

[CO2,L3]

Set 42:

a. Convert the following NFA to its equivalent DFA [CO1, L3]

b. Consider the following CFG grammar over the non-terminals{X,Y,Z} and terminals
{a,c,d} with the productions below and start symbol Z. [CO2, L3]
X→a
X→Y
Z→d
Z→XYZ
Y→c
Y→ε
i. Compute the FIRST and FOLLOW sets of every non-terminal and the set of non
terminals that are nullable.
ii. Construct the predictive parsing table.
Set 43:

a. Give DFAs accepting the languages over the alphabet {0,1} containing the set
of all strings such that every 1 is followed immediately by 00. [CO1, L3]
b. Consider the following grammar

1. S→ A #
2. A→ a A b | c
Find LR(0) parsing table and parse the sentence a a c b b #
[CO2,L3]
Set 44:

a. Construct DFA for the regular Expression (a|b)*abb and try to minimize the obtained
DFA. [CO1, L3]
b. Explain ambiguous grammar G: E → E + E | E * E | (E) | - E | id for the sentence
id+id*id.
[CO2,L3]
Set 45:

a. Convert the regular expression (b|a)*abb(b|a)* into minimized DFA. [CO1, L3]
b. Consider the following context-free grammar where the set of terminals is {a,b.c.d.f}.
S daT|Rf
TaS|baT|epsilon

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


18

RcaTR|epsilon
Construct LL(1) parse table.

[CO2, L3]
Set 46:

a. Given the following line of code in Python:


total_sum = 25 + value, identify and specify all the tokens present in the line.
Also, draw transition for recognizing identifiers in python. [CO1, L3]

b. Construct a non-recursive predictive parsing table for the following grammar.


E’E or E| E and E| not E|(E) |0|1 [CO2,L3]
Set 47:

a. Construct a minimum state automaton equivalent to the finite automaton [CO1, L3]
(Hint: State 1 is the Initial state)

b. Generate LALR parsing table for the following grammar. [CO2,L3]


S→Aa|bAc|Bc|bBa
A→d
B→d and parse the sentence “bdc” and “dd”.
Set 48:

a. Find the minimum state DFA for the given DFA [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


19

b. Show that the grammar is [CO2,L3]


S→Aa|bAc|Bc|bBa
A→d
B→d
is LR(1) but not LALR(1)
Set 49:

a. Write regular Expression for the set of strings that contains the substring ‘101’ over the
input alphabets Σ={0,1}. Convert the obtained the regular expression to DFA [CO1, L3]
b. A grammar symbol X (terminal or nonterminal) is useless if there is no derivation of the
form S wXy wxy That is, X can never appear in the derivation of any sentence. Elaborate
on the algorithm that is used to eliminate from a grammar all productions containing
useless symbols. Apply your algorithm to the grammar:
S →0|A
A → AB
B→1
[CO2,L3]

Set 50:

a. Find the minimum state DFA for the given DFA [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


20

b. Consider the following CFG grammar, [CO2,L3]


S→aABe
A→Abc|b
B→d
Where a,b,c,d are terminals,”S”(start symbol),A and B are non-terminals.
a)Parse the sentence “abbcde” using right-most derivations.
b)Parse the sentence “abbcde” using left-most derivations.
c)Draw the parse tree.
d) Find the SLR sets of items
Set 51:

a. M= ({p,q,r,s},{0,1}, δ,p,{q,s}) Where δ defined in the following table. [CO1, L3]

Convert the above NFA to DFA.


b. Show that the following grammar: is SLR(1) but not LL(1). [CO2,L3]
S→SA|A
A→a

Set 52:

a. Construct a minimum state automaton equivalent to the finite automaton [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


21

b. Check whether the following grammar is LR(0). [CO2,L3]


0. S →E #
1. E→ E - T | T
2. T→ F ^ T | F
3. F→ ( E ) | Id
Set 53:

a. Formulate regular expression to represent the set of all strings which when interpreted
as a binary integer is a multiple of 3. Convert the same to DFA. [CO1, L3]
b. Building the LR Parse Table for LR(0) [CO2,L3]
(0) S’ →E $
(1) E →E || B
(2) E →B
(3) B →t
(4) B →f
Set 54:

a. Construct a minimum state automaton equivalent to the finite automaton [CO1, L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


22

b. Generate top down paring table for the following grammar and parse the input string w =
cad [CO2,L3]
S → cAd A → ab | a

Set 55:

a. Construct Finite Automata equivalent to the regular expression (ab+a)* [CO1, L3]
b. Check whether the given grammar is suitable for predictive parsing. [CO2,L3]
A → AA | (A) | ε
Justify your answer
in detail.
Set 56:

a. Consider the DFA given by the transition table

δ 0 1
->q1 q2 q6
q2 q1 q3
*q3 q2 q4
q4 q4 q2
q5 q4 q5
*q6 q5 q4

Draw the table of distinguishability for this automaton. Construct the minimum state
equivalent DFA [CO1, L3]

b. Construct the LR(0) states for this grammar, and then determine whether it is an SLR
grammar. [CO2,L3]
0. S → B $
1. B → id P
2. B → id *(E )
4. P → (E)
5. E → B
6. E → B, E
Set 57:

a. Write regular expression for the language which is accepted by the following NFA and
convert it into DFA.

[CO1, L3]
b. Consider the following grammar G: [CO2,L3]

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


23

SXaY|Y
XbY|c
YX
i) Discuss the various steps involved in the construction of SLR parsing.
ii) Show the canonical collections of LR(0) items.
iii) Construct the SLR parsing table.
iv) Show the actions of the parser on the input string cac$.
Set 58:

a. Construct a minimized DFA from the regular expression 0*(01)(0/111)* [CO1, L3]
b. Construct the LALR parsing table for the following grammar. [CO2,L3]
S (L)|a
LL,S|S
Set 59:

a.Write regular Expression for the set of strings that starts with 00 over the input alphabets
Σ={0,1}. Convert the obtained the regular expression to DFA [CO1, L3]
b. Construct LALR parsing table for the following grammar. [CO2,L3]

SAA

AaA|b

Set 60:

a. Convert the given NFA to DFA [CO1, L3]

b. Construct SLR parsing table for the following grammar. [CO2,L3]

SAA
AaA|b
Set 61:

a. Construct a minimized DFA from the regular expression (b/a)*baa [CO1, L3]
b. Design an SLR parser for the following grammar and parse the input id=id

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


24

S→L=R|R [CO2,L3]
L→*R|id
R→L
Set 62:

a. Convert the regular expression 1*0 (0+1)* to DFA where the input alphabets Σ={0,1}.
[CO1, L3]
b. Find SLR for the given grammar and parse the sentence (a+b)*c [CO2,L3]
E→E+E|E*E|(E)|id
Set 63:

a. Find a minimum State Deterministic Finite Automata recognizing the language


corresponding to the regular expression (0*10 + 1 * 0) (01 )*.
[CO1, L3]
b. Consider the grammar [CO2,L3]
E-> E + T | T
T-> TF|F
F-> F*|a|b
Construct the SLR parsing table for the above grammar. (NOV/DEC 2016 & 2021)
Set 64

b. Consider the five state DFA M accepting the Language L(M) ⸦(0+1) * shown below.
For any String wε(0+1)*, let n 0(w) be number of 0’s in w and n 1(w) be the number of
1’s in w.

Which of the following statements is/are FALSE?

States 2 and 4 are distinguishable in 𝑀


States 3 and 4 are distinguishable in 𝑀
A.

States 2 and 5 are distinguishable in 𝑀


B.

Any string 𝑤 with 𝑛0(𝑤)=𝑛1(𝑤) is in 𝐿(𝑀)


C.
D.

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


25

(Hint: Give your opinion about each option given in the question)

(GATE 2024 SET 1, Q.No 40) [CO1, L3]

c. Consider the following context-free grammar where the start symbol is S and the set of
terminals is {a,b,c,d}.
SAaAb|BbBa
AcS|Epsilon
BdS|Epsilon
Construct LL(1) Parsing Table (GATE 2024 SET 2) [CO2, L3]

CO1: The students will be able to elucidate different phases of a compiler and design a lexical
analyzer for a sample language, implement a scanner using LEX.
CO2: The students will be able to apply different parsing algorithms to develop the parsers for a
given grammar and implement parser using YACC.
L1: Remember; L2: Understand; L3: Apply

Signature of the Faculty member HOD

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


26

RAMCO INSTITUTE OF TECHNOLOGY, RAJAPALAYAM


Department of Computer Science and Engineering
Academic Year: 2025-2026 (Odd Semester)
III CSE B Section
Assignment I Allotment of Questions
Course Code & Title: CS3501 Compiler Design

Register
Sl.No Number Name Sl.No
Number
1 953623104001 ABISRI M 1
2 953623104005 AMRUTHA V 2
3 953623104007 ANISH KUMAR R 3
4 953623104011 ARJUN S 4
5 953623104012 ARUNADEVI M 5
6 953623104013 ASMA M 6
7 953623104016 ATHISH M 7
8 953623104020 CHRISWIN PRAYSON J 8
9 953623104022 DEEPAK LINGARAJ M 9
10 953623104023 DEEPALAKSHMI M 10
11 953623104025 DHIVYA DHARSHINI A 11
12 953623104026 DHURKA DEVI S 12
13 953623104027 DILIBAN S M 13
14 953623104030 DIVYADHARSINI A 14
15 953623104031 DURGADEVI M 15
16 953623104035 HARISH N 16
17 953623104036 HARISHKUMAR I 17
18 953623104038 HEMAMALINI R 18
19 953623104040 JANARAMJI R 19
20 953623104042 JECI CARMEL A 20
21 953623104043 JEYASEELAN S 21
22 953623104044 J K KAVIYALAKSHMI 22
23 953623104045 JUMANA JASEELA J 23
24 953623104047 KARTHIKA A 24
25 953623104048 KARUPPASAMY A 25
26 953623104051 K S KAMALASRI 26
27 953623104052 LAKSHITHA S 27
28 953623104053 LALITH KRISHNA V M 28
29 953623104055 LOKESH KUMARAN M 29
30 953623104058 MOHAMED AMMA GULSHAN M 30
31 953623104060 M PRANAV 31

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


27

Register
Sl.No Number Name Sl.No
Number
32 953623104061 MUNEESWARAN M 32
33 953623104063 MUTHUMARI M 33
34 953623104065 MUVIYA M 34
35 953623104067 NAMEETHA K 35
36 953623104071 NITHYA SRI S 36
37 953623104073 PADMADHARSHINI B 37
38 953623104076 PASAM RAJAVARDHAN 38
39 953623104077 PAVITHRA M 39
40 953623104078 PRAVEEN KUMAR R 40
41 953623104079 PRINCE S 41
42 953623104080 PRIYADHRSHINI K 42
43 953623104083 RAJESWARI C 43
44 953623104084 RAMAKRISHNAN A 44
45 953623104086 RAM KUMAR S 45
46 953623104090 SAKTHI SUNDARI G 46
47 953623104091 SANDHIB K 47
48 953623104092 SANJAY P 48
49 953623104096 SATHYAPRIYA K 49
50 953623104098 SELVAMANI M 50
51 953623104099 SENTHATTI KALAI PANDIYAN P 51
52 953623104102 SHENBAGAPRIYA A 52
53 953623104103 SHRIJA A 53
54 953623104104 SINDHE MOHITH SIVA SAI 54
55 953623104105 SIVA K 55
56 953623104107 SIVAPRIYA A 56
57 953623104109 SONA S 57
58 953623104115 SRI PON MATHU SWASTHIK P 58
59 953623104116 SRI PRISHIGAA R 59
60 953623104122 UDHAYASANKARI R 60
61 953623104123 VASHINI J 61
62 953623104125 VIGNESH A P 62
63 953623104126 VIGNESHA S 63

Faculty Member HOD

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016


28

Form No. AC 09b Rev.No. 00 Effective Date: 18.01.2016

You might also like