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

Two nonterminals, say x and y, are merged (possibly recursively). That is, the definitions of x and y (i.e., their productions) are merged in one definition while preserving the nonterminal y and replacing all occurrences of x (in the definition of x and anywhere else) by y.

Syntax

unite:
        add::nonterminal to::nonterminal

Example

Given the input:

foo:
        "a"
foo:
        "b"
bar:
        "d"

After using this transformation:

unite(bar, foo);

The result will look like this:

foo:
        "a"
foo:
        "b"
foo:
        "d"

Relevant files

See also

  • Unite is a part of XBGF

Contributors

Clone this wiki locally