EARLY AND LATE EVENT-ACTIONS
----------------------------
In general, all variables and event-passed fragments in schema are evaluated right
before the construct is executed (=at late-conversion-time). For example:
variables substituted to string-expressions right before string expression will be used,
tokens passed rihgt before events will be fired to Compi,
event-patterns constructed right before their searh in source text;
If event-action is escaped with perfixed sign "+" (plus), this procedure is changed.
In this case, event-action, takes values at time when external-event (=parent event)
came (= at time when this event-action is inserted into the queue == at parent-time ):
it takes values of the external-event if any fragments are passed and
it takes values of variables current to parent-time to string expressions if any.
EXAMPLES.
--------
Suppose source text is
n k
and at start up, variable var
has value "" by default.
In examples below, + sign
corresponds to cases
of early-actions.
Replacing this + sign with
asterisk * will make them
examples of late event-actions.
EXAMPLE 1.
\\- n.w "O".=var +"$var ".w
.w .&
Output for EARLY is "nk".
Output for LATE is "Ok"
EXAMPLE 2.
\\
-r n.w >s +
s .w .&
Output for EARLY is "nk", because event-action "+"
will add event "x.w" to the queue.
Output for LATE is "k" because event-action "*"
will take word "k" from text.
EXAMPLE 3. Event
In the following example,
action-events *.w and +.w
add token's current value to themselves.
However, late-event-action adds
add "O" and early adds "n".
\\
-r n.w >s O.=token +.w
s .w .&
Output for EARLY is "nk".
Output for LATE is "Ok".