On Jul 4, Steve Fink said:

>Personally, I could see using it with the current prototype perl6
>compiler to take over the parsing whenever a regex is seen. The
>resulting tree structure would then be translated into a
>languages/regex-style tree, and from there converted into PIR
>instructions. The translation step could perhaps be skipped if your
>parser uses some extensible factory-like pattern so that I could
>produce my preferred regex tree nodes directly -- or if I converted my
>regex compiler to use your tree nodes as their native representation.

You certainly can.  Each object has an insert() method which determines
HOW it gets placed in the tree.

>In order to get the parsing correct, however, I would need the ability
>to call back into my native perl6 parser when you encounter perl6 code
>during your parse -- and perhaps call you again within that code.

I don't see why not; you can go through the parsing node by node with the
next() method.  And Perl 6 regexes don't seem to need an initial once-over
like Perl 5 regexes do.

>I don't know if this is in the scope of what you were planning for your
>parser; now I'm wondering if you were intending to write something akin
>to Perl6::Rules in that it translates Perl6 rules into perl5-edible
>chunks, and all this business of reentrancy and external parsing callouts
>is not at all what you're interested in dealing with.

I think the module can handle it.

>I'll go download Regexp::Parser now, just so I'm not speculating quite
>so much.

R::P v0.03 will be available by the middle of the week; some bugs have
surfaced and some helpful changes are being made.  But for the time being,
play with the current version and see what you can do.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
CPAN ID: PINYAN    [Need a programmer?  If you like my work, let me know.]
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.

Reply via email to