0 0 votes Q5. Find the FIRST and FOLLOW of the grammar to check whether it is LL (1) parser or not. N → AB | BA A → a | CAC B → b | CBC C → a | b Compiler Design compiler-design + – Ebrahim 651 views answer comment Share Follow Print See 1 comment 1 1 comment reply Hira Thakur commented Dec 16, 2023 reply Follow flag given grammar is not LL(1); first(B)= first(b)$\cap$ first(CBC)=$b\cap(a,b)\neq\phi$ 0 0 replyShare Please log in or register to add a comment.
0 0 votes We can see B->b | CBC, will fall into the same cell in the LL(1) Parsing table as first(b)=b and first(C)={a,b}, therefore their intersection is b and hence we have multiple enteries in one cell. Hence the given grammar is not LL(1) practicalmetal answered Dec 17, 2023 practicalmetal comment Share Follow See 1 comment 1 1 comment reply Ebrahim commented Jan 11, 2024 reply Follow flag can you Explain step by step and write first and follow 0 0 replyShare Please log in or register to add a comment.
0 0 votes Given grammar is ambiguous grammar for string $aabb$. it generates 2 different parse trees for a particular string. For any LL(1) grammar it should be unambiguous grammar. so we can say it is not LL(1) grammar. first(N)={a,b}, follow(N)={$} first(A)={a,b}, follow(A)={$,a,b} first(B)={a,b},follow(B)={$,a,b} first(C)={a,b},follow(C={$,a,b} Hira Thakur answered Dec 18, 2023 Hira Thakur comment Share Follow See 1 comment 1 1 comment reply Ebrahim commented Jan 11, 2024 reply Follow flag can you Explain step by step and write first and follow 0 0 replyShare Please log in or register to add a comment.