ClassFile/BNF/LocalVariableArray.pm

filter: Statementstmt 75.0% 15 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod n/a totaltotal 66.6% 20 / 30 SCAR 0.2
CC
1
Cov
75%
grammar
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.0
« ClassFile/BNF/LineNumberTableAttribute.pm ↑ Summary ClassFile/BNF/LocalVariableTableAttribute.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::LocalVariableArray;
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: Parsing an array of local variable
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::LocalVariable;
20  
21 my $_data = ${ __PACKAGE__->section_data('bnf') };
22 my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } );
23  
24 # --------------------------------------------------
25 # What role MarpaX::Java::ClassFile::Common requires
26 # --------------------------------------------------
27 0 ▶sub grammar { $_grammar }
Subroutine grammar: not called CC=1 SCAR=6.9
28 sub callbacks {
29 return {
30 0 ▶ "'exhausted" => sub { $_[0]->exhausted },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 0 ▶ 'local_variable$' => sub { $_[0]->inc_nbDone }
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 }
33 0 ▶}
Subroutine callbacks: not called CC=1 SCAR=6.9
34  
35 sub _local_variable {
36 # my ($self, $start_pc, $length, $name_index, $descriptor_index, $index) = @_;
37  
38 0 ▶ MarpaX::Java::ClassFile::Struct::LocalVariable->new(
Subroutine _local_variable: not called CC=1 SCAR=6.9
39 _constant_pool => $_[0]->constant_pool,
40 start_pc => $_[1],
41 length => $_[2],
42 name_index => $_[3],
43 descriptor_index => $_[4],
44 index => $_[5]
45 )
46 }
47  
48 with qw/MarpaX::Java::ClassFile::Role::Parser::InnerGrammar/;
49  
50 1;
51  
52 =pod
53  
54 =encoding UTF-8
55  
56 =head1 NAME
57  
58 MarpaX::Java::ClassFile::BNF::LocalVariableArray - Parsing an array of local variable
59  
60 =head1 VERSION
61  
62 version 0.008
63  
64 =head1 AUTHOR
65  
66 Jean-Damien Durand <jeandamiendurand@free.fr>
67  
68 =head1 COPYRIGHT AND LICENSE
69  
70 This software is copyright (c) 2016 by Jean-Damien Durand.
71  
72 This is free software; you can redistribute it and/or modify it under
73 the same terms as the Perl 5 programming language system itself.
74  
75 =cut
76  
77 __DATA__
78 __[ bnf ]__
79 :default ::= action => [values]
80 event 'local_variable$' = completed local_variable
81  
82 localVariableArray ::= local_variable*
83 local_variable ::= start_pc length name_index descriptor_index index action => _local_variable
84 start_pc ::= U2 action => u2
85 length ::= U2 action => u2
86 name_index ::= U2 action => u2
87 descriptor_index ::= U2 action => u2
88 index ::= U2 action => u2
« ClassFile/BNF/LineNumberTableAttribute.pm ↑ Summary ClassFile/BNF/LocalVariableTableAttribute.pm »