7 votes 7 votes Which variable does not drive a terminal string in grammar? $S \rightarrow AB$ $A \rightarrow a$ $B \rightarrow b$ $B \rightarrow C$ A B C S Compiler Design isro2011 compiler-design parsing + – Isha Gupta asked Jun 19, 2016 edited Dec 4, 2022 by Lakshman Bhaiya Isha Gupta 2.9k views answer comment Share Follow See 1 comment See all 1 1 comment reply naga praveen commented Jun 22, 2016 reply Follow Share Options for this question are: a . A b. B c. C d. S 0 votes 0 votes Please log in or register to add a comment.
6 votes 6 votes Here S -> AB {A ->a} and {B ->b or C} if B goes with C then, there is no termination string. So, answer is 'C' . which is also called useless symbol. khyati answered Jun 22, 2016 khyati comment Share Follow See all 3 Comments See all 3 3 Comments reply Kapil commented Jun 22, 2016 reply Follow Share c or d? 0 votes 0 votes khyati commented Jun 22, 2016 reply Follow Share yes. C is useless symbol. So, option D where B is deriving an un-terminated symbol. ie. B -> C. 1 votes 1 votes naga praveen commented Jun 22, 2016 reply Follow Share Options for this question are:a . Ab. Bc. Cd. S 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes C is the variable which do not derive any terminal, its also called useless symbol, after reducing useless variables your remaining grammar is, S--> AB, A-->a , B-->b also see this rameshbabu answered Jun 19, 2016 edited Jun 19, 2016 by rameshbabu rameshbabu comment Share Follow See all 2 Comments See all 2 2 Comments reply LeenSharma commented Jun 19, 2016 reply Follow Share why you deleted production B->b here? 0 votes 0 votes rameshbabu commented Jun 19, 2016 reply Follow Share you are right, i corrected it 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes its simple as C is unreachable it cannot derive any string suryaprakash answered Feb 9, 2018 suryaprakash comment Share Follow See all 0 reply Please log in or register to add a comment.