How do I get the Phrase, Simple phrase and handle for the following:
Posted on 2008-10-20
I am taking a class in Programming Languages and I'm reading from my textbook (sebesta) but do not understand how they are coming up with the phrase, simple phrase and handle.
I know the handle is the RHS. A phrase can be derived from a single nonterminal in one or more tree levels, and a simple phrase can be derived in just a single tree level. But when I look at the following problem I don't understand how they break out the phrase, simple phrase and handle. The examples in the book are not clear to me.
Given the following grammer and the right sentential form, draw a parse tree and show the phrases and simple phrases as well as the handle:
S - AbB | bAc
A - Ab | aBB
B - Ac | cBb | c