Skip to content
grammarware edited this page Jan 19, 2013 · 5 revisions

Distribute sequential composition over choices so that choices are pulled out of sequences. The transformation is either attempted for all productions of a nonterminal or for a specific one appointed by its label.

Syntax

distribute:
        scope

Semantics

In fact, distribute is nothing more than an automated version of factor that aggressively pushes all the choices that can be found in a production outwards.

This transformation is apparently non-injective, hence, it is impossible to have a complete inverse of it. A more general factor transformation, however, is as capable of emulating distribute's effect as it is capable of doing the reverse thing.

Example

For instance,

foo:
        bar (qux | wez)

After using this transformation:

distribute( in foo );

Will look like this:

foo:
        bar qux
        bar wez

Relevant files

See also

  • Distribute is a part of XBGF

Contributors

Clone this wiki locally