Parse::RecDescent and autotree

Colin Kuskie ckuskie at dalsemi.com
Thu Jun 13 16:54:53 CDT 2002


Hey!

I've been learning Parse::RecDescent to use in a project here at work,
parsing SPICE netlists.  I decided that since this was my first attempt
at Parse::RecDescent, to keep it relatively simple, and just to build
a parser that would return a parse tree and then walk through it.

I think I may have either found a bug,  a documentation problem, or
(more likely) a serious lapse in my understanding of P::RD.  Below
you'll see my test script, it's totally self contained, printing a
bunch of output on STDOUT which are:

1) The two grammars that are generated.  One uses explicit actions to generate
the tree, according to the documentation, and the other uses the <autotree>
directive.
2) The first two levels of each parse tree.
  (I tried using Data::Dumper to look at the actual trees, but it complained
  "Can't handle  type. at spicy line 74", the line where Dumper is called)

According to the documentation, the two parse trees should be exactly
the same, but they aren't.

Here's some more details:

perl -v:
This is perl, version 5.005_03 built for sun4-solaris

Parse::RecDescent 1.80

Can anyone of you help me understand what's different and why?

Thanks,
Colin Kuskie
TIMTOWTDI



More information about the Pdx-pm-list mailing list