|GraphViz::Parse::Yapp(3)||User Contributed Perl Documentation||GraphViz::Parse::Yapp(3)|
use GraphViz::Parse::Yapp; # Pass in a file generated via yapp -v my $g = GraphViz::Parse::Yapp->new('Yapp.output'); print $g->as_png;
Rules are represented as nodes, which have their name on the left of the node and their productions on the right of the node. The subrules present in the productions are represented by edges to the subrule nodes.
Thus, every node (rule) should be connected to the graph - otherwise a rule is not part of the grammar.
This uses the GraphViz module to draw the graph. Thanks to Damian Conway for the original idea.
# Pass in a file generated via yapp -v my $graph = GraphViz::Parse::Yapp->new('Yapp.output'); print $g->as_png;
# Print out a PNG-format file print $g->as_png; # Print out a PostScript-format file print $g->as_ps;
This module is free software; you can redistribute it or modify it under the Perl License, a copy of which is available at http://dev.perl.org/licenses/.