1PPIx::Regexp::Element(3U)ser Contributed Perl DocumentatiPoPnIx::Regexp::Element(3)
2
3
4

NAME

6       PPIx::Regexp::Element - Base of the PPIx::Regexp hierarchy.
7

SYNOPSIS

9       No user-serviceable parts inside.
10

INHERITANCE

12       "PPIx::Regexp::Element" is not descended from any other class.
13
14       "PPIx::Regexp::Element" is the parent of PPIx::Regexp::Node and
15       PPIx::Regexp::Token.
16

DESCRIPTION

18       This class is the base of the PPIx::Regexp object hierarchy. It
19       provides the same kind of navigational functionality that is provided
20       by PPI::Element.
21

METHODS

23       This class provides the following public methods. Methods not
24       documented here are private, and unsupported in the sense that the
25       author reserves the right to change or remove them without notice.
26
27   ancestor_of
28       This method returns true if the object is an ancestor of the argument,
29       and false otherwise. By the definition of this method, $self is its own
30       ancestor.
31
32   class
33       This method returns the class name of the element. It is the same as
34       "ref $self".
35
36   comment
37       This method returns true if the element is a comment and false
38       otherwise.
39
40   content
41       This method returns the content of the element.
42
43   descendant_of
44       This method returns true if the object is a descendant of the argument,
45       and false otherwise. By the definition of this method, $self is its own
46       descendant.
47
48   next_sibling
49       This method returns the element's next sibling, or nothing if there is
50       none.
51
52   parent
53       This method returns the parent of the element, or undef if there is
54       none.
55
56   perl_version_introduced
57       This method returns the version of Perl in which the element was
58       introduced. But in practice it will never return a number less than
59       5.006, since that is the minimum version supported by this package.
60
61   perl_version_removed
62       This method returns the version of Perl in which the element was
63       removed. If the element is still valid the return is "undef".
64
65   previous_sibling
66       This method returns the element's previous sibling, or nothing if there
67       is none.
68
69   significant
70       This method returns true if the element is significant and false
71       otherwise.
72
73   snext_sibling
74       This method returns the element's next significant sibling, or nothing
75       if there is none.
76
77   sprevious_sibling
78       This method returns the element's previous significant sibling, or
79       nothing if there is none.
80
81   tokens
82       This method returns all tokens contained in the element.
83
84   top
85       This method returns the top of the hierarchy.
86
87   whitespace
88       This method returns true if the element is whitespace and false
89       otherwise.
90
91   nav
92       This method returns navigation information from the top of the
93       hierarchy to this node. The return is a list of names of methods and
94       references to their argument lists. The idea is that given $elem which
95       is somewhere under $top,
96
97        my @nav = $elem->nav();
98        my $obj = $top;
99        while ( @nav ) {
100            my $method = shift @nav;
101            my $args = shift @nav;
102            $obj = $obj->$method( @{ $args } ) or die;
103        }
104        # At this point, $obj should contain the same object
105        # as $elem.
106

SUPPORT

108       Support is by the author. Please file bug reports at
109       <http://rt.cpan.org>, or in electronic mail to the author.
110

AUTHOR

112       Thomas R. Wyant, III wyant at cpan dot org
113
115       Copyright (C) 2009-2010, Thomas R. Wyant, III
116
117       This program is free software; you can redistribute it and/or modify it
118       under the same terms as Perl 5.10.0. For more details, see the full
119       text of the licenses in the directory LICENSES.
120
121       This program is distributed in the hope that it will be useful, but
122       without any warranty; without even the implied warranty of
123       merchantability or fitness for a particular purpose.
124
125
126
127perl v5.12.0                      2010-06-08          PPIx::Regexp::Element(3)
Impressum