Spring 2023 - CS606 - 2
Spring 2023 - CS606 - 2
Total Marks: 20
Assignment No. 02
Due Date: July 14, 2023
Semester: Spring 2023
Please read the following instructions carefully before solving & submitting assignment:
Uploading Instructions:
o You are supposed to consult recommended book/s to clarify your concepts as handouts are not sufficient.
o The assignment file must be an MS Word file. Any other software/tool is not allowed.
o The required file format is .doc or .docx. Any other format like scan images, txt, pdf, png or jpeg etc. will
not be accepted.
o This assignment consists of one question only. So, attempt it and place your solution in a single MS Word
file along with your own Student Id at top.
o Submit the MS Word file at VULMS within the due date.
Note:
o No assignment will be accepted after the due date via email in any case (whether it is the case of load
shedding or internet malfunctioning etc.). Hence refrain from uploading assignment in the last hour of
deadline.
o It is recommended to upload solution file at least one day before its closing date.
o Do not put any query on MDB regarding this assignment, if you have any query then email at
[email protected]
Lectures Covered:
o This assignment covers Lectures # 19 to 30.
1
CS606 – Compiler Construction
Total Marks: 20
Assignment No. 02
Due Date: July 14, 2023
Semester: Spring 2023
o Question Marks: 20
Consider the following canonical collection of LR(1) items for a typical grammar;
2
CS606 – Compiler Construction
Total Marks: 20
Assignment No. 02
Due Date: July 14, 2023
Semester: Spring 2023
[A → B CD E, $]
[D → E, e]
[E → e, e]
}
goto(2, D) 4
goto(2, E) 5
goto(2, e) 6
{
[B → C DE, e]
goto(3, D) 8
[E → e, e]
}
goto(3, E) 5
goto(3, e) 6
{
goto(4, E) 9 [C → D E, e]
}
goto(4, e) 6
{
[A → B C DE, $]
goto(7, D) 10
[E → e, $]
}
goto(7, E) 5
goto(7, e) 6
{
goto(8, E) 11 [B → C D E, e]
}
goto(8, e) 6
{
goto(10, E) 12 [A → B C D E, $]
}
{
goto(10, e) 13 [E → e, $]
}
3
CS606 – Compiler Construction
Total Marks: 20
Assignment No. 02
Due Date: July 14, 2023
Semester: Spring 2023
Action Goto
State
e $ A B C D E
0 ? ? ? ? ? ? ?
1 ? ? ? ? ? ? ?
2 ? ? ? ? ? ? ?
3 ? ? ? ? ? ? ?
4 ? ? ? ? ? ? ?
5 ? ? ? ? ? ? ?
6 ? ? ? ? ? ? ?
7 ? ? ? ? ? ? ?
8 ? ? ? ? ? ? ?
9 ? ? ? ? ? ? ?
10 ? ? ? ? ? ? ?
11 ? ? ? ? ? ? ?
12 ? ? ? ? ? ? ?
13 ? ? ? ? ? ? ?
Good Luck