| 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::BootstrapMethodArray; | ||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # ABSTRACT: Parsing of an array of bootstrap method | ||
| 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::BootstrapMethod; | ||
| 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 | 0 | ▶ | 'bootstrap_method$' => sub { $_[0]->inc_nbDone }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 31 | 'num_bootstrap_arguments$' => sub { | ||
| 32 | 0 | ▶ | my $num_bootstrap_arguments = $_[0]->literalU2('num_bootstrap_arguments'); |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 33 | 0 | map { $_[0]->lexeme_read_u2(1) } (1..$num_bootstrap_arguments); # Ignore events | |
| 34 | 0 | $_[0]->lexeme_read_managed(0) # Will trigger completion event | |
| 35 | } | ||
| 36 | } | ||
| 37 | 0 | ▶ | } |
|
Subroutine
callbacks: not called CC=1 SCAR=6.9
| |||
| 38 | |||
| 39 | # --------------- | ||
| 40 | # Grammar actions | ||
| 41 | # --------------- | ||
| 42 | sub _BootstrapMethod { | ||
| 43 | # my ($self, $bootstrap_method_ref, $num_bootstrap_arguments, $bootstrap_arguments) = @_; | ||
| 44 | |||
| 45 | 0 | ▶ | MarpaX::Java::ClassFile::Struct::BootstrapMethod->new( |
|
Subroutine
_BootstrapMethod: not called CC=1 SCAR=6.9
| |||
| 46 | _constant_pool => $_[0]->constant_pool, | ||
| 47 | bootstrap_method_ref => $_[1], | ||
| 48 | num_bootstrap_arguments => $_[2], | ||
| 49 | bootstrap_arguments => $_[3] | ||
| 50 | ) | ||
| 51 | } | ||
| 52 | |||
| 53 | with 'MarpaX::Java::ClassFile::Role::Parser::InnerGrammar'; | ||
| 54 | |||
| 55 | 1; | ||
| 56 | |||
| 57 | =pod | ||
| 58 | |||
| 59 | =encoding UTF-8 | ||
| 60 | |||
| 61 | =head1 NAME | ||
| 62 | |||
| 63 | MarpaX::Java::ClassFile::BNF::BootstrapMethodArray - Parsing of an array of bootstrap method | ||
| 64 | |||
| 65 | =head1 VERSION | ||
| 66 | |||
| 67 | version 0.008 | ||
| 68 | |||
| 69 | =head1 AUTHOR | ||
| 70 | |||
| 71 | Jean-Damien Durand <jeandamiendurand@free.fr> | ||
| 72 | |||
| 73 | =head1 COPYRIGHT AND LICENSE | ||
| 74 | |||
| 75 | This software is copyright (c) 2016 by Jean-Damien Durand. | ||
| 76 | |||
| 77 | This is free software; you can redistribute it and/or modify it under | ||
| 78 | the same terms as the Perl 5 programming language system itself. | ||
| 79 | |||
| 80 | =cut | ||
| 81 | |||
| 82 | __DATA__ | ||
| 83 | __[ bnf ]__ | ||
| 84 | event 'bootstrap_method$' = completed bootstrap_method | ||
| 85 | event 'num_bootstrap_arguments$' = completed num_bootstrap_arguments | ||
| 86 | :default ::= action => [values] | ||
| 87 | BootstrapMethodArray ::= bootstrap_method* | ||
| 88 | bootstrap_method ::= bootstrap_method_ref num_bootstrap_arguments bootstrap_arguments (end) action => _BootstrapMethod | ||
| 89 | bootstrap_method_ref ::= U2 action => u2 | ||
| 90 | num_bootstrap_arguments ::= U2 action => u2 | ||
| 91 | bootstrap_arguments ::= bootstrap_argument* action => [values] | ||
| 92 | bootstrap_argument ::= U2 action => u2 | ||
| 93 | end ::= MANAGED # Used to trigger the completion event | ||