-
Notifications
You must be signed in to change notification settings - Fork 15
Upgrade
grammarware edited this page Jan 19, 2013
·
5 revisions
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.
upgrade:
marked-production production
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
- Upgrade is a part of XBGF