Consider the grammar P = {S → aS | asbs | ϵ} is ambiguous by constructing: (i) Two parse tree (ii) Two left most derivation (iii) Right most derivation


Here the parse tree,
(i)


(ii) Two left most derivations are:
S → as
→ aasbs
→ aaϵbs
→ aabs
→aabϵ
→aab
S → asbs
→ aasbs
→ aaϵbs
→ aabs
→ aabϵ
→ aab

(iii) The two right most derivations are:

S → as
→ aasbs
→ aasbϵ
→aasb
→ aaϵb
→ aab
S → asbs
→ asbϵ
→ asb
→ aasb
→ aaϵb
→ aab



No comments

Dear Members, Thanks for Your Comments. We must be reply your comment answer as soon as possible. Please Stay with us.....

Theme images by ideabug. Powered by Blogger.