B::XPath

B::XPath class can search Perl optrees with XPath syntax.
Download

B::XPath Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • chromatic
  • Publisher web site:
  • http://search.cpan.org/~chromatic/Crypt-CipherSaber-1.00/lib/Crypt/CipherSaber.pm

B::XPath Tags


B::XPath Description

B::XPath class can search Perl optrees with XPath syntax. B::XPath class can search Perl optrees with XPath syntax.SYNOPSISPerl represents programs internally as a tree of opcodes. To execute a program, it walks this tree, performing each operation as it encounters it. The B family of modules allows you to examine (and in some cases, manipulate) this optree on programs even as they run.B::XPath allows you to use XPath syntax to select ops in the optree. use B::XPath; my $node = B::XPath->fetch_root( &some_function ); my $root = B::XPath->fetch_main_root(); # find all global scalar accesses my @globals = $root->match( '//gvsv' ); # find all global scalar accesses within some_function() named $bob my @bobs = $node->match( '//gvsv' );Class MethodsThere are two methods to use to start your match; both set the root of the tree to search. There's also a nice helper method you'll probably never use unless you find a bug.fetch_root( $subref )This method returns the B::XPath::Node object at the root of the optree for the subroutine reference. All matches performed on this node will search this branch of the optree for matching nodes.fetch_main_root()This method returns the B::XPath::Node object at the root of the program. Use this to search your entire program (at least, the part of it outside of any given subroutine).find_op_class( $op )Given a B::OP or descendent object, returns the name of the appropriate B::XPath::Node subclass to use to wrap that op so that B::XPath can manipulate it appropriately. Requirements: · Perl


B::XPath Related Software