The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PPIx::Regexp::Token::GroupType - Represent a grouping parenthesis type.

SYNOPSIS

 use PPIx::Regexp::Dumper;
 PPIx::Regexp::Dumper->new( 'qr{(?i:foo)}smx' )
     ->print();

INHERITANCE

PPIx::Regexp::Token::GroupType is a PPIx::Regexp::Token.

PPIx::Regexp::Token::GroupType is the parent of PPIx::Regexp::Token::GroupType::Assertion, PPIx::Regexp::Token::GroupType::BranchReset, PPIx::Regexp::Token::GroupType::Code, PPIx::Regexp::Token::GroupType::Modifier, PPIx::Regexp::Token::GroupType::NamedCapture, PPIx::Regexp::Token::GroupType::Subexpression and PPIx::Regexp::Token::GroupType::Switch.

DESCRIPTION

This class represents any of the magic sequences of characters that can follow an open parenthesis. This particular class is intended to be abstract.

METHODS

This class provides no public methods beyond those provided by its superclass.

__defining_string

 my $string = $class->__defining_string();

This method is private to the PPIx-Regexp package, and is documented for the author's benefit only. It may be changed or revoked without notice.

This method returns an array of strings that define the specific group type. These strings will normally start with '?'.

Optionally, the first returned item may be a hash reference. The only supported key is {suffix}, which is a string to be suffixed to each of the regular expressions made by __make_group_type_matcher() out of the defining strings, inside a (?= ... ), so that it is not included in the match.

This method must be overridden, unless __make_group_type_matcher() is. The override must return the same thing each time, since the results of __make_group_type_matcher() are cached.

__make_group_type_matcher

 my $hash_ref = $class->__make_group_type_matcher();

This method is private to the PPIx-Regexp package, and is documented for the author's benefit only. It may be changed or revoked without notice.

This method returns a reference to a hash. The keys are regexp delimiter characters which appear in the defining strings for the group type. For each key, the value is a reference to an array of Regexp objects, properly escaped for the key character. Key '' provides the regular expressions to be used if the regexp delimiter does not appear in any of the defining strings.

If this method is overridden by the subclass, method __defining_string() need not be, unless the overridden __make_group_type_matcher() calls __defining_string().

__match_setup

 $class->__match_setup( $tokenizer );

This method is private to the PPIx-Regexp package, and is documented for the author's benefit only. It may be changed or revoked without notice.

This method performs whatever setup is needed once it is determined that the given group type has been detected. This method is called only if the class matched at the current position in the string being parsed. It must perform whatever extra setup is needed for the match. It returns nothing.

This method need not be overridden. The default does nothing.

SUPPORT

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

AUTHOR

Thomas R. Wyant, III wyant at cpan dot org

COPYRIGHT AND LICENSE

Copyright (C) 2009-2015 by 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.