I understand the part where, in the book, it describes a bottom up parser like this
S= aAc=aaAc=aabc
The example only has one RHS
S-aAc
A-aA|b
So when you replace b with aabc, A gets the second last sententail form in the derivation aaAc.
For my problem,
S - AbB | bAc
A - Ab | aBB
B - Ac | cBb | c
a. aAcccbbc
b. AbcaBccb
c. baBcBbbc
I'm not sure where to go from here? Do I replace |c with aAcccbbc?? What do you do in the case of many RHS?
Main Topics
Browse All Topics





by: zmoPosted on 2008-10-20 at 10:09:04ID: 22759906
hm... first, did you have a look at wikipedia's article on : ki/Bottom- up_parsing ?
http://en.wikipedia.org/wi
I think to help you the best is not to give you the result of your exercise, or your exam's day, you'll be doomed. (note to other experts, don't give it straight to him).
can you give us how you begin the parse tree construction, and at what point you don't get it, so we might just give you a little hint on how to get to the next step... and not doing it for you. Usually, you should get some kind of "stupid" algorithm to apply on the grammar to get the tree in your course's documentation.