Re: implementing a callback interface for a RecDescent parser

[email protected] (damian)
Newsgroups perl.recdescent
Organization Perl Foundation
Message-ID <[email protected]>
Hi Dave,

You wrote:

> 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.

I'm not entirely clear exactly what you want to do, but I
suspect it's entirely possible. ;-)

Are you aware that you can define other methods in the 
Parse::RecDescent namespace, and they immediately become
methods of any parser object.

If I'm not on the right track here, you'll need to send
me a (short!) example of what you want to achieve, and
as soon as I understand it, I'll tell you how.

Damian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.