Next: Prediction events, Previous: Completion events, Up: Events [Contents][Index]
Libmarpa can set up to generate
an MARPA_EVENT_SYMBOL_NULLED
event whenever the symbol is nulled.
A symbol is said to be nulled
when a zero length instance of that symbol
is recognized.
For a nulled event to be generated, the symbol must be marked, and the event must be activated.
To mark a symbol as a nulled event symbol
use the marpa_g_symbol_is_nulled_event_set()
method.
The event will be activated by default.
To activate or deactivate a nulled symbol event
use the marpa_r_nulled_symbol_activate()
method.
Allows the user to deactivate and reactivate symbol nulled events in the grammar. On success, does the following:
The activation status of a nulled event in the grammar becomes the initial activation status of a nulled event in all of its child recognizers.
This method is seldom needed.
When a symbol is marked as a nulled event symbol in
the grammar,
it is activated by default.
See marpa_g_symbol_is_nulled_event_set().
And a nulled event can be deactivated
and reactivated in the recognizer
using the
marpa_r_nulled_symbol_activate
method.
See marpa_r_nulled_symbol_activate().
Hard fails if the sym_id is not marked as a nulled event symbol in the grammar, or if the grammar has not been precomputed.
Return value: On success, the value of reactivate, which is a boolean. On hard failure, -2.
Allows the user to deactivate and reactivate symbol nulled events in the recognizer. On success, does the following:
When a recognizer is created, the activation status of its symbol nulled event for sym_id is initialized to the activation status of the symbol nulled event for sym_id in the base grammar.
Hard fails if sym_id was not marked for nulled events in the base grammar.
Return value: On success, the value of reactivate, which is a boolean. On hard failure, -2.
On success, returns a boolean which is 1 iff sym_id is marked as a nulled event symbol in g. For more about nulled events, see marpa_g_symbol_is_nulled_event_set().
On soft failure, sym_id is well-formed, but there is no such symbol.
Hard fails if g is precomputed.
Return value: On success, a boolean . On soft failure, -1. On hard failure, -2.
Libmarpa can set up to generate
an MARPA_EVENT_SYMBOL_NULLED
event whenever the symbol is nulled.
A symbol is said to be nulled
when a zero length instance of that symbol
is recognized.
For nulled events for sym_id to occur, sym_id must be marked as a nulled event symbol, and the nulled event for sym_id must be activated in the recognizer. Event activation also occurs in the grammar, and the recognizer event activation status for sym_id is initialized from the grammar event activation status for sym_id. See marpa_g_nulled_symbol_activate(), and see marpa_r_nulled_symbol_activate().
On success, if value is 1,
On success, if value is 0,
A symbol instance can never generate both a nulled and a prediction event at the same location. Also, a symbol instance can never generate both a nulled and a completion event at the same location. (As a reminder, a symbol instance is a symbol starting at a specific location in the input, and with a specific length.) This is because the symbol instance for a nulled event must be zero length, and the symbol instance for prediction and completion events can never be zero length.
However, prediction and nulled events for the same symbol can trigger at the same location. This is because The same location can be the location of a nulled instance of a symbol, and the start of an non-nulled instance of the same symbol.
Also, completion and nulled events for the same symbol can trigger at the same location. This is because the same location can be the location of a nulled instance of a symbol, and the end of one or more non-nulled instances of the same symbol.
The
marpa_g_symbol_is_nulled_event_set()
method will
mark a symbol as a nulled event symbol,
even if the symbol is non-nullable.
This is convenient, for example,
for automatically generated grammars.
Applications that wish to treat
it as a failure if there is an
attempt to
mark a non-nullable symbol
as a nulled event symbol,
can check for this case using
the
marpa_g_symbol_is_nullable()
method.
If sym_id is well-formed, but there is no such symbol, soft fails.
Hards fails if the grammar is precomputed.
Return value: On success, value, which is a boolean. On soft failure, -1. On hard failure, -2.
Next: Prediction events, Previous: Completion events, Up: Events [Contents][Index]