☺唐鳳☻
and 1 contributors

NAME

Pod::Stream::Parser - A simple stream based POD parser

SYNOPSIS

  use v6;
  require Pod::Stream::Parser;
  
  parse("path/to/file.pod", %event_handlers);

DESCRIPTION

This is a very simple stream based POD parser, it is modeled after SAX style parsers and is currently still in the very early stages of development.

LIMITATIONS & CAVEATS

Functionality is severaly limited right now. See the tests for more details.

FUNCTIONS

parse (Str $filename, Hash %events)

The main parse function currently takes a $filename and a Hash of %events which it uses to process each line of the file.

EVENTS

start_document

This event is fired when a '=pod' directive is reached.

end_document

This event is fired when a '=cut' directive is reached.

start_header

This event is fired once the '=head<n>' directive is reached. This does not include the text of the header, that will be processed as a interpolated string (to allow for any modifiers).

end_header

This event is fired after the '=head<n>' directive and it's accompanying text has been parsed.

start_begin

This event is fired when a '=begin' directive is reached.

end_begin

This event is fired when a '=end' directive (which is preceeded by an '=begin' directive) is reached.

start_for

This event is fired when a '=for' directive is reached.

end_for

This event is fired when a '=end' directive (which is preceeded by an '=for' directive) is reached.

start_list

This event is fired when an '=over' directive is reached.

end_list

This event is fired when a '=back' directive is reached.

start_item

This event is fired when an '=item' directive is reached, the next event fired will be any text which follows the item.

end_item

This event is fired once the last '=item' directive, followed by any text on the same line.

start_verbatim

This event is fired once a verbatim section is found.

verbatim

This event handles the entire verbatim string.

end_verbatim

This event closes a verbatim section.

start_interpolation

This event is begun when any block of characters is interpolated for modifiers.

end_interpolation

This event is fired when interpolation is complete.

start_modifier

This event is fired when a modifier is encountered.

end_modifier

This event closes a modifier.

string

This event processes raw strings.

newline

This event handles newlines in the text, it is a specialization of the 'string' event.

SEE ALSO

Any of the Perl5 POD parsers

AUTHOR

stevan little, <stevan@iinteractive.com>

COPYRIGHT

Copyright (c) 2005. Stevan Little. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html