The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

bnf2graph.pl - Convert a Marpa grammar into a image using GraphViz2.

SYNOPSIS

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.

OPTIONS

o -driver aGraphvizDriverName

The name of the Graphviz program to provide to GraphViz2.

Default: 'dot'.

o -format imageFormat

Specify the type of image to be created.

Default: 'svg'.

o -help

Print help and exit.

o -legend Boolean

Add a legend (1) to the graph, or omit it (0).

Default: 0 (no legend).

o -logger aLog::HandlerObject

By default, an object is created which prints to STDOUT.

Set this to '' to stop logging.

Default: undef.

o -marpa_bnf_file aMarpaSLIF-DSLFileName

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: ''.

o -maxlevel logOption1

This option affects Log::Handler.

See the Log::handler docs.

Default: 'info'.

o -minlevel logOption2

This option affects Log::Handler.

See the Log::handler docs.

Default: 'error'.

No lower levels are used.

o -output_file anImageFileName

Specify the name of a file for the driver to write.

If '', the file is not written.

Default: ''.

o -user_bnf_file aUserSLIF-DSLFileName

Specify the name of the file containing your Marpa::R2-style grammar.

See share/stringparser.bnf for a sample.

This option is mandatory.

Default: ''.