PPIx::Regexp::Element - Base of the PPIx::Regexp hierarchy.
No user-serviceable parts inside.
PPIx::Regexp::Element is not descended from any other class.
PPIx::Regexp::Element
PPIx::Regexp::Element is the parent of PPIx::Regexp::Node and PPIx::Regexp::Token.
This class is the base of the PPIx::Regexp object hierarchy. It provides the same kind of navigational functionality that is provided by PPI::Element.
This class provides the following public methods. Methods not documented here are private, and unsupported in the sense that the author reserves the right to change or remove them without notice.
This method returns true if the object is an ancestor of the argument, and false otherwise. By the definition of this method, $self is its own ancestor.
$self
This method returns the class name of the element. It is the same as ref $self.
ref $self
This method returns true if the element is a comment and false otherwise.
This method returns the content of the element.
This method returns true if the object is a descendant of the argument, and false otherwise. By the definition of this method, $self is its own descendant.
This method returns the element's next sibling, or nothing if there is none.
This method returns the parent of the element, or undef if there is none.
This method returns the version of Perl in which the element was introduced. But in practice it will never return a number less than 5.006, since that is the minimum version supported by this package.
This method returns the version of Perl in which the element was removed. If the element is still valid the return is undef.
undef
This method returns the element's previous sibling, or nothing if there is none.
This method returns true if the element is significant and false otherwise.
This method returns the element's next significant sibling, or nothing if there is none.
This method returns the element's previous significant sibling, or nothing if there is none.
This method returns all tokens contained in the element.
This method returns the top of the hierarchy.
This method returns true if the element is whitespace and false otherwise.
This method returns navigation information from the top of the hierarchy to this node. The return is a list of names of methods and references to their argument lists. The idea is that given $elem which is somewhere under $top,
$elem
$top
my @nav = $elem->nav(); my $obj = $top; while ( @nav ) { my $method = shift @nav; my $args = shift @nav; $obj = $obj->$method( @{ $args } ) or die; } # At this point, $obj should contain the same object # as $elem.
Support is by the author. Please file bug reports at http://rt.cpan.org, or in electronic mail to the author.
Thomas R. Wyant, III wyant at cpan dot org
Copyright (C) 2009, Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install PPIx::Regexp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPIx::Regexp
CPAN shell
perl -MCPAN -e shell install PPIx::Regexp
For more information on module installation, please visit the detailed CPAN module installation guide.