Phrases example - Bottom-Up Parsing
Consider the following grammar:S : aAb S : ABA A : ab A : BAB B : aB B : band the right sentential form AaaBab. The following is a partial rightmost derivation:
S => ABA => ABab => AaBab => AaaBaband the following is the partially constructed parse tree:
The internal nodes in this parse tree give the following phrases:
AaaBab aaB aB : simple phrase ab : simple phraseThe "handle" will be the leftmost simple phrase, i.e. aB