| 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::ConstantPoolArray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # ABSTRACT: Parsing an array of constant pool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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::BNF::ConstantUtf8Info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | require MarpaX::Java::ClassFile::BNF::ConstantIntegerInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | require MarpaX::Java::ClassFile::BNF::ConstantFloatInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | require MarpaX::Java::ClassFile::BNF::ConstantLongInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | require MarpaX::Java::ClassFile::BNF::ConstantDoubleInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | require MarpaX::Java::ClassFile::BNF::ConstantClassInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | require MarpaX::Java::ClassFile::BNF::ConstantStringInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | require MarpaX::Java::ClassFile::BNF::ConstantFieldrefInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | require MarpaX::Java::ClassFile::BNF::ConstantMethodrefInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | require MarpaX::Java::ClassFile::BNF::ConstantInterfaceMethodrefInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | require MarpaX::Java::ClassFile::BNF::ConstantNameAndTypeInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | require MarpaX::Java::ClassFile::BNF::ConstantMethodHandleInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | require MarpaX::Java::ClassFile::BNF::ConstantMethodTypeInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | require MarpaX::Java::ClassFile::BNF::ConstantInvokeDynamicInfo; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | use constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 1 | CONSTANT_Utf8 => 1, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | CONSTANT_Integer => 3, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | CONSTANT_Float => 4, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | CONSTANT_Long => 5, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | CONSTANT_Double => 6, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | CONSTANT_Class => 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | CONSTANT_String => 8, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | CONSTANT_Fieldref => 9, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | CONSTANT_Methodref => 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | CONSTANT_InterfaceMethodref => 11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | CONSTANT_NameAndType => 12, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | CONSTANT_MethodHandle => 15, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | CONSTANT_MethodType => 16, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | CONSTANT_InvokeDynamic => 18 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 1 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | my $_data = ${ __PACKAGE__->section_data('bnf') }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | # -------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | # What role MarpaX::Java::ClassFile::Common requires | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | # -------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub grammar { $_grammar } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
grammar: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | sub callbacks { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | "'exhausted" => sub { $_[0]->exhausted }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | 'cpInfo$' => sub { $_[0]->inc_nbDone }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | '^U1' => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | my $tag = $_[0]->pauseU1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=18 SCAR=58.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | # Inject a fake entry at position 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | ▶ | $_[0]->lexeme_read_managed(0, 1) if (! $_[0]->nbDone); # Last argument means ignore events => no increase on nbDone | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | if ($tag == CONSTANT_Utf8) { $_[0]->inner('ConstantUtf8Info') } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 14 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | elsif ($tag == CONSTANT_Integer) { $_[0]->inner('ConstantIntegerInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | elsif ($tag == CONSTANT_Float) { $_[0]->inner('ConstantFloatInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | elsif ($tag == CONSTANT_Long) { $_[0]->inner('ConstantLongInfo'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # Inject an unusable entry if this is not the last one | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | $_[0]->lexeme_read_managed if ($_[0]->nbDone < $_[0]->size) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | elsif ($tag == CONSTANT_Double) { $_[0]->inner('ConstantDoubleInfo'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | # Inject an unusable entry if this is not the last one | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | $_[0]->lexeme_read_managed if ($_[0]->nbDone < $_[0]->size) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | elsif ($tag == CONSTANT_Class) { $_[0]->inner('ConstantClassInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | elsif ($tag == CONSTANT_String) { $_[0]->inner('ConstantStringInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | elsif ($tag == CONSTANT_Fieldref) { $_[0]->inner('ConstantFieldrefInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | elsif ($tag == CONSTANT_Methodref) { $_[0]->inner('ConstantMethodrefInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | elsif ($tag == CONSTANT_InterfaceMethodref) { $_[0]->inner('ConstantInterfaceMethodrefInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | elsif ($tag == CONSTANT_NameAndType) { $_[0]->inner('ConstantNameAndTypeInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | elsif ($tag == CONSTANT_MethodHandle) { $_[0]->inner('ConstantMethodHandleInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | elsif ($tag == CONSTANT_MethodType) { $_[0]->inner('ConstantMethodTypeInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | elsif ($tag == CONSTANT_InvokeDynamic) { $_[0]->inner('ConstantInvokeDynamicInfo') } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | else { $_[0]->fatalf('Unmanaged constant pool entry, tag=%d', $tag) } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
callbacks: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | with qw/MarpaX::Java::ClassFile::Role::Parser::InnerGrammar/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | =pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | MarpaX::Java::ClassFile::BNF::ConstantPoolArray - Parsing an array of constant pool | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | version 0.008 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | Jean-Damien Durand <jeandamiendurand@free.fr> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | This software is copyright (c) 2016 by Jean-Damien Durand. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | __DATA__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | __[ bnf ]__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | :default ::= action => [values] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | :lexeme ~ <U1> pause => before event => '^U1' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | event 'cpInfo$' = completed cpInfo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | cpInfoArray ::= cpInfo* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | cpInfo ::= U1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | | MANAGED action => ::first | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||