← 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:13 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/PPIx/Regexp/Token.pm
StatementsExecuted 8 statements in 206µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11112µs24µsPPIx::Regexp::Token::::BEGIN@48PPIx::Regexp::Token::BEGIN@48
1118µs62µsPPIx::Regexp::Token::::BEGIN@51PPIx::Regexp::Token::BEGIN@51
1117µs12µsPPIx::Regexp::Token::::BEGIN@49PPIx::Regexp::Token::BEGIN@49
0000s0sPPIx::Regexp::Token::::__PPIX_LEXER__finalizePPIx::Regexp::Token::__PPIX_LEXER__finalize
0000s0sPPIx::Regexp::Token::::__PPIX_TOKEN__post_makePPIx::Regexp::Token::__PPIX_TOKEN__post_make
0000s0sPPIx::Regexp::Token::::_newPPIx::Regexp::Token::_new
0000s0sPPIx::Regexp::Token::::contentPPIx::Regexp::Token::content
0000s0sPPIx::Regexp::Token::::unescaped_contentPPIx::Regexp::Token::unescaped_content
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 - Base class for PPIx::Regexp tokens.
4
5=head1 SYNOPSIS
6
7 use PPIx::Regexp::Dumper;
8 PPIx::Regexp::Dumper->new( 'qr{foo}' )->print();
9
10=head1 INHERITANCE
11
12C<PPIx::Regexp::Token> is a
13L<PPIx::Regexp::Element|PPIx::Regexp::Element>.
14
15C<PPIx::Regexp::Token> is the parent of
16L<PPIx::Regexp::Token::Assertion|PPIx::Regexp::Token::Assertion>,
17L<PPIx::Regexp::Token::Backtrack|PPIx::Regexp::Token::Backtrack>,
18L<PPIx::Regexp::Token::CharClass|PPIx::Regexp::Token::CharClass>,
19L<PPIx::Regexp::Token::Code|PPIx::Regexp::Token::Code>,
20L<PPIx::Regexp::Token::Comment|PPIx::Regexp::Token::Comment>,
21L<PPIx::Regexp::Token::Control|PPIx::Regexp::Token::Control>,
22L<PPIx::Regexp::Token::Greediness|PPIx::Regexp::Token::Greediness>,
23L<PPIx::Regexp::Token::GroupType|PPIx::Regexp::Token::GroupType>,
24L<PPIx::Regexp::Token::Literal|PPIx::Regexp::Token::Literal>,
25L<PPIx::Regexp::Token::Modifier|PPIx::Regexp::Token::Modifier>,
26L<PPIx::Regexp::Token::Operator|PPIx::Regexp::Token::Operator>,
27L<PPIx::Regexp::Token::Quantifier|PPIx::Regexp::Token::Quantifier>,
28L<PPIx::Regexp::Token::Reference|PPIx::Regexp::Token::Reference>,
29L<PPIx::Regexp::Token::Structure|PPIx::Regexp::Token::Structure>,
30L<PPIx::Regexp::Token::Unknown|PPIx::Regexp::Token::Unknown>,
31L<PPIx::Regexp::Token::Unmatched|PPIx::Regexp::Token::Unmatched> and
32L<PPIx::Regexp::Token::Whitespace|PPIx::Regexp::Token::Whitespace>.
33
34=head1 DESCRIPTION
35
36This class represents the base of the class hierarchy for tokens in the
37L<PPIx::Regexp|PPIx::Regexp> package.
38
39=head1 METHODS
40
41This class provides no public methods beyond those provided by its
42superclass.
43
44=cut
45
46package PPIx::Regexp::Token;
47
48220µs236µs
# spent 24µs (12+12) within PPIx::Regexp::Token::BEGIN@48 which was called: # once (12µs+12µs) by base::import at line 48
use strict;
# spent 24µs making 1 call to PPIx::Regexp::Token::BEGIN@48 # spent 12µs making 1 call to strict::import
49221µs216µs
# spent 12µs (7+5) within PPIx::Regexp::Token::BEGIN@49 which was called: # once (7µs+5µs) by base::import at line 49
use warnings;
# spent 12µs making 1 call to PPIx::Regexp::Token::BEGIN@49 # spent 5µs making 1 call to warnings::import
50
512161µs262µs
# spent 62µs (8+55) within PPIx::Regexp::Token::BEGIN@51 which was called: # once (8µs+55µs) by base::import at line 51
use base qw{PPIx::Regexp::Element};
# spent 62µs making 1 call to PPIx::Regexp::Token::BEGIN@51 # spent 55µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 55µs
52
531600nsour $VERSION = '0.036';
54
55sub _new {
56 my ( $class, $content ) = @_;
57 ref $class and $class = ref $class;
58
59 my $self = {
60 content => $content,
61 };
62
63 bless $self, $class;
64 return $self;
65}
66
67sub content {
68 my ( $self ) = @_;
69 return $self->{content};
70}
71
72sub unescaped_content {
73 my ( $self ) = @_;
74 my $content = $self->content();
75 $content =~ s/ \\ (?= . ) //smxg;
76 return $content;
77}
78
79
80# Called after the token is manufactured. The calling sequence is
81# $token->__PPIX_TOKEN__post_make( $tokenizer );
82sub __PPIX_TOKEN__post_make { return };
83
84# Called by the lexer once it has done its worst to all the tokens.
85# Called as a method with no arguments. The return is the number of
86# parse failures discovered when finalizing.
87sub __PPIX_LEXER__finalize {
88 return 0;
89}
90
9112µs1;
92
93__END__