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

NAME

Parse::RandGen::Grammar - Module for defining a language/protocol grammar

DESCRIPTION

The purpose of this module is to build a grammar description that can then be used to build:

(1) a parser using Parse::RecDescent

(2) a stimulus generator that creates valid (and interesting invalid) tests of the grammar.

Be aware of the greediness of the underlying parsing mechanism (RecDescent). See Parse::RandGen::Production for examples on how greediness can affect errors in grammars.

METHODS

new

Creates a new grammar. The grammar name is the only required argument.

name

Return the name of the grammar.

rule

Access an existing Rule object by name. Returns undef if the Rule is not found.

defineRule

Define a Rule if not already defined and return a reference to the Rule.

dump

Returns a dump of the Grammar object in Parse::RecDescent grammar format.

SEE ALSO

Parse::RandGen::Rule and Parse::RandGen::Production

AUTHORS

Jeff Dutton