CS606 Assignment 2 Solution Spring 2024
CS606 Assignment 2 Solution Spring 2024
Questions:
Consider the following state "I0" of LR(1) items for a hypothetical grammar;
I0 = {
[S' → .S, #],
[S → .A B C D E, #],
[A → .B C D E, a/b],
[B → .C D E, a/b],
[C → .D E, a/b],
[D → .E, a/b],
[E → .a, a/b],
[E → .b, a/b]
}
Goto (I0, A) = {
2 [S → A. B C D E, #]
3 [A → B. C D E, a/b]
4 [B → C. D E, a/b]
5 [C → D. E, a/b]
6 [D → E., a/b]
7 [E → a., a/b]
}
Goto (I0, B) = {
8 [A → B. C D E, a/b]
9 [B → C. D E, a/b]
10 [C → D. E, a/b]
11 [D → E., a/b]
12 [E → a., a/b]
}
Goto (I0, C) = {
13 [B → C. D E, a/b]
14 [C → D. E, a/b]
Goto (I0, D) = {
17 [C → D. E, a/b]
18 [D → E., a/b]
19 [E → a., a/b]
}
Goto (I0, E) = {
20 [D → E., a/b]
}
Goto (I0, a) = {
21 [E → a., a/b]
}
Goto (I0, b) = {
22 [E → b., a/b]
}
Note: There is no need to write complete Goto procedures again. Rather, just write the required
statements concerning the numbers given below.
1. [S' → S., #]
2. [S → A. B C D E, #]
PLEASE NOTE:
Don't copy-paste the same answer.
Make sure you can make some changes to your solution file before
submitting copy paste solution will be marked zero.
If you found any mistake then correct yourself and inform me.
Before submitting an assignment must check your assignment requirement
file.
If you need some help or question about file and solutions feel free to ask.
VUStudentspk.com