implementing a callback interface for a RecDescent parser
[email protected] (Dave McD)
| Newsgroups | perl.recdescent |
|---|---|
| Message-ID | <[email protected]> |
I would like to implement a generic callback interface on the parser object where I can pass in a function pointer and a hash of the rules where the function should be called within an action assuming the rule is matched sucessfully. I know I can hack this in just by sticking a named main subroutine into the actions, but I would like a generic interface. Is there a method to do this Damian, besides hacking a pre-compiled parser package? That stuff looks pretty cryptic to me. I tried to create a sub (method) within the startup section of the grammar, but that does not work. Is there a way to do this thru class inheritance somehow? Thanks, Dave Mc __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com