NAME

Parse::Marpa::MDL -- Utility Methods for MDL

DESCRIPTION

If you are looking for the document that describes the Marpa Demonstration Language, this is not it -- you want Parse::Marpa::Doc::MDL. This document describes some utility routines that come with Parse::Marpa::MDL.

These routines handle the conversion of MDL symbol names to plumbing symbol names. MDL symbol names behave differently from the plumbing names. MDL symbol names are allowed to vary in capitalization and separation while, in the plumbing, every slight variation of capitalization or separation produces a new, unique name.

MDL symbol names have a canonical form. MDL uses the canonical form of its symbol names as their plumbing names. Canonical MDL names are all lowercase, with hyphens for separation. For example, the MDL symbol whose acceptable variants include My symbol and MY_SYMBOL is, in canonical form, my-symbol. Users should always use the Parse::Marpa::MDL::canonical_name method to convert from the MDL symbol name to its canonical form.

METHODS

canonical_name

$g->set( {
    start => Parse::Marpa::MDL::canonical_symbol_name('Document')
} );

This static method takes as its one argument an MDL symbol name. It returns the canonical MDL name, which is also the symbol's plumbing name.

get_symbol

my $op = Parse::Marpa::MDL::get_symbol( $grammar, 'Op' );

This static method takes a Marpa grammar object as its first argument and an MDL symbol name as its second. It returns the symbol's "cookie". Symbol cookies are needed to use the Parse::Marpa::Recognizer::earleme method.

SUPPORT

See the support section in the main module.

AUTHOR

Jeffrey Kegler

LICENSE AND COPYRIGHT

Copyright 2007 - 2008 Jeffrey Kegler

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0.