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

NAME

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 Marpa::Doc::MDL. This document describes some utility routines that come with 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.

METHODS

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.

get_symbol

    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.

SUPPORT

See the support section in the main module.

AUTHOR

Jeffrey Kegler

LICENSE AND COPYRIGHT

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.