ClassFile/BNF/FullFrame.pm

filter: Statementstmt 77.7% 21 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 53.8% 7 / 13 Podpod n/a totaltotal 70.0% 28 / 40 SCAR 0.1
CC
1
Cov
78%
grammar
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.0
« ClassFile/Struct/MethodInfo.pm ↑ Summary ClassFile/BNF/PathArray.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::FullFrame;
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # ABSTRACT: Parsing of a full_frame
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 1 ▶use MarpaX::Java::ClassFile::Struct::_Types qw/U1/;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use MarpaX::Java::ClassFile::Util::ProductionMode qw/prod_isa/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 #
18 # require because we do not import ANYTHING from these module, just require they are loaded
19 #
20 require Marpa::R2;
21 require MarpaX::Java::ClassFile::Struct::FullFrame;
22 require MarpaX::Java::ClassFile::BNF::VerificationTypeInfoArray;
23  
24 my $_data = ${ __PACKAGE__->section_data('bnf') };
25 my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } );
26  
27 has preloaded_frame_type => (is => 'ro', required => 1, prod_isa(U1));
28  
29 # --------------------------------------------------------
30 # What role MarpaX::Java::ClassFile::Role::Parser requires
31 # --------------------------------------------------------
32 0 ▶sub grammar { $_grammar }
Subroutine grammar: not called CC=1 SCAR=6.9
33 sub callbacks { return {
34 0 ▶ "'exhausted" => sub { $_[0]->exhausted },
Subroutine __ANON__: not called CC=1 SCAR=6.9
35 0 ▶ 'number_of_locals$' => sub { $_[0]->inner('VerificationTypeInfoArray', size => $_[0]->literalU2('number_of_locals')) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
36 0 ▶ 'number_of_stack_items$' => sub { $_[0]->inner('VerificationTypeInfoArray', size => $_[0]->literalU2('number_of_stack_items')) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
37 }
38 0 ▶ }
Subroutine callbacks: not called CC=1 SCAR=6.9
39  
40 # ---------------
41 # Grammar actions
42 # ---------------
43 sub _full_frame {
44 # my ($self, $frame_type, $offset_delta, $number_of_locals, $locals, $number_of_stack_items, $stack) = @_;
45  
46 0 ▶ MarpaX::Java::ClassFile::Struct::FullFrame->new(
Subroutine _full_frame: not called CC=1 SCAR=6.9
47 frame_type => $_[1],
48 offset_delta => $_[2],
49 number_of_locals => $_[3],
50 locals => $_[4],
51 number_of_stack_items => $_[5],
52 stack => $_[6]
53 )
54 }
55  
56 with 'MarpaX::Java::ClassFile::Role::Parser';
57  
58 1;
59  
60 =pod
61  
62 =encoding UTF-8
63  
64 =head1 NAME
65  
66 MarpaX::Java::ClassFile::BNF::FullFrame - Parsing of a full_frame
67  
68 =head1 VERSION
69  
70 version 0.008
71  
72 =head1 AUTHOR
73  
74 Jean-Damien Durand <jeandamiendurand@free.fr>
75  
76 =head1 COPYRIGHT AND LICENSE
77  
78 This software is copyright (c) 2016 by Jean-Damien Durand.
79  
80 This is free software; you can redistribute it and/or modify it under
81 the same terms as the Perl 5 programming language system itself.
82  
83 =cut
84  
85 __DATA__
86 __[ bnf ]__
87 event 'number_of_locals$' = completed number_of_locals
88 event 'number_of_stack_items$' = completed number_of_stack_items
89 full_frame ::= frame_type offset_delta number_of_locals locals number_of_stack_items stack action => _full_frame
90 frame_type ::= U1 action => u1
91 offset_delta ::= U2 action => u2
92 number_of_locals ::= U2 action => u2
93 locals ::= MANAGED action => ::first
94 number_of_stack_items ::= U2 action => u2
95 stack ::= MANAGED action => ::first
« ClassFile/Struct/MethodInfo.pm ↑ Summary ClassFile/BNF/PathArray.pm »