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


25.14 Marker symbols

A marker symbol is a nulling symbol introduced for the purpose of “marking” a position in a rule. If a MARPA_EVENT_SYMBOL_NULLED event is activated for the marker symbol, an event instance will be triggered whenever that position in the rule is reached.

For example, consider the rule

     [ A ::= Y Z ].                  (R1)

If we replace (R1) with the following rules

     [ Mk0 ::= ]
     [ Mk1 ::= ]
     [ Mk2 ::= ]
     [ A ::= Mk0 Y Mk1 Z Mk2 ].      (R2)

and activate MARPA_EVENT_SYMBOL_NULLED events for the marker symbols (Mk1, Mk2, and Mk3), then a MARPA_EVENT_SYMBOL_NULLED event instance

We can note that use of the marker Mk0 can be replaced by declaring MARPA_EVENT_SYMBOL_PREDICTED event for symbol A. Similarly, use of the marker Mk2 can be replaced by declaring MARPA_EVENT_SYMBOL_COMPLETED event for symbol A. We discuss this more below. See Per-rule events.