PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` =pod =for comment DO NOT EDIT. This Pod was generated by Swim v0.1.48. See http://github.com/ingydotnet/swim-pm#readme =encoding utf8 =head1 NAME Pegex::Receiver - Base Class for All Pegex Receivers =head1 SYNOPSIS package MyReceiver; use base 'Pegex::Receiver'; # Handle data for a specific rule sub got_somerulename { my ($self, $got) = @_; # ... process ... return $result; } # Handle data for any other rule sub gotrule { my ($self, $got) = @_; return $result; } # Pre-process sub initial { ... } # Post-process sub final { ...; return $final_result; } =head1 DESCRIPTION In Pegex, a B is the class object that a B passes captured data to when a B in a B matches a part of an B stream. A receiver provides B to turn parsed data into what the parser is intended to do. This is the base class of all Pegex receiver classes. It doesn't do much of anything, which is the correct thing to do. If you use this class as your receiver if won't do any extra work. See L for a receiver base class that will help organize your matches by default. =head2 How A Receiver Works A Pegex grammar is made up of B, B, and B. When a B matches, the parser makes array of its capture strings. When a B matches, the parser makes an array of all the submatch arrays. In this way a B forms. When a B matches, an action method is called in the receiver class. The method is passed the current B and returns what parser will consider the new parse tree. This makes for a very elegant and understandable API. =head1 API This section documents the methods that you can include in receiver subclass. =over =item C An action method for a specific, named rule. sub got_rule42 { my ($self, $got) = @_; ... return $result; } The C<$got> value that is passed in is the current value of the parse tree. What gets returned is whatever you want to new value to be. =item C The action method for a named rule that does not have a specific action method. =item C Called at the beginning of a parse operation, before the parsing begins. =item C Called at the end of a parse operation. Whatever this action returns, will be the result of the parse. =back =head2 Methods =over =item C An attribute containing the parser object that is currently running. This can be very useful to introspect what is happening, and possibly modify the grammar on the fly. (Experts only!) =item C A utility method that can turn an array of arrays into a single array. For example: $self->flatten([1, [2, [3, 4], 5], 6]); # produces [1, 2, 3, 4, 5, 6] Hashes are left unchanged. The array is modified in place, but is also the return value. =back =head1 AUTHOR Ingy döt Net =head1 COPYRIGHT AND LICENSE Copyright 2010-2020. Ingy döt Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L =cut