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

Turn top-level choices into multiple productions. The transformation is either attempted for all productions of a nonterminal or for a specific one appointed by its label.

The action is a reverse of horizontal.

Occasionally we use terms “vertical” productions or nonterminals and “horizontal” ones. By vertical nonterminals we mean those that are defined by a list of productions, with every production lacking a top-level choice. A horizontal nonterminal, on the other hand, is defined by one production that is a top-level choice. Nonterminals that employ both top-level choices and splitting into multiple productions are neither horizontal nor vertical.

Syntax

vertical:
        scope

Example

If the original production contained selectors:

decs:
        onedec::dec
        moredecs::(dec decs)

then, after using this transformation:

vertical( in decs );

they are converted to labels:

[onedec] decs:
        dec
[moredecs] decs:
        dec decs

Relevant files

See also

  • Vertical is a part of XBGF

Contributors

Clone this wiki locally