| 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::SignatureAttribute; | ||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # ABSTRACT: Parsing of a Signature_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::SignatureAttribute; | ||
| 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 | } | ||
| 31 | 0 | ▶ | } |
|
Subroutine
callbacks: not called CC=1 SCAR=6.9
| |||
| 32 | |||
| 33 | # --------------- | ||
| 34 | # Grammar actions | ||
| 35 | # --------------- | ||
| 36 | sub _Signature_attribute { | ||
| 37 | # my ($self, $attribute_name_index, $attribute_length, $signature_index) = @_; | ||
| 38 | |||
| 39 | 0 | ▶ | MarpaX::Java::ClassFile::Struct::SignatureAttribute->new( |
|
Subroutine
_Signature_attribute: not called CC=1 SCAR=6.9
| |||
| 40 | _constant_pool => $_[0]->constant_pool, | ||
| 41 | attribute_name_index => $_[1], | ||
| 42 | attribute_length => $_[2], | ||
| 43 | signature_index => $_[3] | ||
| 44 | ) | ||
| 45 | } | ||
| 46 | |||
| 47 | with 'MarpaX::Java::ClassFile::Role::Parser'; | ||
| 48 | |||
| 49 | 1; | ||
| 50 | |||
| 51 | =pod | ||
| 52 | |||
| 53 | =encoding UTF-8 | ||
| 54 | |||
| 55 | =head1 NAME | ||
| 56 | |||
| 57 | MarpaX::Java::ClassFile::BNF::SignatureAttribute - Parsing of a Signature_attribute | ||
| 58 | |||
| 59 | =head1 VERSION | ||
| 60 | |||
| 61 | version 0.008 | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Jean-Damien Durand <jeandamiendurand@free.fr> | ||
| 66 | |||
| 67 | =head1 COPYRIGHT AND LICENSE | ||
| 68 | |||
| 69 | This software is copyright (c) 2016 by Jean-Damien Durand. | ||
| 70 | |||
| 71 | This is free software; you can redistribute it and/or modify it under | ||
| 72 | the same terms as the Perl 5 programming language system itself. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | __DATA__ | ||
| 77 | __[ bnf ]__ | ||
| 78 | Signature_attribute ::= | ||
| 79 | attribute_name_index | ||
| 80 | attribute_length | ||
| 81 | signature_index | ||
| 82 | action => _Signature_attribute | ||
| 83 | |||
| 84 | attribute_name_index ::= U2 action => u2 | ||
| 85 | attribute_length ::= U4 action => u4 | ||
| 86 | signature_index ::= U2 action => u2 | ||
| 87 | |||
| 88 | __[ signature_common_bnf ]__ | ||
| 89 | Identifier ::= [.;\[/<>:]+ | ||
| 90 | JavaTypeSignature ::= ReferenceTypeSignature | ||
| 91 | | BaseType | ||
| 92 | BaseType ::= [BCDFIJSZ] | ||
| 93 | ReferenceTypeSignature ::= ClassTypeSignature | ||
| 94 | | TypeVariableSignature | ||
| 95 | | ArrayTypeSignature | ||
| 96 | ClassTypeSignature ::= 'L' PackageSpecifierMaybe SimpleClassTypeSignature ClassTypeSignatureSuffixAny ';' | ||
| 97 | PackageSpecifierUnit ::= Identifier '/' | ||
| 98 | PackageSpecifier ::= PackageSpecifierUnit+ | ||
| 99 | SimpleClassTypeSignature ::= Identifier TypeArgumentsMaybe | ||
| 100 | TypeArguments ::= '<' TypeArgument TypeArgumentAny '>' | ||
| 101 | TypeArgument ::= WildcardIndicatorMaybe ReferenceTypeSignature | ||
| 102 | | '*' | ||
| 103 | WildcardIndicator ::= [+-] | ||
| 104 | ClassTypeSignatureSuffix ::= '.' SimpleClassTypeSignature | ||
| 105 | TypeVariableSignature ::= 'T' Identifier ';' | ||
| 106 | ArrayTypeSignature ::= '[' JavaTypeSignature | ||
| 107 | |||
| 108 | PackageSpecifierMaybe ::= PackageSpecifier | ||
| 109 | PackageSpecifierMaybe ::= | ||
| 110 | ClassTypeSignatureSuffixAny ::= ClassTypeSignatureSuffix* | ||
| 111 | TypeArgumentsMaybe ::= TypeArguments | ||
| 112 | TypeArgumentsMaybe ::= | ||
| 113 | TypeArgumentAny ::= TypeArgument* | ||
| 114 | WildcardIndicatorMaybe ::= WildcardIndicator | ||
| 115 | WildcardIndicatorMaybe ::= | ||
| 116 | |||
| 117 | TypeParameters ::= '<' TypeParameter TypeParameterAny '>' | ||
| 118 | TypeParameter ::= Identifier ClassBound InterfaceBoundAny | ||
| 119 | ClassBound ::= ':' ReferenceTypeSignatureMaybe | ||
| 120 | InterfaceBound ::= ':' ReferenceTypeSignature | ||
| 121 | SuperclassSignature ::= ClassTypeSignature | ||
| 122 | SuperinterfaceSignature ::= ClassTypeSignature | ||
| 123 | |||
| 124 | TypeParametersMaybe ::= TypeParameters | ||
| 125 | TypeParametersMaybe ::= | ||
| 126 | TypeParameterAny ::= TypeParameter* | ||
| 127 | ReferenceTypeSignatureMaybe ::= ReferenceTypeSignature | ||
| 128 | ReferenceTypeSignatureMaybe ::= | ||
| 129 | SuperinterfaceSignatureAny ::= SuperinterfaceSignature* | ||
| 130 | InterfaceBoundAny ::= InterfaceBound* | ||
| 131 | |||
| 132 | Result ::= JavaTypeSignature | ||
| 133 | | VoidDescriptor | ||
| 134 | ThrowsSignature ::= '^' ClassTypeSignature | ||
| 135 | | '^' TypeVariableSignature | ||
| 136 | VoidDescriptor ::= 'V' | ||
| 137 | |||
| 138 | JavaTypeSignatureAny ::= JavaTypeSignature* | ||
| 139 | ThrowsSignatureAny ::= ThrowsSignature* | ||
| 140 | |||
| 141 | __[ signature_class_bnf ]__ | ||
| 142 | inaccessible is ok by default | ||
| 143 | ClassSignature ::= TypeParametersMaybe SuperclassSignature SuperinterfaceSignatureAny | ||
| 144 | |||
| 145 | __[ signature_method_bnf ]__ | ||
| 146 | inaccessible is ok by default | ||
| 147 | MethodSignature ::= TypeParametersMaybe '(' JavaTypeSignatureAny ')' Result ThrowsSignatureAny | ||
| 148 | |||
| 149 | __[ signature_field_bnf ]__ | ||
| 150 | inaccessible is ok by default | ||
| 151 | FieldSignature ::= ReferenceTypeSignature | ||