31 31 votes Consider the augmented grammar given below: $S’ \rightarrow S$ $S \rightarrow \langle L \rangle \mid id$ $L \rightarrow L, S \mid S$ Let $I_0 = \text{CLOSURE} (\{[S’ \rightarrow \cdot S ]\}).$ The number of items in the set $\text{GOTO} (I_0, \langle \: )$ is______ Compiler Design gatecse-2019 numerical-answers compiler-design grammar two-marks + – Arjun 26.3k views answer comment Share Follow Print See all 6 Comments 6 6 Comments reply Show 3 previous comments HitechGa commented Jan 12, 2022 reply Follow flag Even if I consider LR(1) items, items shall remain 5 only. Please correct me if I am wrong. 4 4 replyShare Rusty_01 commented Jul 16, 2022 reply Follow flag @Umakant_Mukhiya it is not ambiguous cause we have already given augmented grammar without lookahead. So, it’s clearly Lr(0) or SLR(1). 1 1 replyShare TanayH commented Nov 11, 2025 i edited by TanayH Nov 11, 2025 reply Follow flag Umakant_Mukhiya I think we can infer that it is lr 0 from the goto statement not having a lookahead in it 0 0 replyShare Please log in or register to add a comment.
Best answer 52 52 votes Total $5$ items khushboo mishra answered Feb 7, 2019 • edited May 13, 2019 by Krithiga2101 khushboo mishra comment Share Follow See all 8 Comments 8 8 Comments reply Show 5 previous comments ANMOL TUTEJA commented Feb 7, 2019 reply Follow flag I have marked 2 since 5 will be entry for action-goto and go-to will be for L and S only 0 0 replyShare srestha commented Jan 15, 2020 reply Follow flag @Satbir chk this.. here Action+Goto taking 5 items, but asking for only GoTo state, right??Then why 5?? 1 1 replyShare Debapaul commented Jan 17, 2020 reply Follow flag I do not know why there is so much confusion regarding this question People who are saying only $GOTO$ is mentioned not the action part, think of one thing, what do we call GOTO? From a state if we go to the next state using a NON-Terminal production then that is GOTO But here in the question it is clearly mentioned that we need to find The number of items in the set $GOTO(I_0,⟨)$ here $⟨$ is a terminal symbol right? So why so much fuss about non terminal GOTO part They meant to ask the number of items in the canonical collection set of $GOTO(I_0,⟨)$ 13 13 replyShare Please log in or register to add a comment.
9 9 votes A item is a production rule with dot marker in a particular state. https://cs.stackexchange.com/questions/25924/lr0-parsing-how-can-i-know-sets-of-items-corresponding-to-states Ram Swaroop answered Feb 7, 2019 • reshown Feb 18, 2019 by Ram Swaroop Ram Swaroop comment Share Follow See 1 comment 1 1 comment reply srestha commented Jan 15, 2020 reply Follow flag @Ram Swaroop tell me one thing here Action+Goto taking 5 items, but asking for only GoTo state, right??Then why 5?? 0 0 replyShare Please log in or register to add a comment.
2 2 votes The canonical collection of items for the above grammar are: GOTO($I_0,<$ ) = $I_2$ which is having 5 items. Tuhin Dutta answered Feb 13, 2019 Tuhin Dutta comment Share Follow See all 2 Comments 2 2 Comments reply srestha commented Jan 15, 2020 reply Follow flag @Tuhin Dutta tell me one thing here Action+Goto taking 5 items, but asking for only GoTo state, right??Then why 5?? 0 0 replyShare Tuhin Dutta commented Jan 15, 2020 reply Follow flag I think they meant to ask no of items in the canonical collection set of the specified GOTO state and not the GOTO items. 2 2 replyShare Please log in or register to add a comment.
2 2 votes It’s asking the number of items in the set GOTO(I0, <). Means First evaluate I1 = GOTO(I0, <) and then count the number of items present in I1 state. Answer is 5. sgsudhir answered Jul 1, 2021 sgsudhir comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote 5 items Surya013 answered Jul 13, 2025 Surya013 comment Share Follow 0 reply Please log in or register to add a comment.