Lexical analysis and parsing


consider the grammar
S -> aSb
S -> aS
S -> epsilon
This grammar is ambiguous by generating which of the following String:
a) aa
b) epsilon
c) aaa
d) aab


d) aab is the correct answer
as there are two syntax tree for this string for the given grammar rules