Given the following grammar and the right sentential form, draw a parse tree and then specify and write the phrases, simple phrase(s), and the handle.
Grammar: S → AbB | bAc A → Ab | aBB
B → Ac | cBb | c
Sentential form: AbcacAbcbccb
1.The Parse tree for the right Sentential form: AbcacAbcbccb for the given grammar is:
The Parse Tree is as follows:
2.Phrases is a subsequences of a sequential form that is eventually reduced to a single non-terminal.
Phrases of a parse tree are:
AbcacAbcbccb, cacAbcbccb, acAbcbc, cAbcb, Abc, Ab, c.
3.A simple phrase is a phrase that is reduced in a single step.
Simple Phrase(s) are:
Ab, c
4.The handle is the left-most simple phrase.
Handle are:
Ab
Get Answers For Free
Most questions answered within 1 hours.