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


19.3 Keeping the reference count of a recognizer

Mutator function: Marpa_Recognizer marpa_r_ref (Marpa_Recognizer r)

Increases the reference count by 1. This method is not needed by most applications.

Return value: On success, the recognizer object, r, which is never NULL. On hard failure, NULL.

Destructor function: void marpa_r_unref (Marpa_Recognizer r)

Decreases the reference count by 1, destroying r once the reference count reaches zero. When r is destroyed, the reference count of its base grammar is decreased by one. If this takes the reference count of the base grammar to zero, the base grammar is also destroyed.