Previous: , Up: Ordering methods   [Contents]


15.5 Non-default ordering

Function: int marpa_o_high_rank_only_set ( Marpa_Order o, int flag)
Function: int marpa_o_high_rank_only ( Marpa_Order o)

These methods, respectively, set and query the “high rank only” flag of ordering o. A flag of 1 indicates that, when ranking, all choices should be discarded except those of the highest rank. A flag of 0 indicates that no choices should be discarded on the basis of their rank.

A value of 1 is the default. The value of the “high rank only” flag has no effect unless ranking has been turned on using the marpa_o_rank() method.

Return value: On success, the value of the “high rank only” flag after the call. On failure, -2.

Function: int marpa_o_rank ( Marpa_Order o )

By default, the ordering of parse trees is arbitrary. This method causes the ordering to be ranked according to the ranks of symbols and rules, the “null ranks high” flags of the rules, and the “high rank only” flag of the ordering. Once this method returns, the ordering is frozen.

Return value: On success, a non-negative value. On failure, -2.