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

18.2 Methods

Function: Marpa_Event_Type marpa_g_event (Marpa_Grammar g, Marpa_Event* event, int ix)

On success, the type of the ix’th event is returned and the data for the ix’th event is placed in the location pointed to by event.

Event indexes are in sequence. Valid events will be in the range from 0 to n, where n is one less than the event count. The event count can be queried using the marpa_g_event_count() method.

Return value: On success, the type of event ix. If there is no ix’th event, if ix is negative, or on other failure, -2. On failure, the locations pointed to by event are not changed.

Function: int marpa_g_event_count ( Marpa_Grammar g )

Return value: On success, the number of events. On failure, -2.

Macro: int marpa_g_event_value (Marpa_Event* event)

This macro provides access to the “value” of the event. The semantics of the value varies according to the type of the event, and is described in the section on event codes. See Event codes.