Next: , Previous: , Up: Bocage methods   [Contents]


14.2 Creating a new bocage

Function: Marpa_Bocage marpa_b_new (Marpa_Recognizer r, Marpa_Earley_Set_ID earley_set_ID)

Creates a new bocage object, with a reference count of 1. The reference count of its parent recognizer object, r, is increased by 1. If earley_set_ID is -1, the Earley set at the current earleme is used, if there is one.

If earley_set_ID is -1 and there is no Earley set at the current earleme; or if earley_set_ID is -1 and there is no parse ending at Earley set earley_set_ID, marpa_b_new() fails and the error code is set to MARPA_ERR_NO_PARSE.

Success return value: On success, the new bocage object. On failure, NULL.