-
Consider the grammar
E → E + n | E × n | n
For a sentence n + n × n, the handles in the right-sentential form of the reduction are
-
- n, E + n and E + n × n
- n, E + n and E + E × n
- n, n + n and n + n × n
- n, E + n and E × n
- n, E + n and E + n × n
Correct Option: D
Given grammar
E " E + n
E " E #n
E " n
String = n + n #n
Right sentential so right most non terminal will be used.
E " E #n {E " E #n}
E + n #n {E " E + n}
n + n #n {E " n}
So during reduction the order is reverse.
So {E " n, E " E + n, E " E #n}