The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

use strict;
use warnings FATAL => 'all';
use Moo;
# ABSTRACT: Parsing an array of class
our $VERSION = '0.009'; # VERSION
our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
use Data::Section -setup;
#
# require because we do not import ANYTHING from these module, just require they are loaded
#
require Marpa::R2;
my $_data = ${ __PACKAGE__->section_data('bnf') };
my $_grammar = Marpa::R2::Scanless::G->new( { source => \__PACKAGE__->bnf($_data) } );
# --------------------------------------------------
# What role MarpaX::Java::ClassFile::Common requires
# --------------------------------------------------
sub grammar { $_grammar }
sub callbacks {
return {
"'exhausted" => sub { $_[0]->exhausted },
'line_number$' => sub { $_[0]->inc_nbDone }
}
}
sub _lineNumber {
# my ($self, $start_pc, $line_number) = @_;
MarpaX::Java::ClassFile::Struct::LineNumber->new(
start_pc => $_[1],
line_number => $_[2]
)
}
1;
=pod
=encoding UTF-8
=head1 NAME
MarpaX::Java::ClassFile::BNF::LineNumberArray - Parsing an array of class
=head1 VERSION
version 0.009
=head1 AUTHOR
Jean-Damien Durand <jeandamiendurand@free.fr>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2016 by Jean-Damien Durand.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
__DATA__
__[ bnf ]__
:default ::= action => [values]
event 'line_number$' = completed line_number
lineNumberArray ::= lineNumber*
lineNumber ::= start_pc line_number action => _lineNumber
start_pc ::= U2 action => u2
line_number ::= U2 action => u2