ClassFile/BNF/FieldsArray.pm

filter: Statementstmt 68.1% 15 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod n/a totaltotal 60.6% 20 / 33 SCAR 0.3
CC
1
Cov
68%
grammar
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.0
« ClassFile/BNF/CodeAttribute.pm ↑ Summary ClassFile/BNF/MethodsArray.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::BNF::FieldsArray;
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: Parsing an array of field
8  
9 our $VERSION = '0.008'; # VERSION
10  
11 our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
12  
13 1 ▶use Data::Section -setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use MarpaX::Java::ClassFile::Util::BNF qw/:all/;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 #
16 # require because we do not import ANYTHING from these module, just require they are loaded
17 #
18 require Marpa::R2;
19 require MarpaX::Java::ClassFile::Struct::FieldInfo;
20 require MarpaX::Java::ClassFile::BNF::AttributesArray;
21  
22 my $_data = ${ __PACKAGE__->section_data('bnf') };
23 my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } );
24  
25 # --------------------------------------------------
26 # What role MarpaX::Java::ClassFile::Common requires
27 # --------------------------------------------------
28 0 ▶sub grammar { $_grammar }
Subroutine grammar: not called CC=1 SCAR=6.9
29 sub callbacks {
30 return {
31 0 ▶ "'exhausted" => sub { $_[0]->exhausted },
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 0 ▶ 'field_info$' => sub { $_[0]->inc_nbDone },
Subroutine __ANON__: not called CC=1 SCAR=6.9
33 0 ▶ 'attributes_count$' => sub { $_[0]->inner('AttributesArray', size => $_[0]->literalU2('attributes_count')) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
34 }
35 0 ▶}
Subroutine callbacks: not called CC=1 SCAR=6.9
36  
37 sub _field_info {
38 0 ▶ my ($self, $access_flags, $name_index, $descriptor_index, $attributes_count, $attributes) = @_;
Subroutine _field_info: not called CC=1 SCAR=6.9
39  
40 0 MarpaX::Java::ClassFile::Struct::FieldInfo->new(
41 _constant_pool => $_[0]->constant_pool,
42 access_flags => $access_flags,
43 name_index => $name_index,
44 descriptor_index => $descriptor_index,
45 attributes_count => $attributes_count,
46 attributes => $attributes
47 )
48 }
49  
50 with qw/MarpaX::Java::ClassFile::Role::Parser::InnerGrammar/;
51  
52 1;
53  
54 =pod
55  
56 =encoding UTF-8
57  
58 =head1 NAME
59  
60 MarpaX::Java::ClassFile::BNF::FieldsArray - Parsing an array of field
61  
62 =head1 VERSION
63  
64 version 0.008
65  
66 =head1 AUTHOR
67  
68 Jean-Damien Durand <jeandamiendurand@free.fr>
69  
70 =head1 COPYRIGHT AND LICENSE
71  
72 This software is copyright (c) 2016 by Jean-Damien Durand.
73  
74 This is free software; you can redistribute it and/or modify it under
75 the same terms as the Perl 5 programming language system itself.
76  
77 =cut
78  
79 __DATA__
80 __[ bnf ]__
81 :default ::= action => [values]
82 event 'attributes_count$' = completed attributes_count
83 event 'field_info$' = completed field_info
84  
85 fieldsArray ::= field_info*
86  
87 field_info ::= access_flags name_index descriptor_index attributes_count attributes action => _field_info
88 access_flags ::= U2 action => u2
89 name_index ::= U2 action => u2
90 descriptor_index ::= U2 action => u2
91 attributes_count ::= U2 action => u2
92 attributes ::= MANAGED action => ::first
« ClassFile/BNF/CodeAttribute.pm ↑ Summary ClassFile/BNF/MethodsArray.pm »