Previous: Tree reference counting, Up: Tree methods [Contents][Index]
Positions t at the next parse tree in the iteration. Tree iterators are initialized to the position before the first parse tree, so this method must be called before creating a valuator from a tree.
If a tree iterator is positioned after the last parse,
the tree is said to be “exhausted”.
A tree iterator for a bocage with no parse trees
is considered to be “exhausted” when initialized.
If the tree iterator is exhausted,
marpa_t_next()
returns -1 as a termination indicator,
and sets the error code to
MARPA_ERR_TREE_EXHAUSTED
.
Return value: On success, a non-negative value. If the tree iterator is exhausted, -1. On failure, -2.
The parse counter counts the number of parse trees traversed so far. The count includes the current iteration of the tree, so that a value of 0 indicates that the tree iterator is at its initialized position, before the first parse tree.
Return value: The number of parses traversed so far. Always succeeds.