=head1 NAME Regexp::Visualize::Simple - Regular expression visualization using Graph::Easy =head1 SYNOPSIS use Regexp::Visualize::Simple $parser = ... Regexp::Parser object ...; my $v = Regexp::Visualize::Simple->new; $v->push_regexp_node ($parser->root); while ($v->has_regexp_node) { my ($g, $index) = $v->next_graph; # $g is a Graph::Easy object print "$index:\n"; print $g->as_svg; } =head1 DESCRIPTION The C generates a series of C objects, which as a whole represents a regular expression parsed by C. Generated graphs can be exported to arbitrary image format, such as PNG and SVG, supported by C. As an input any regular expression dialect supported by C or its subclasses can be used. It is sometimes impossible or undesired to represents a regular expression as one complete graph. For example, if a regular expression containing C<(?!...)> segment were represented as a graph, it would be difficult to understand. Therefore, the result visualization might sometimes be split into multiple graphs. This is why this module defines iterator methods C and C. =head1 METHODS =over 4 =item I<$v> = Regexp::Visualize::Simple->new; Creates a new instance of the regular expression visualizer. =item I<$v>->push_regexp_node (I<$node>); Push a regular expression node that represents a subgraph to be visualized. =item I<$node> = I<$v>->shift_regexp_node (); Shifts a regular expression node from the queue hold by the visualizer object, if any, or returns C. =item I<$boolean> = I<$v>->has_regexp_node (); Returns whether the visualizer object contains one or more nodes in the queue of regular expression nodes to be graphized. =item (I<$g>, I<$index>) = I<$v>->next_graph (); Generates a graph from the first node in the queue o the regular expression node hold by the visualizer object. If there is no node to be graphized in the queue, then a list of two C values is returned. Otherwise, a list of the C object generated from the regular expression node and the index number of the graph is returned. The first graph generated by the visualizer object has the index of zero (C<0>), and the next graph has one (C<1>). =back =head1 DEPENDENCY This module requires Perl 5.10.0 or later. This module depends on the C module. This module assumes the input regular expression nodes implementing C-compatible interface. Such modules include C and C. =head1 SEE ALSO The latest version of this module is available at L. Regular expression visualizer L. This is a Web interface for this module. Its source code is available at L. L - A subclass of C supporting Perl 5.8 regular expression syntax. L - A subclass of C supporting JavaScript regular expression syntax. These two modules above are available at L. L. This module is available from CPAN. =head1 DEVELOPMENT CVS log: L. Bug tracking system: L. =head2 TODO Localization / customization support. =head1 AUTHOR Wakaba . =head1 LICENSE Copyright 2008-2009 Wakaba . This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut # $Date: 2009/01/13 14:15:47 $