Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ivorw (5222)

  (email not shown publicly)

Journal of ivorw (5222)

Sunday June 18, 2006
11:28 AM

Tidying up Parse::RecDescent autotrees with topiary

[ #29943 ]

The work on cronic has made me think about using Parse::RecDescent autotrees in modules, as I want to turn the guts of cronic into one or more bot plugins.

The issue is that autotrees have their nodes blessed into packages corresponding to the rule names. To my mind, this sucks for two reasons. Firstly, you're polluting a namespace with no control, and secondly the objects should be brought into existence through a constructor, not blessing.

I toyed with rolling my own trees with an autorule, but this didn't give me what I wanted. I posted a wishlist item to RT, but I don't know when that will get looked at, as I know Damian is a busy man.

I looked briefly at the code in Parse::RecDescent to see if it is patchable, then came up with a better idea. This better idea is to post-process the output from the parser, walking the tree, building properly constructed nodes in a sensible namespace.



The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.