Just note that having an ambiguity metric does not mean that values() are
different.
Nevertheless, you know that I love non-ambiguous grammars -;
Le mercredi 5 novembre 2014 22:41:08 UTC+1, Ron Savage a écrit :
>
> Say I want a program to provide an option for a user to abort the run if
> an ambiguous grammar is detected.
>
> Should I test the return of just 1 of the above methods in preference to
> the other? If so, which?
>
> I'm also thinking of whether it makes sense to report something to the
> user after calling both methods, or for just call 1.
>
> Here's my preliminary code:
>
> if ($self -> recce -> ambiguity_metric > 1)
> {
> $self -> log(notice => 'Parse is ambiguous. Ambiguity metric > 1');
> }
>
> if (my $ambiguous_status = $self -> recce -> ambiguous)
> {
> $self -> log(notice => "Parse is ambiguous. Status: $ambiguous_status");
> }
>
> Obviously the 'notice' log level could become 'error', if the user wishes.
>
> Ideas?
>
>
--
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/d/optout.