ClassFile/Role/Parser/InnerGrammar.pm

filter: Statementstmt 63.4% 26 / 41 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 50.0% 6 / 12 Podpod 0.0% 0 / 2 totaltotal 41.0% 32 / 78 SCAR 29.3
CC
8
Cov
45%
__ANON__
20.0
__ANON__
12.0
__ANON__
12.0
CRAP 18.7
« ClassFile/BNF/StackMapFrameArray.pm ↑ Summary ClassFile.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MarpaX::Java::ClassFile::Role::Parser::InnerGrammar;
5  
6 # ABSTRACT: Parsing engine role for .class file parsing - inner grammar
7  
8 1 our $VERSION = '0.008'; # VERSION
9  
10 1 our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
11  
12 1 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use MarpaX::Java::ClassFile::Util::ProductionMode qw/prod_isa/;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use Types::Common::Numeric qw/PositiveOrZeroInt/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use Types::Standard qw/Int ArrayRef/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 #
18 # size have this meaning:
19 # 0 none output will always be []
20 # < 0 unknown (then caller should set max)
21 # > 0 fixed
22 #
23 0 ▶has size => ( is => 'ro', prod_isa(Int), default => sub { 0 } );
Subroutine __ANON__: not called CC=1 SCAR=1.2
24  
25 1 with qw/MarpaX::Java::ClassFile::Role::Parser/;
26  
27 # ------------------
28 # Role modifications
29 # ------------------
30 0 ▶sub nbDone { $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone }
Subroutine nbDone: not called CC=1 SCAR=6.9
Pod undocumented
31 0 ▶sub inc_nbDone { $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone++ }
Subroutine inc_nbDone: not called CC=1 SCAR=6.9
Pod undocumented
32  
33 around ast => sub {
34 0 ▶ my ($orig, $self) = @_;
Subroutine __ANON__: not called CC=4 SCAR=30.0
35  
36 0 local $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone = 0;
37 0 ▶ (($self->size > 0) || (($self->size < 0) && ($self->max > $self->pos))) ? $self->$orig : []
Branch: 1 branch
BranchTrueFalseTotal
$self->size > 0 || $self->size < 0 && $self->max > $self->pos ? : 0 0 0
Condition0%0/6
$self->size > 0 or $self->size < 0 and $self->max > $self->pos
l!l&&r!l&&!r
000
$self->size < 0 and $self->max > $self->pos
!ll&&!rl&&r
000
MC/DC0%0/3
$self->size > 0 or $self->size < 0 and $self->max > $self->pos
$self->size > 0 $self->size < 0 $self->max > $self->pos
Truth table0%0/4
A or B and C
A= $self->size > 0B= $self->size < 0C= $self->max > $self->pos
ABCresult
1XX1
0111
00X0
0100
38 1 };
39  
40 around manageEvents => sub {
41 0 ▶ my ($orig, $self) = @_;
Subroutine __ANON__: not called CC=3 SCAR=24.8
42  
43 0 $self->$orig;
44 0 ▶ $self->_set_max($self->pos) if (($self->size > 0) && ($MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size))
Branch: 1 branch
BranchTrueFalseTotal
if $self->size > 0 and $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size 0 0 0
Condition0%0/3
$self->size > 0 and $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size
!ll&&!rl&&r
000
MC/DC0%0/2
$self->size > 0 and $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size
$self->size > 0 $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size
Truth table0%0/3
A and B
A= $self->size > 0B= $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone >= $self->size
ABresult
0X0
100
111
45 1 };
46  
47 around whoami => sub {
48 0 ▶ my ($orig, $self, @args) = @_;
Subroutine __ANON__: not called CC=3 SCAR=24.8
49  
50 0 my $whoami = $self->$orig(@args);
51 0 my $size = $self->size;
52 0 ▶ my $i = $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone // 0;
Condition0%0/2
$MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone // 0
l!l
00
MC/DC0%0/1
$MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone // 0
$MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone
Truth table0%0/2
A
A= $MarpaX::Java::ClassFile::Role::Parser::InnerGrammar::nbDone
Aresult
11
00
53  
54 0 ▶ ++$i if ($i < $size);
Branch: 1 branch
BranchTrueFalseTotal
if $i < $size 0 0 0
55 0 "${whoami}[${i}/${size}]"
56 1 };
57  
58 1 1;
59  
60 __END__
61  
62 =pod
63  
64 =encoding UTF-8
65  
66 =head1 NAME
67  
68 MarpaX::Java::ClassFile::Role::Parser::InnerGrammar - Parsing engine role for .class file parsing - inner grammar
69  
70 =head1 VERSION
71  
72 version 0.008
73  
74 =head1 AUTHOR
75  
76 Jean-Damien Durand <jeandamiendurand@free.fr>
77  
78 =head1 COPYRIGHT AND LICENSE
79  
80 This software is copyright (c) 2016 by Jean-Damien Durand.
81  
82 This is free software; you can redistribute it and/or modify it under
83 the same terms as the Perl 5 programming language system itself.
84  
85 =cut
« ClassFile/BNF/StackMapFrameArray.pm ↑ Summary ClassFile.pm »