bnf2graph.pl - Convert a Marpa grammar into a image using GraphViz2.
bnf2graph.pl [options]
Options: -format imageFormat -driver aGraphvizDriverName -help -legend Boolean -logger aLog::HandlerObject -marpa_bnf_file aMarpaSLIF-DSLFileName -maxlevel logOption1 -minlevel logOption2 -output_file anImageFileName -user_bnf_file aUserSLIF-DSLFileName
Exit value: 0 for success, 1 for failure. Die upon error.
The name of the Graphviz program to provide to GraphViz2.
Default: 'dot'.
Specify the type of image to be created.
Default: 'svg'.
Print help and exit.
Add a legend (1) to the graph, or omit it (0).
Default: 0 (no legend).
By default, an object is created which prints to STDOUT.
Set this to '' to stop logging.
Default: undef.
Specify the name of Marpa's own SLIF-DSL file.
This file ships with Marpa::R2, in the meta/ directory. It's name is metag.bnf.
A copy, as of Marpa::R2 V 2.066000, ships with MarpaX::Grammar::Parser.
See share/metag.bnf.
This option is mandatory.
Default: ''.
This option affects Log::Handler.
See the Log::handler docs.
Default: 'info'.
Default: 'error'.
No lower levels are used.
Specify the name of a file for the driver to write.
If '', the file is not written.
Specify the name of the file containing your Marpa::R2-style grammar.
See share/stringparser.bnf for a sample.
To install MarpaX::Grammar::GraphViz2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MarpaX::Grammar::GraphViz2
CPAN shell
perl -MCPAN -e shell install MarpaX::Grammar::GraphViz2
For more information on module installation, please visit the detailed CPAN module installation guide.