Lexical analysis and parsing


#1

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


#2

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