2 votes 2 votes Consider the following grammar: $$ \begin{aligned} & S \rightarrow a S^{\prime} \\ & S^{\prime} \rightarrow b S^{\prime} \mid \epsilon \end{aligned} $$ Which of the following is/are CORRECT right sentential form of the given grammar? $a b S^{\prime}$ $bS'$ $a S^{\prime} b$ $bbS$ Compiler Design goclasses2024-mockgate-12 goclasses compiler-design parsing multiple-selects 2-marks + – GO Classes asked Jan 21 • retagged Jan 25 by Lakshman Bhaiya GO Classes 559 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes To keep in mind, Ques is asking right sentential form, not viable prefix. Just expand S and check if it can be derived or not A . S→ aS’ → abS’ S → aS’ → a | abS’ So bS’ cant be derived S → aS’ → abS’ | a So aS’b cant be derived bbS can’t be derives squirrel69 answered Jan 21 squirrel69 comment Share Follow See all 3 Comments See all 3 3 Comments reply amitarp818 commented Jan 22 reply Follow Share @GO Classes why can't b be the answer??like in this S → aS’ → abS’ → abbS’ 0 votes 0 votes squirrel69 commented Jan 22 reply Follow Share What you are saying is a viable prefix not a sentential form. sentential form is a complete state while viable prefix are the prefix of the sentential form 4 votes 4 votes Shreyas16 commented Jan 29 reply Follow Share Even bS' is not a viable prefix. The derivation that he is given is S → aS’ → abS’ → abbS’ For 2 nd step bS' is handle so the possible viable prefixes are : a , ab , abS' and not bS' For 3rd step bS' is handle so the possible viable prefixes are : a , ab ,abb, abbS'. 0 votes 0 votes Please log in or register to add a comment.