"lexeme default" statements now allow the "forgiving" option in the working branch. It's in the test suite and documented. I've lost track of which commit, but the change should make it into the next developer's release. -- jeffrey

On 01/09/2014 09:22 AM, Ruslan Shvedov wrote:
On Thu, Jan 9, 2014 at 6:01 PM, Jeffrey Kegler <[email protected] <mailto:[email protected]>> wrote:

    I'll add "forgiving" to "lexeme default", as you suggest.  I'm not
    at all sure it's a good idea, but the UNIX/Perl tradition is that
    you give the user the tools and let them decide. -- jeffrey

Great, thanks.

P.S. I've to admit that I can't see the use case yet, but I (hopefully correct) read above that "longest acceptable tokens" behavior, a motivation of amon's IRIF, is enabled by marking all tokens forgiving and that will be done safely at a low cost once "cheap forgiving" is implemented, hence the suggestion.


    On 01/08/2014 10:37 PM, Ruslan Shvedov wrote:
    Very useful feature, thanks a lot.

    Can /forgiving/ adverb be added to /lexeme default/ so that an
    application be able to mark all lexemes as (un)forgiving and then
    set individual lexemes as forgiving or unforgiving as needed?

    P.S. 2.079_007
    <https://metacpan.org/release/JKEGL/Marpa-R2-2.079_007> built,
    installed, and tested just fine for me on cygwin and windows with
    5.14.2 and 5.18.1.



    On Wed, Jan 8, 2014 at 9:25 AM, Jeffrey Kegler
    <[email protected]
    <mailto:[email protected]>> wrote:

        I've uploaded a new developer's version, 2.079_007
        <https://metacpan.org/release/JKEGL/Marpa-R2-2.079_007>, this
        time with some clearly visible added value: forgiving
        tokens.  Forgiving tokens are tokens that are declared to be
        exceptions from the usually rigid longest-tokens-match
        discipline.  The usual (and traditional) LTM discipline
        insists that the token is the longest match at any point.  If
        the LTM token is not acceptable to the grammar, then the
        parse fails.

        A forgiving token declares itself to be an exception to the
        LTM discipline.  If a forgiving token is the longest match,
        but it is rejected by G1, the rejection will be "forgiven"
        and the SLIF will look for shorter tokens that it can accept.

        I've uploaded as Github gists two examples that previously
        were difficult lexing situations, redone using forgiving
        tokens: one is Ruslan Zakirov's
        <https://gist.github.com/jeffreykegler/8312534> and the other
        is Peter Stuifzand's
        <https://gist.github.com/jeffreykegler/8312524>. I have not
        documented the forgiving adverb yet, but the syntax is easy
        enough to figure out from the two examples.
-- You received this message because you are subscribed to the
        Google Groups "marpa parser" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to
        [email protected]
        <mailto:marpa-parser%[email protected]>.
        For more options, visit https://groups.google.com/groups/opt_out.


-- You received this message because you are subscribed to the
    Google Groups "marpa parser" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected]
    <mailto:[email protected]>.
    For more options, visit https://groups.google.com/groups/opt_out.

-- You received this message because you are subscribed to the Google
    Groups "marpa parser" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected]
    <mailto:marpa-parser%[email protected]>.
    For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "marpa 
parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to