manakai

Whatpm::SWML::Parser

SWML Parser

SYNOPSIS

  use Whatpm::SWML::Parser;
  my $parser = Whatpm::SWML::Parser->new;
  $parser->parse_char_string ($string => $doc, $onerror);

DESCRIPTION

The Whatpm::SWML::Parser module is an SWML parser. SWML is a markup language used in SuikaWiki. The parser converts a text representing an SWML document into a DOM tree.

METHODS

my $parser = Whatpm::SWML::Parser->new

Creates an instance of the SWML parser.

$parser->parse_char_string ($string, $doc, $onerror)

Parses a character string and constructs a DOM tree.

The first argument, $string, is a character string to be parsed.

The second argument, $doc is a DOM Document object (an instance of Message::DOM::Document class) to which the parsed result is constructed. Any existing child node is removed before parsing.

The third argument, $onerror, is a code reference which is invoked whenever a parse error is detected or a warning is emitted during the parsing process. The code reference would receive a set of arguments which describe the kind and situation of the error or warnings. It shares the same reporting format as the $onerror code reference used in Whatpm::HTML and other modules.

SEE ALSO

SuikaWiki Markup Language (SWML) <https://suika.suikawiki.org/www/markup/suikawiki/spec/swml-work>.

Message::DOM::DOMImplementation

LICENSE

Copyright 2008-2011 Wakaba <wakaba@suikawiki.org>.

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