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


25.13 Event coincidence of symbols

We say the two event instances are coincident same-symbol event instances iff both event instances trigger at the same parse location and both event instances are for the same symbol. Above (see Event coincidence of symbol instances) we looked at event instances which trigger at the same parse location and were for the same symbol instance. In this section we have loosened the requirement, so they events instances can be triggered by multiple symbol instances, as long as all the symbol instances share the same symbol.

Obviously every coincident same-symbol event instance is for the same symbol, and therefore coincident same-symbol event instances can differ only in their event type. This event type will always be one of the recognizer per-symbol events.

Same-symbol event instances can coincide

In fact, three same-symbol event instances can coincide, where they are of types MARPA_EVENT_SYMBOL_PREDICTED, MARPA_EVENT_SYMBOL_COMPLETED and MARPA_EVENT_SYMBOL_NULLED. An example of the triggers for such a triple coincidence is the set of symbol instances sym@41-42, sym@42-42, and sym@42-43, where

Earlier (see Predicted and expected symbol instances), we saw that a single symbol instance can trigger both a MARPA_EVENT_SYMBOL_EXPECTED event instance and a MARPA_EVENT_SYMBOL_PREDICTED event instance at the same parse location. Obviously then, the same symbol can trigger a MARPA_EVENT_SYMBOL_EXPECTED event instance and a MARPA_EVENT_SYMBOL_PREDICTED event instance at the same parse location.

If the deprecated LHS terminals feature is not in use, a MARPA_EVENT_SYMBOL_EXPECTED event instance and a MARPA_EVENT_SYMBOL_COMPLETED event instance cannot be same-symbol coincident. This is because the symbol for the MARPA_EVENT_SYMBOL_COMPLETED event instance must be the LHS of a rule; the symbol for the MARPA_EVENT_SYMBOL_EXPECTED event instance must be a terminal; and terminals cannot be the LHS of a rule. Libmarpa has a feature that allows LHS terminals, but use of this is strongly discouraged. See LHS terminals.

There are no circumstances under which a MARPA_EVENT_SYMBOL_EXPECTED event instance and a MARPA_EVENT_SYMBOL_NULLED event instance can be same-symbol coincident. This is because the symbol for the MARPA_EVENT_SYMBOL_NULLED event instance must be nulled; the symbol for the MARPA_EVENT_SYMBOL_EXPECTED event instance must be a terminal; and terminals can never be nulled. Not only can a MARPA_EVENT_SYMBOL_EXPECTED event instance not coincide with a same-symbol MARPA_EVENT_SYMBOL_NULLED event instance, the two cannot occur in the same parse. In fact, a MARPA_EVENT_SYMBOL_EXPECTED event instance and a same-symbol MARPA_EVENT_SYMBOL_NULLED event instance cannot occur in any parse with the same base grammar.


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