Leftmost Right Derivation .Draw parse tree for the same. S→ aB|bA A→ a|aS|bAA(TOC)

Channel:
Subscribers:
108
Published on ● Video Link: https://www.youtube.com/watch?v=n9g0hsXME8E



Duration: 12:50
117 views
3


Derive using Leftmost Derivation and Rightm

i) bbaaba

ii) aaabbb.

Draw parse tree for the same.

#leftmostderivation #csstudent #informationtechnology #3rdyear #cs3rdyear #toc
#theoryofcomputation
#left #derivation


The given CFG is as follows −

S-aB|bA
A-a|aS|bAA
B-b|bS|aBB
To draw a parse tree first try to obtain derivation for the string aabbabba

Let’s take leftmost derivation as shown below −

S- aB
-aaBB
-aabSB
-aabbAB
-aabbaB
-aabbabS
-aabbabbA
-aabbabba which is our final string
Now, construct the derivation tree for the given grammar.

If the grammar is generating more than one type of tree, then we call the given grammar ambiguous grammar.


thankyou please subscribe my channel and hit like button ✅