re::engine::Plugin

re::engine::Plugin is Perl API to write custom regex engines.
Download

re::engine::Plugin Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • var Arnfjr Bjarmason
  • Publisher web site:
  • http://search.cpan.org/~avar/re-engine-Plugin-0.04/Plugin.pod

re::engine::Plugin Tags


re::engine::Plugin Description

re::engine::Plugin is Perl API to write custom regex engines. re::engine::Plugin is Perl API to write custom regex engines.As of perl 5.9.5 it's possible to lexically replace perl's built-in regular expression engine with your own (see perlreapi and perlpragma). This module provides a glue interface to the relevant parts of the perl C API enabling you to write an engine in Perl instead of the C/XS interface provided by the core.The gory detailsEach regex in perl is compiled into an internal REGEXP structure (see perlreapi), this can happen either during compile time in the case of patterns in the format /pattern/ or runtime for qr// patterns, or something inbetween depending on variable interpolation etc.When this module is loaded into a scope it inserts a hook into $^H{regcomp} (as described in perlreapi) to have each regexp constructed in its lexical scope handled by this engine, but it differs from other engines in that it also inserts other hooks into %^H in the same scope that point to user-defined subroutines to use during compilation, execution etc, these are described in "CALLBACKS" below.The callbacks (e.g. "comp") then get called with a re::engine::Plugin object as their first argument. This object provies access to perl's internal REGEXP struct in addition to its own state (e.g. a stash). The methods on this object allow for altering the REGEXP struct's internal state, adding new callbacks, etc. Requirements: · Perl


re::engine::Plugin Related Software