2 votes 2 votes Consider the following grammar: $E' \rightarrow E$ $E \rightarrow E + Y \mid Y$ $Y \rightarrow Y ^* F \mid F$ $F \rightarrow id \mid (E)$ How many $LR(0)$ items are there in closure $(\{E' \rightarrow \cdot E\})$? $1$ $6$ $7$ $5$ Compiler Design tbb-cd-1 compiler-design parsing + – Bikram asked Nov 25, 2016 • retagged Sep 14, 2020 by ajaysoni1924 Bikram 388 views answer comment Share Follow See 1 comment See all 1 1 comment reply Hradesh patel commented Dec 16, 2016 reply Follow Share sir ..i got 6.......but i am not include E'--->.E 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes The following are the 7 LR(0) items. E' --> .E E --> .E + Y E --> .Y Y --> .Y * F E --> .F F --> .id F --> .(E) So, Option C. shraddha priya answered Apr 21, 2017 • selected Apr 21, 2017 by Bikram shraddha priya comment Share Follow See all 2 Comments See all 2 2 Comments reply Shubhanshu commented May 3, 2017 reply Follow Share Don't we need to consider the starting production i.e. E'' -> .E' ?? 0 votes 0 votes shraddha priya commented May 5, 2017 reply Follow Share No, we don't. Closure of E' --> .E is asked, so we start from this production itself and include all other productions subsequently where there is a dot(.) before a non terminal at the leftmost position of rhs. And so on for the productions obtained in the process. 0 votes 0 votes Please log in or register to add a comment.