2 2 votes Consider the following arammar $G$ :$$\begin{aligned}& S \rightarrow(L) \mid a \\& L \rightarrow L, S \mid S\end{aligned}$$Which of the following statement(s) is/are TRUE regarding the parsing of grammar $G$ ?THE GRAMMAR IS $\mathrm{LR(0)}$. THE GRAMMAR IS $\mathrm{LL(1)}$. THE grammar is $\mathrm{SLR(1)}$. THE GRAMMAR IS AN OPERATOR GRAMMAR. Compiler Design goclasses compiler goclasses-cs-dpp goclasses-cs-dpp-day-191 goclasses-compiler-practice-questions multiple-selects + – GO Classes 557 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote B, DConflicts occur in both SLR(1) and LR(0) Vishnu__ answered Feb 6 1 flag: ✌ Edit necessary (vishwajeet_kumar) Vishnu__ comment Share Follow See all 2 Comments 2 2 Comments reply Aman Shukla commented Mar 28 reply Follow flag option C also correct 0 0 replyShare One_Last_Hope commented May 31 reply Follow flag actually LL(1) grammar won't allow left recursion and non-left-factored grammar and ambiguity first check these rules then go for table construction here here left-recursion it mean LL(1) fails here no need to think again also 1 1 replyShare Please log in or register to add a comment.
0 0 votes option B,C,D Aman Shukla answered Mar 28 2 flags: ✌ Edit necessary (vishwajeet_kumar “B fails because there is left recursion”)✌ Edit necessary (Nav_s “It contain left recursion in option B”) Aman Shukla comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Option A,B,C are correct (from their respective tables) For option D: An operator grammar is defined by two strict rules: 1. It contains no ε-productions. 2. No two non-terminals are adjacent on the right-hand side of any production. Hence, option D is also correct. sweetjimmy answered May 10 sweetjimmy comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes A,C,D are correct because at augmented production there is only production of S. since dot is not present at front of L. vishwajeet_kumar answered Jun 20 vishwajeet_kumar comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes From DFA construction grammar is LR(0) that makes it SLR(1) Due to left recursion in L->L,S it is not LL(1) Grammar is operator as no adjacent non-terminals in RHS. So, Options A,C,D are correct. Abhinav_Mishra answered Aug 6 Abhinav_Mishra comment Share Follow 0 reply Please log in or register to add a comment.