=head1 NAME
SWML::Parser - An SWML text document parser
=head1 SYNOPSIS
use SWML::Parser;
$parser = SWML::Parser->new;
$parser->onerror (sub { ... });
$parser->parse_char_string ($string => $doc);
=head1 DESCRIPTION
The C<SWML::Parser> module is an SWML text document parser. SWML is a
markup language used in SuikaWiki. The parser converts a string of
characters representing an SWML document into a DOM tree.
=head1 METHODS
Following methods are available:
=over 4
=item $parser = SWML::Parser->new
Creates a new instance of the SWML parser.
=item $parser->onerror ($code)
=item $code = $parser->onerror
Get or set the error handler. Note that this version of the SWML
parser does not report any error at all.
=item $parser->parse_char_string ($string, $doc)
Parses a character string and constructs a DOM tree.
The first argument, I<$string>, is a I<character> string to be parsed.
The second argument, I<$doc> is a C<Document> object to which the
parsed result is constructed. Any existing child node is removed
before parsing.
The C<Document> object must be an instance of DOM C<Document>
interface, implementing the manakai DOM Perl Binding specification.
L<Web::DOM::Document> is an example of such DOM implementation.
=back
=head1 DEPENDENCY
The module requires Perl 5.8 or later.
=head1 SPECIFICATION
=over 4
=item SWML
SuikaWiki Markup Language (SWML)
<https://suikawiki.github.io/spec-swml/spec/>.
=back
=head1 SEE ALSO
The SuikaWiki project <https://suikawiki.org/>.
L<Web::DOM::Document> in the perl-web-dom package
<https://github.com/manakai/perl-web-dom>.
=head1 AUTHOR
Wakaba <wakaba@suikawiki.org>.
=head1 LICENSE
Copyright 2008-2020 Wakaba <wakaba@suikawiki.org>.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut