0% found this document useful (0 votes)
63 views4 pages

Spring 2023 - CS606 - 2

The document provides instructions for Assignment 02 in the course CS606 - Compiler Construction. It includes details about submitting the assignment, rules for marking, lectures covered, and the question. The question asks students to generate a CLR(1) parsing table based on the provided canonical collection of LR(1) items for a grammar. Students are to fill in the action and goto fields of the table.

Uploaded by

Gc Basic
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)
63 views4 pages

Spring 2023 - CS606 - 2

The document provides instructions for Assignment 02 in the course CS606 - Compiler Construction. It includes details about submitting the assignment, rules for marking, lectures covered, and the question. The question asks students to generate a CLR(1) parsing table based on the provided canonical collection of LR(1) items for a grammar. Students are to fill in the action and goto fields of the table.

Uploaded by

Gc Basic
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/ 4

CS606 – Compiler Construction

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.

Rules for Marking:


It should be cleared that your assignment will not get any credit if:
o The assignment is submitted after due date.
o The assignment is not submitted in .doc or .docx format.
o The submitted assignment does not open or file is corrupt.
o The assignment is fully or partially copied from other student or ditto copy from handouts or Internet;
strict disciplinary action will be taken in this case.
o The submitted file does not contain your own Student Id, or contain other than yours; Zero Marks will be
awarded, and no excuse will be accepted in any case.

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;

Goto State Closure


{
[S → A, $]
[A → B C D E, $]
[B → C D E, e]
0
[C → D E, e]
[D → E, e]
[E → e, e]
}
{
goto(0, A) 1 [S → A, $]
}
{
[A → BC D E, $]
[C → D E, e]
goto(0, B) 2
[D → E, e]
[E → e, e]
}
{
[B → CD E, e]
goto(0, C) 3 [D → E, e]
[E → e, e]
}
{
[C → DE, e]
goto(0, D) 4
[E → e, e]
}
{
goto(0, E) 5 [D → E, e]
}
{
goto(0, e) 6 [E → e, e]
}
goto(2, C) 7 {

2
CS606 – Compiler Construction
Total Marks: 20
Assignment No. 02
Due Date: July 14, 2023
Semester: Spring 2023

[A → B CD E, $]
[D → E, e]
[E → e, e]
}
goto(2, D) 4
goto(2, E) 5
goto(2, e) 6
{
[B → C DE, 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 DE, $]
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, $]
}

Table-1: Canonical Collection of LR(1) items

You are required to generate CLR(1) parsing table as shown below;

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 ? ? ? ? ? ? ?

Table-2: CLR(1) Parsing Table

Good Luck

You might also like