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


23.7 Event codes

Accessor macro: int MARPA_EVENT_NONE

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

Accessor 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".

Accessor macro: int MARPA_EVENT_EARLEY_ITEM_THRESHOLD

This event indicates that an application-settable threshold on the number of Earley items has been reached or exceeded. See marpa_r_earley_item_warning_threshold_set().

Event value: The current Earley item count. Suggested message: "Too many Earley items".

Accessor macro: int MARPA_EVENT_EXHAUSTED

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

Accessor 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".

Accessor macro: int MARPA_EVENT_NULLING_TERMINAL

This event occurs only if LHS terminals feature is in use. The LHS terminals feature is deprecated. See LHS terminals. Event value: The ID of the symbol. Suggested message: "This symbol is a nulling terminal".

Accessor 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".

Accessor 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 that 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".

Accessor 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".

Accessor 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][Index]