Previous: , Up: Events   [Contents]


18.3 Event codes

Macro: int MARPA_EVENT_NONE

Applications should never see this event. Event value: Undefined. Suggested message: "No event".

Macro: int MARPA_EVENT_COUNTED_NULLABLE

A nullable symbol is either the separator for, or the right hand side of, a sequence. Event value: The ID of the symbol. Suggested message: "This symbol is a counted nullable".

Macro: int MARPA_EVENT_EARLEY_ITEM_THRESHOLD

This event indicates the current Earley item count exceeded a user-settable threshold. Event value: The current Earley item count. Suggested message: "Too many Earley items".

Macro: int MARPA_EVENT_EXHAUSTED

The parse is exhausted. Event value: Undefined. Suggested message: "Recognizer is exhausted".

Macro: int MARPA_EVENT_LOOP_RULES

One or more rules are loop rules — rules that are part of a cycle. Cycles are pathological cases of recursion, in which the same symbol string derives itself a potentially infinite number of times. Nonetheless, Marpa parses in the presence of these, and it is up to the application to treat these as fatal errors, something they almost always will wish to do. Event value: The count of loop rules. Suggested message: "Grammar contains a infinite loop".

Macro: int MARPA_EVENT_NULLING_TERMINAL

A nulling symbol is also a terminal. Event value: The ID of the symbol. Suggested message: "This symbol is a nulling terminal".

Macro: int MARPA_EVENT_SYMBOL_COMPLETED

The recognizer can be set to generate an event a symbol is completed using its marpa_g_symbol_is_completion_event_set() method. (A symbol is "completed" if and only if any rule with that symbol as its LHS is completed.) This event code indicates that one of those events occurred. Event value: The ID of the completed symbol. Suggested message: "Completed symbol".

Macro: int MARPA_EVENT_SYMBOL_EXPECTED

The recognizer can be set to generate an event when a symbol is expected as a terminal, using its marpa_r_expected_symbol_event_set() method. Note that this event only triggers if the symbol is expected as a terminal. Predicted symbols which are not expected as terminals do not trigger this event. This event code indicates that one of those events occurred. Event value: The ID of the expected symbol. Suggested message: "Expecting symbol".

Macro: int MARPA_EVENT_SYMBOL_NULLED

The recognizer can be set to generate an event when a symbol is nulled – that is, recognized as a zero-length symbol. To set an nulled symbol event, use the recognizer’s marpa_r_nulled_symbol_event_set() method. This event code indicates that a nulled symbol event occurred. Event value: The ID of the nulled symbol. Suggested message: "Symbol was nulled".

Macro: int MARPA_EVENT_SYMBOL_PREDICTED

The recognizer can be set to generate an event when a symbol is predicted. To set an predicted symbol event, use the recognizer’s marpa_g_symbol_is_prediction_event_set() method. Unlike the MARPA_EVENT_SYMBOL_EXPECTED event, the MARPA_EVENT_SYMBOL_PREDICTED event triggers for predictions of both non-terminals and terminals. This event code indicates that a predicted symbol event occurred. Event value: The ID of the predicted symbol. Suggested message: "Symbol was predicted".


Previous: , Up: Events   [Contents]