StyleRuleExecutor

The StyleRuleExecutor is a stateless virtual machine that accepts a context and executes one or more instructions of its rule, returning control immediately upon detecting that a derivative of the initial context has left the RUNNING state. The executor uses a supplied injector to feed forked contexts back into the pool of pending contexts. It should be run iteratively against a lineage of contexts and a sequence of classifiers. The special end-of-sequence classifier should terminate a sequence of classifiers (unless the rule rejects the sequence preemptively).

Author

Todd L Smith

Properties

Link copied to clipboard

The special end-of-sequence literal, represented by the interned empty string.

Functions

Link copied to clipboard
fun execute(initialContext: StyleRuleContext, classifier: String, injector: (StyleRuleContext) -> Unit): StyleRuleContext

Using the machine state recorded in the initial context, run the associated rule until leaves the RUNNING state.