Next: Basic event accessors, Previous: Events, Up: Events [Contents][Index]
Events are generated by the
marpa_g_precompute()
,
marpa_r_earleme_complete()
,
and
marpa_r_start_input()
methods.
The methods are called event-active.
Event-active methods always clear all previous events,
so that after an event-active method the only events
available
will be those generated by that method.
Some Libmarpa methods clear the event queue. The user is expected to query events immediately after the method that generated them. We note especially that events are kept in the base grammar, so that multiple recognizers using the same base grammar overwrite each other’s events.
To find out how many events were generated by the last
event-active method,
use the
marpa_g_event_count()
method.
To query a specific event,
use the
marpa_g_event()
and
marpa_g_event_value()
methods.
In reading this chapter, we will need to be aware that it contains a mixture of grammar and recognizer methods.