Upgrade - grammarware/slps GitHub Wiki
Upgrading is a special variation of replacement and a slightly more powerful and liberal form of folding. This operator replaces an expression by a nonterminal that can be evaluated to it. The first parameter is the scope production with an expression marked. The second parameter is one of that nonterminal’s definitions, which right hand side equals that expression.
Syntax
upgrade:
marked-production production
Example
Given the input:
a:
d e c
b:
d e
b:
f g
After using this transformation:
upgrade(
a:
<b> c
b:
d e
);
The result will look like this:
a:
b c
b:
d e
b:
f g
Relevant files
See also
- Upgrade is a part of XBGF