0
3.0kviews
Let G be the Grammar. Find the leftmost derivation,rightmost derivation and parse tree for the expression a*b+a*b

Mumbai University > Information Technology > Sem 4 > Automata Theory

Marks: 5M

Let G be the Grammar. Find the leftmost derivation,rightmost derivation and parse tree for the expression ab+ab

G : S => S+S|S*S

S => a|b

1 Answer
0
85views

Leftmost derivation:

S => S + S

S => SS + S (as S =>SS)

S => a*S + S (as S =>a)

S => a*b + S (as S =>b)

S => ab + SS (as S => S*S)

S => ab + a …

Create a free account to keep reading this post.

and 2 others joined a min ago.

Please log in to add an answer.