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.

Reply via email to