← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:14 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Token/Quantifier.pm
StatementsExecuted 9 statements in 204µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11114µs27µsPPIx::Regexp::Token::Quantifier::::BEGIN@33PPIx::Regexp::Token::Quantifier::BEGIN@33
1118µs14µsPPIx::Regexp::Token::Quantifier::::BEGIN@34PPIx::Regexp::Token::Quantifier::BEGIN@34
1117µs68µsPPIx::Regexp::Token::Quantifier::::BEGIN@36PPIx::Regexp::Token::Quantifier::BEGIN@36
0000s0sPPIx::Regexp::Token::Quantifier::::__PPIX_TOKENIZER__regexpPPIx::Regexp::Token::Quantifier::__PPIX_TOKENIZER__regexp
0000s0sPPIx::Regexp::Token::Quantifier::::can_be_quantifiedPPIx::Regexp::Token::Quantifier::can_be_quantified
0000s0sPPIx::Regexp::Token::Quantifier::::could_be_quantifierPPIx::Regexp::Token::Quantifier::could_be_quantifier
0000s0sPPIx::Regexp::Token::Quantifier::::is_quantifierPPIx::Regexp::Token::Quantifier::is_quantifier
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1=head1 NAME
2
3PPIx::Regexp::Token::Quantifier - Represent an atomic quantifier.
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{\w+}smx' )
9 ->print();
10
11=head1 INHERITANCE
12
13C<PPIx::Regexp::Token::Quantifier> is a
14L<PPIx::Regexp::Token|PPIx::Regexp::Token>.
15
16C<PPIx::Regexp::Token::Quantifier> has no descendants.
17
18=head1 DESCRIPTION
19
20This class represents an atomic quantifier; that is, one of the
21characters C<*>, C<+>, or C<?>.
22
23=head1 METHODS
24
25This class provides the following public methods. Methods not documented
26here are private, and unsupported in the sense that the author reserves
27the right to change or remove them without notice.
28
29=cut
30
31package PPIx::Regexp::Token::Quantifier;
32
33223µs241µs
# spent 27µs (14+13) within PPIx::Regexp::Token::Quantifier::BEGIN@33 which was called: # once (14µs+13µs) by PPIx::Regexp::Tokenizer::BEGIN@37 at line 33
use strict;
# spent 27µs making 1 call to PPIx::Regexp::Token::Quantifier::BEGIN@33 # spent 13µs making 1 call to strict::import
34228µs219µs
# spent 14µs (8+5) within PPIx::Regexp::Token::Quantifier::BEGIN@34 which was called: # once (8µs+5µs) by PPIx::Regexp::Tokenizer::BEGIN@37 at line 34
use warnings;
# spent 14µs making 1 call to PPIx::Regexp::Token::Quantifier::BEGIN@34 # spent 5µs making 1 call to warnings::import
35
362146µs2129µs
# spent 68µs (7+61) within PPIx::Regexp::Token::Quantifier::BEGIN@36 which was called: # once (7µs+61µs) by PPIx::Regexp::Tokenizer::BEGIN@37 at line 36
use base qw{ PPIx::Regexp::Token };
# spent 68µs making 1 call to PPIx::Regexp::Token::Quantifier::BEGIN@36 # spent 61µs making 1 call to base::import
37
381500nsour $VERSION = '0.036';
39
40# Return true if the token can be quantified, and false otherwise
41sub can_be_quantified { return };
42
43# Return true if the token is a quantifier.
44sub is_quantifier { return 1 };
45
4613µsmy %quantifier = map { $_ => 1 } qw{ * + ? };
47
48=head2 could_be_quantifier
49
50 PPIx::Regexp::Token::Quantifier->could_be_quantifier( '*' );
51
52This method returns true if the given string could be a quantifier; that
53is, if it is '*', '+', or '?'.
54
55=cut
56
57sub could_be_quantifier {
58 my ( $class, $string ) = @_;
59 return $quantifier{$string};
60}
61
62sub __PPIX_TOKENIZER__regexp {
63 my ( $class, $tokenizer, $character ) = @_;
64
65 $tokenizer->prior( 'can_be_quantified' )
66 or return;
67
68 return $quantifier{$character};
69}
70
7113µs1;
72
73__END__