Marpa::MDL -- Utility Methods for MDL
If you are looking for the document that describes the Marpa Demonstration Language, this is not it -- you want Marpa::Doc::MDL. This document describes some utility routines that come with Marpa::MDL.
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 Marpa::MDL::canonical_name method to convert from the MDL symbol name to its canonical form.
My symbol
MY_SYMBOL
my-symbol
Marpa::MDL::canonical_name
$g->set( { start => 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.
my $op = 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 Marpa::Recognizer::earleme method.
Marpa::Recognizer::earleme
See the support section in the main module.
Jeffrey Kegler
Copyright 2007 - 2009 Jeffrey Kegler
This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0.
To install Marpa, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Marpa
CPAN shell
perl -MCPAN -e shell install Marpa
For more information on module installation, please visit the detailed CPAN module installation guide.