The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Parse::Marpa::Doc::To_Do - Marpa's To Do List

DESCRIPTION

Overview

This document contains the to do list, and the documentation of features which are not ready for prime time. A feature, a method or an option with a description here remains undocumented in the sense the word is used in the rest of the Marpa documents.

Priorities Cannot Be Set in MDL for Terminals

Priorities cannot be set in MDL for terminals. Fix this before going beta.

Workaround: Add extra rules with the terminals you want to prioritize on their right hand side, and assign priorities to the rules.

A More Exhaustive Test Suite

Testing has been intensive, but not exhaustive. The parse engine has been very well exercised, but many combinations of options and features have yet to be tried. To get an idea for what's been well tested, look in the t, or test, directory of the distribution. Any feature not tested there can be assumed to have been only lightly exercized.

Other things to do

  • Finalize semantics later, when evaluator is created.

  • Allow multiple evaluators for each recognizer, or at least create a method to safe deep copy recognizers.

  • If recognizer did not recognize the input, don't allow evaluator to be created.

  • Add {} and [] syntax to MDL production statements.

  • Ensure Parse::Marpa::Internal::This::grammar set wherever appropriate.

  • Test right and left evaluation in rules

  • Test proper and perl5 separation

  • Speed-up for pre-computing lexables. Grammar::LEXABLES, etc.

  • Test (or remove?) lexing suffixes.

  • Allow alternation?

  • Add to test set

       - basic test for all branches of counted rules: matrix is
         keep/no-keep, separated yes/no, right/left,
         0-1, 1-1, 0-2, 0-5, 1-2, 1-5, 0-*, 1-*, 2-*, 5-*

UNDER CONSTRUCTION

These are fragments of documentation which, usually along with the features described, are untested, broken, experimental or unfinished. Presence of a description here does not make a feature, method or option, documented in the sense the term is used in the other Marpa documents.

Marpa "No Values"

Nodes in Marpa may have no value. Right now offline mode is the only one; online mode is not documented; and special options to create evaluators of derivation with user specified spans in the earleme stream and user specified top symbols are undocumented or do not exist. This means that Marpa "no values" will not be encountered by the user.

Once the user can attempt to evaluate subparses, he may encounter nodes for which Marpa has not calculated a value. A Marpa "no value" is not a Perl 5 undefined. A Perl 5 undefined is a legitimate value. A Marpa "no value" means that no value calculation was done for that node.

Parse::Marpa::Recognizer::find_complete_rule

     my ($end_earleme, $symbol_names) = $recce->find_complete_rule();

The find_complete_rule method was an experiment, and will be replaced. It takes 3 arguments: a first earleme, a top symbol and an maximum earleme. All are optional. If the first earleme is not specified, it defaults to earleme 0. If the maximum earleme is not specified, its default wll be the default parse end earleme. The top symbol, if specified, must be the plumbing name of the symbol.

This description should be considered an very advanced Marpa topic. It will refer to Marpa internals, which are described in their own document. The internals document, for its part, is intended to be read after all the other Marpa documents.

The maximum earleme must be at or before the default parse end earleme. If you specify an maximum earleme argument greater than the default parse end earleme, it is ignored and the default parse end earleme is used as the maximum earleme.

find_complete_rule looks for derivations of completed rules. (Completed rules whose right hand side has been completely matched.) Only derivations which begin at the first earleme are considered.

find_complete_rule looks first for any derivations which end at the maximum earleme. If it finds none, it looks for shorter and shorter derivations until the last earleme of the derivation is the same as the first earleme and find_complete_rule is looking for a null derivation.

The derivations that find_complete_rule finds are always for completed rules. Complete derivations from any symbol are considered, unless a top symbol was specified as an argument. In that case only derivations from the specified top symbol are considered.

On failure to find a rule matching the criteria, a zero length array is returned. On success, the return value is an array of two elements. The first element of the array is the last earleme of the derivations being reported. The second element is a pointer to an array of symbol names which are the top symbols of derivations which start with the first earleme and which end with the reported last earleme. The symbol names will be their plumbing names.

Multiple top symbols may be returned, because several different rules may have been completed in the span from first earleme to last earleme, and some of these rules may have different left hand sides. If a top symbol argument was specified as an argument, it will be one of the top symbols in the reported derivations.

In the case where no top symbol is specified, find_complete_rule reports derivations from the first Earley item which matches based on the first and last earlemes, and will ignore Earley items after the first one. (See the internals for an explanation of what an Earley item is.) The ignored Earley items may contain derivations for the same span as the reported derivations, but their top symbols won't be reported in the return value's list. This can be considered a misfeature if you're a kind person, and a bug if you are not. Either way, calls of the find_complete_rule method which do not specify a top symbol are probably useless.

This problem is one of several reasons that find_complete_rule is probably going to be replaced. find_complete_rule was an experiment in methods for improved diagnostics, online mode, and advanced wizardry with grammars. The replacement method or methods should, given a last earleme or a range of last earlemes, be able to return all completed and expected symbols. Information about their start and last earleme should be available with the completed symbols. For the expected symbols, the earleme at which they were expected should given.

SUPPORT

See the support section in the main module.

AUTHOR

Jeffrey Kegler

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 itself.