Next: , Previous: , Up: Earlemes   [Contents]


4.1.3 The significances of the earleme variables

The current earleme tracks the advance of the recognizer through the input. Input tokens always start at the current earleme. An application can advance past the current earleme, by calling marpa_r_earleme_complete(), which increments the current earleme by 1. After initialization, marpa_r_earleme_complete() is the only way to manipulate the value of the current earleme.

The furthest earleme tracks how “far out” tokens can be found. In the standard input model, calling marpa_r_earleme_complete() after each marpa_r_alternative() call is sufficient to process all inputs, and the furthest earleme’s value can be typically be ignored. In alternative input models, if tokens have lengths greater than 1, calling marpa_r_earleme_complete() once after the last token is read may not be enough to ensure that all tokens have been processed. To ensure that all tokens have been processed, an application must advance the current earleme by calling marpa_r_earleme_complete(), until the current earleme is equal to the furthest earleme.

The lastest earleme is the earleme of the last Earley set. The latest earleme is different from the current earleme if and only if there is no Earley set at the current earleme. A different end of parsing can be specified, but by default, parsing is of the input in the range from earleme 0 to the latest earleme.