Next: Basic event accessors, Previous: Events overview, Up: Events [Contents][Index]
This is an implicit global event. This event code is reserved. No method triggers an event with this code.
Event value: Unspecified. Suggested message: "No event".
This is an implicit per-symbol event.
This event is triggered by the
marpa_g_precompute()
method
(see marpa_g_precompute()),
when a nullable symbol was used as 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".
This is an implicit global event.
This event is triggered by the
marpa_r_earleme_complete()
method
(see marpa_r_earleme_complete()),
when
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".
This is an implicit global event.
This event is triggered by the
marpa_r_earleme_complete()
(see marpa_r_earleme_complete)
and
marpa_r_start_input()
(see marpa_r_start_input)
methods,
when the parse is exhausted.
See Exhaustion.
Event value: Unspecified. Suggested message: "Recognizer is exhausted".
This is an implicit global event.
This event is triggered by the
marpa_g_precompute()
method,
when one or more rules are loop rules.
(See marpa_g_precompute().
A rule is a loop rule iff it is part of a cycle. See Cycles. Parsing with a grammar than contains a loop rule is deprecated.
Event value: The count of loop rules. Suggested message: "Grammar contains a infinite loop".
This is an implicit per-symbol event.
This event is triggered by the
marpa_g_precompute()
method.
See marpa_g_precompute().
It only occurs if the 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".
This is an explicit per-symbol event. Intuitively, it triggers when a non-nulled non-terminal symbol is fully recognized.
More precisely,
when an Earley set is completed at earleme j
,
the MARPA_EVENT_SYMBOL_COMPLETED event instance
for symbol sym
triggers iff
sym
is activated; and
j
contains
a completed Earley item for a rule whose
LHS is sym
.
The MARPA_EVENT_SYMBOL_COMPLETED
is triggered by the
marpa_r_earleme_complete()
method.
See marpa_r_earleme_complete().
We recall that a symbol instance is a symbol,
together with start and end parse locations.
More than one symbol instance may trigger the
same
MARPA_EVENT_SYMBOL_COMPLETED event instance.
For example,
if x
@40-42 and
x
@38-42 are symbol instances,
they will trigger only one event instance —
the MARPA_EVENT_SYMBOL_COMPLETED event instance
at location 42 with symbol x
.
To declare a completed symbol event, use the
marpa_g_symbol_is_completion_event_set()
method.
See marpa_g_symbol_is_completion_event_set.
To activate or deactivate a completed symbol event,
use the
marpa_g_completion_symbol_activate
method
(see marpa_g_completion_symbol_activate),
or the
marpa_r_completion_symbol_activate
method
(see marpa_r_completion_symbol_activate).
Event value: The ID of the completed symbol. Suggested message: "Completed symbol".
This is an explicit per-symbol event. Intuitively, it triggers when a terminal symbol is expected.
More precisely,
when an Earley set is completed at earleme j
,
the MARPA_EVENT_SYMBOL_EXPECTED event instance
for symbol sym
triggers iff
sym
is activated;
sym
is a terminal; and
sym
is the postdot symbol of an Earley item
whose current location is j
.
This event is triggered by the
marpa_r_earleme_complete()
(see marpa_r_earleme_complete)
and
marpa_r_start_input()
(see marpa_r_start_input)
methods.
More than one symbol instance may trigger the same MARPA_EVENT_SYMBOL_EXPECTED event instance. For example, if
[ [ X ::= B • x ], 0, 42 ]
and[ [ Y ::= C • x ], 7, 42 ]
are Earley items,
they will trigger only one event instance —
the MARPA_EVENT_SYMBOL_EXPECTED event instance at location 42
with symbol x
.
MARPA_EVENT_SYMBOL_EXPECTED events only trigger if their symbol is expected as a terminal. Predicted symbols that are not expected as terminals do not trigger this event.
To declare an expected terminal event, use the
marpa_r_expected_symbol_event_set()
method.
The marpa_r_expected_symbol_event_set()
method
is also used to activate or deactivate an expected terminal event.
See marpa_r_expected_symbol_event_set.
Event value: The ID of the expected symbol. Suggested message: "Expecting symbol".
This is an explicit per-symbol event. Intuitively, this event triggers when a nulled instance of a symbol is recognized.
More precisely,
when an Earley set is completed at earleme j
,
the MARPA_EVENT_SYMBOL_NULLED event instance
for symbol sym
triggers iff
sym
is activated; and
sym
@j
-j
is a symbol instance.
This event is triggered by the
marpa_r_earleme_complete()
(see marpa_r_earleme_complete)
and
marpa_r_start_input()
(see marpa_r_start_input)
methods.
Duplicate nulled nodes may occur.
See Duplicate nulled nodes.
Even if there are duplicate nulled nodes
for symbol sym
at location j
,
only one
MARPA_EVENT_SYMBOL_NULLED event instance for sym
will be triggered at location j
.
To declare an nulled symbol event,
use the recognizer’s
marpa_g_symbol_is_nulled_event_set()
method.
See marpa_g_symbol_is_nulled_event_set.
To activate or deactivate a nulled symbol event,
use the
marpa_g_nulled_symbol_activate
method
(see marpa_g_nulled_symbol_activate),
or the
marpa_r_nulled_symbol_activate
method
(see marpa_r_nulled_symbol_activate).
Event value: The ID of the nulled symbol. Suggested message: "Symbol was nulled".
This is an explicit per-symbol event.
Intuitively,
this event triggers when a symbol is predicted.
Unlike the
MARPA_EVENT_SYMBOL_EXPECTED
event,
the MARPA_EVENT_SYMBOL_PREDICTED
event
triggers for predictions of both
non-terminals and terminals.
More precisely,
when an Earley set is completed at earleme j
,
the MARPA_EVENT_SYMBOL_PREDICTED event instance
for symbol sym
triggers iff
sym
is activated; and
j
contains an Earley item
whose postdot symbol is sym
.
This event is triggered by the
marpa_r_earleme_complete()
(see marpa_r_earleme_complete)
and
marpa_r_start_input()
(see marpa_r_start_input)
methods.
In an Earley set, multiple Earley items may have the same postdot symbol, but they will trigger only one event instance. For example, if
[ [ X ::= B • X ], 0, 42 ]
and[ [ Y ::= C • X ], 7, 42 ]
are Earley items,
they will trigger only one event instance —
the MARPA_EVENT_SYMBOL_PREDICTED
event instance at location 42
with symbol X
.
To declare a predicted symbol event,
use the recognizer’s
marpa_g_symbol_is_prediction_event_set()
method.
See marpa_g_symbol_is_prediction_event_set.
To activate or deactivate a predicted symbol event,
use the
marpa_g_prediction_symbol_activate
method
(see marpa_g_prediction_symbol_activate),
or the
marpa_r_prediction_symbol_activate
method
(see marpa_r_prediction_symbol_activate).
Event value: The ID of the predicted symbol. Suggested message: "Symbol was predicted".
Next: Basic event accessors, Previous: Events overview, Up: Events [Contents][Index]