Re:“2015 will be the year that Perl 6 officially launches fo...
by arnsholt on Friday November 07, 2014 @11:48AM
(#8573384)
It's pretty easy (to the extent that implementing custom parsing logic is ever easy) to add custom parsing bits to a Perl 6 grammar.
The grammar is just a special class with the rules as methods, so rules with non-standard parsing logic can be implemented using Perl 6 code. Reusing standard rules from custom rules is simply a matter of calling the corresponding method.
The best example of this is probably the EXPR rule in the NQP compiler (which is in turn used by Rakudo's parser), which inserts an operator precedence parser into the recursive descent of the rest of the grammar.
LPeg is a library, Spirit X3 (for C++, not yet complete) is a library. Both achieve pretty seamless integration with your code. I think in a library is where this stuff should be.