Given the following grammar with SLR parsing table, test whether the string “int * (int + int)” will be accepted or rejected.

E -> T + E……….(1)

E -> T……….(2)

T -> int*T……….(3)

T -> int……….(4)

T -> (E)……….(5)

STATE ACTION GOTO
int * + ( ) $ E T
1 S5 S4 2 3
2 ACC
3 S6 R2 R2
4 S5 S4 7 3
5 S8 R4 R4 R4
6 S5 S4 9 3
7 S10
8 S5 S4 11
9 R1 R1
10 R5 R5 R5
11 R3 R3 R3

  • Answered by
  • 0 Comments
  • 5 months ago

This answer is restricted. Please login to view the answer of this question.

Login Now
Leave your Answer:

Click here to submit your answer.

s
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments