ClassFile/BNF/SourceDebugExtensionAttribute.pm

filter: Statementstmt 71.4% 15 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod n/a totaltotal 64.5% 20 / 31 SCAR 0.2
CC
1
Cov
71%
grammar
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.0
« ClassFile/BNF/ElementValuePairArray.pm ↑ Summary ClassFile/BNF/TypePath.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::SourceDebugExtensionAttribute;
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: Parsing of a SourceDebugExtension_attribute
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::SourceDebugExtensionAttribute;
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::Role::Parser requires
26 # --------------------------------------------------------
27 0 ▶sub grammar { $_grammar }
Subroutine grammar: not called CC=1 SCAR=6.9
28 sub callbacks { return {
29 0 ▶ "'exhausted" => sub { $_[0]->exhausted },
Subroutine __ANON__: not called CC=1 SCAR=6.9
30 'attribute_length$' => sub {
31 0 ▶ my $attribute_length = $_[0]->literalU4('attribute_length');
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 0 lexeme_read_managed($attribute_length)
33 }
34 }
35 0 ▶ }
Subroutine callbacks: not called CC=1 SCAR=6.9
36  
37 # ---------------
38 # Grammar actions
39 # ---------------
40 sub _SourceDebugExtension_attribute {
41 # my ($self, $attribute_name_index, $attribute_length, $debug_extension) = @_;
42  
43 0 ▶ MarpaX::Java::ClassFile::Struct::SourceDebugExtensionAttribute->new(
Subroutine _SourceDebugExtension_attribute: not called CC=1 SCAR=6.9
44 _constant_pool => $_[0]->constant_pool,
45 attribute_name_index => $_[1],
46 attribute_length => $_[2],
47 debug_extension => $_[3]
48 )
49 }
50  
51 with 'MarpaX::Java::ClassFile::Role::Parser';
52  
53 1;
54  
55 =pod
56  
57 =encoding UTF-8
58  
59 =head1 NAME
60  
61 MarpaX::Java::ClassFile::BNF::SourceDebugExtensionAttribute - Parsing of a SourceDebugExtension_attribute
62  
63 =head1 VERSION
64  
65 version 0.008
66  
67 =head1 AUTHOR
68  
69 Jean-Damien Durand <jeandamiendurand@free.fr>
70  
71 =head1 COPYRIGHT AND LICENSE
72  
73 This software is copyright (c) 2016 by Jean-Damien Durand.
74  
75 This is free software; you can redistribute it and/or modify it under
76 the same terms as the Perl 5 programming language system itself.
77  
78 =cut
79  
80 __DATA__
81 __[ bnf ]__
82 event 'attribute_length$' = completed attribute_length
83 SourceDebugExtension_attribute ::= attribute_name_index attribute_length debug_extension action => _SourceDebugExtension_attribute
84 attribute_name_index ::= U2 action => u2
85 attribute_length ::= U4 action => u4
86 debug_extension ::= MANAGED action => utf8
« ClassFile/BNF/ElementValuePairArray.pm ↑ Summary ClassFile/BNF/TypePath.pm »