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

Replaces a nonterminal with one of its definitions. The first parameter is the scope production with one of the nonterminals marked. The second parameter is one of that nonterminal’s definitions, which right hand side will be used for replacement.

The XBGF processor looks for the first production with the marked part (but without the markers). If it is found, the marked part is replaced with the right hand side of the second argument production.

Syntax

downgrade:
        marked-production production

Example

Given the input:

a:
        b c
b:
        d e
b:
        f g

After using this transformation:

downgrade(
 a:
        <b> c
 b:
        d e
);

The result will look like this:

a:
        d e c
b:
        d e
b:
        f g

Relevant files

See also

  • Extract is a part of XBGF
Clone this wiki locally