5 votes 5 votes Consider the following grammar: $S\rightarrow0S1 | 01$ How many of the following are the viable prefixes of the grammar? i. 01 ii. 001 iii. 00011 iv. 00S1 PS: given answers i, ii and iv , please explain! Compiler Design compiler-design parsing viable-prefix + – Vijay Thakur asked Jan 13, 2017 edited Nov 21, 2023 by Hira Thakur Vijay Thakur 1.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 8 votes 8 votes Check the link for explaination :- https://gateoverflow.in/68764/bottom-up-parsing $S\rightarrow 01$ $S\rightarrow 0S1\rightarrow 0011$ $S\rightarrow 0S1\rightarrow 00S11$ Set of Viable Prefix $V = \left \{ \epsilon ,0,1,01,0S,0S1,00,001,00S,00S1 \right \}$ Kapil answered Jan 13, 2017 selected Jan 13, 2017 by ManojK Kapil comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments Sushant Gokhale commented Jan 31, 2017 reply Follow Share @Lucky. See here 0 votes 0 votes Dipanshu Rana commented Nov 19, 2018 reply Follow Share please expain how you taken 1,0S as a viable prefix 0 votes 0 votes Vegeta commented Dec 10, 2018 reply Follow Share @Kapil sir i dont think 1 would be viable prefix 0 votes 0 votes Please log in or register to add a comment.