| 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::LineNumberTableAttribute; | ||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | # ABSTRACT: Parsing of a LineNumberTable_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::LineNumberTableAttribute; | ||
| 20 | require MarpaX::Java::ClassFile::BNF::LineNumberArray; | ||
| 21 | |||
| 22 | my $_data = ${ __PACKAGE__->section_data('bnf') }; | ||
| 23 | my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } ); | ||
| 24 | |||
| 25 | # -------------------------------------------------------- | ||
| 26 | # What role MarpaX::Java::ClassFile::Role::Parser requires | ||
| 27 | # -------------------------------------------------------- | ||
| 28 | 0 | ▶ | sub grammar { $_grammar } |
|
Subroutine
grammar: not called CC=1 SCAR=6.9
| |||
| 29 | sub callbacks { return { | ||
| 30 | 0 | ▶ | "'exhausted" => sub { $_[0]->exhausted }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 31 | 0 | ▶ | 'line_number_table_length$' => sub { $_[0]->inner('LineNumberArray', size => $_[0]->literalU2('line_number_table_length')) } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 32 | } | ||
| 33 | 0 | ▶ | } |
|
Subroutine
callbacks: not called CC=1 SCAR=6.9
| |||
| 34 | |||
| 35 | # --------------- | ||
| 36 | # Grammar actions | ||
| 37 | # --------------- | ||
| 38 | sub _LineNumberTable_attribute { | ||
| 39 | # my ($self, $attribute_name_index, $attribute_length, $line_number_table_length, $line_number_table) = @_; | ||
| 40 | |||
| 41 | 0 | ▶ | MarpaX::Java::ClassFile::Struct::LineNumberTableAttribute->new( |
|
Subroutine
_LineNumberTable_attribute: not called CC=1 SCAR=6.9
| |||
| 42 | _constant_pool => $_[0]->constant_pool, | ||
| 43 | attribute_name_index => $_[1], | ||
| 44 | attribute_length => $_[2], | ||
| 45 | line_number_table_length => $_[3], | ||
| 46 | line_number_table => $_[4] | ||
| 47 | ) | ||
| 48 | } | ||
| 49 | |||
| 50 | with 'MarpaX::Java::ClassFile::Role::Parser'; | ||
| 51 | |||
| 52 | 1; | ||
| 53 | |||
| 54 | =pod | ||
| 55 | |||
| 56 | =encoding UTF-8 | ||
| 57 | |||
| 58 | =head1 NAME | ||
| 59 | |||
| 60 | MarpaX::Java::ClassFile::BNF::LineNumberTableAttribute - Parsing of a LineNumberTable_attribute | ||
| 61 | |||
| 62 | =head1 VERSION | ||
| 63 | |||
| 64 | version 0.008 | ||
| 65 | |||
| 66 | =head1 AUTHOR | ||
| 67 | |||
| 68 | Jean-Damien Durand <jeandamiendurand@free.fr> | ||
| 69 | |||
| 70 | =head1 COPYRIGHT AND LICENSE | ||
| 71 | |||
| 72 | This software is copyright (c) 2016 by Jean-Damien Durand. | ||
| 73 | |||
| 74 | This is free software; you can redistribute it and/or modify it under | ||
| 75 | the same terms as the Perl 5 programming language system itself. | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | __DATA__ | ||
| 80 | __[ bnf ]__ | ||
| 81 | event 'line_number_table_length$' = completed line_number_table_length | ||
| 82 | |||
| 83 | LineNumberTable_attribute ::= attribute_name_index attribute_length line_number_table_length line_number_table action => _LineNumberTable_attribute | ||
| 84 | attribute_name_index ::= U2 action => u2 | ||
| 85 | attribute_length ::= U4 action => u4 | ||
| 86 | line_number_table_length ::= U2 action => u2 | ||
| 87 | line_number_table ::= MANAGED action => ::first | ||