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


Parse-RandGen documentation  | view source Contained in the Parse-RandGen distribution.

Index


NAME

Top

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

DESCRIPTION

Top

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

Top

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

Top

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

AUTHORS

Top

Jeff Dutton


Parse-RandGen documentation  | view source Contained in the Parse-RandGen distribution.