-
Notifications
You must be signed in to change notification settings - Fork 15
Downgrade
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.
downgrade:
marked-production production
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
- Extract is a part of XBGF