1PPIx::Regexp::Token::ReUfseerrenCcoen(t3r)ibuted Perl DoPcPuImxe:n:tRaetgieoxnp::Token::Reference(3)
2
3
4
6 PPIx::Regexp::Token::Reference - Represent a reference to a capture
7
9 use PPIx::Regexp::Dumper;
10 PPIx::Regexp::Dumper->new( 'qr{\1}smx' )
11 ->print();
12
14 "PPIx::Regexp::Token::Reference" is a PPIx::Regexp::Token.
15
16 "PPIx::Regexp::Token::Reference" is the parent of
17 PPIx::Regexp::Token::Backreference, PPIx::Regexp::Token::Condition and
18 PPIx::Regexp::Token::Recursion.
19
21 This abstract class represents a reference to a capture buffer, either
22 numbered or named. It should never be instantiated, but it provides a
23 number of methods to its subclasses.
24
26 This class provides the following public methods. Methods not
27 documented here are private, and unsupported in the sense that the
28 author reserves the right to change or remove them without notice.
29
30 absolute
31 print "The absolute reference is ", $ref->absolute(), "\n";
32
33 This method returns the absolute number of the capture buffer referred
34 to. This is the same as number() for unsigned numeric references. If
35 the reference is to a named buffer, "undef" is returned.
36
37 is_named
38 $ref->is_named and print "named reference\n";
39
40 This method returns true if the reference is named rather than
41 numbered.
42
43 is_relative
44 $ref->is_relative()
45 and print "relative numbered reference\n";
46
47 This method returns true if the reference is numbered and it is a
48 relative number (i.e. if it is signed).
49
50 name
51 print "The name is ", $ref->name(), "\n";
52
53 This method returns the name of the capture buffer referred to. In the
54 case of a reference to a numbered capture (i.e. "is_named" returns
55 false), this method returns "undef".
56
57 number
58 print "The number is ", $ref->number(), "\n";
59
60 This method returns the number of the capture buffer referred to. In
61 the case of a reference to a named capture (i.e. "is_named" returns
62 true), this method returns "undef".
63
65 Support is by the author. Please file bug reports at
66 <https://rt.cpan.org>, or in electronic mail to the author.
67
69 Thomas R. Wyant, III wyant at cpan dot org
70
72 Copyright (C) 2009-2020 by Thomas R. Wyant, III
73
74 This program is free software; you can redistribute it and/or modify it
75 under the same terms as Perl 5.10.0. For more details, see the full
76 text of the licenses in the directory LICENSES.
77
78 This program is distributed in the hope that it will be useful, but
79 without any warranty; without even the implied warranty of
80 merchantability or fitness for a particular purpose.
81
82
83
84perl v5.30.1 2020-02-10 PPIx::Regexp::Token::Reference(3)