Next: , Previous: , Up: Ordering methods   [Contents][Index]


22.5 Accessors

Accessor function: int marpa_o_ambiguity_metric (Marpa_Order o)

On success, returns an ambiguity metric. If the parse is unambiguous, the metric is 1. If the parse is ambiguous, the metric is 2 or greater, and is otherwise unspecified. See Better defined ambiguity metric.

If “high rank only” is in effect, this ambiguity metric may differ from that returned by marpa_b_ambiguity_metric(). In particular, a “high rank only” ordering may be unambiguous even if its base bocage is ambiguous. But note also, because multiple parses choices may have the same rank, it is quite possible for a “high rank only” ordering to be ambiguous.

If the ordering is not already frozen, it will be frozen on return from marpa_o_ambiguity_metric(). Note that, despite this, we classify marpa_o_ambiguity_metric() as an “accessor”. Our classification of methods into accessors, mutators, etc. is for the purpose of specifying diagnostic behaviors. When diagnostic behaviors proscribe the use of mutators on a ordering, they treat the orderings as if they were frozen, so that, from the point of view of the diagnostic behaviors, the “freezing” of an ordering does not change its state.

Return value: On success, the ambiguity metric, which is non-negative. On hard failure, -2.

Accessor function: int marpa_o_is_null (Marpa_Order o)

Return value: On success: A number greater than or equal to 1 if the ordering is for a null parse; otherwise, 0. On hard failure, -2.