Hi Jack,

I was struggling with problems like creating abstract syntax tree
for C++ code. That lead me to generalized LR parsing, eventually
I had to study closely the Dragonbook (Aho&Ulman). It does
provided me enough information to understand how to construct
tables for different LR parsers (the parser itself is easier to
understand).

To make tables, you have to calculate FIRST and FOLLOW
functions, make closure over rule items (rules with specified
position within rule) and combine such operations. Aho&Ulman
describe reasons rather good, so it wasn't just following a recipe
for me. For simplicity reasons, I've constructed tables for SLR
parsing, which is enough if generalized LR is used. It took me
about 250 lines of J code, rather simple, I should say, as I'm a J
newbie.

I can provide more details if you're interested.

Alexander



      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to