-
Notifications
You must be signed in to change notification settings - Fork 15
RenameN
grammarware edited this page Jan 19, 2013
·
5 revisions
Labels, nonterminals, selectors and terminals can be renamed. Being in line with the fundamental notion of renaming, such renaming must be done consistently throughout the entire grammar, without introducing any clashes. While renaming nonterminals is a syntactic sugar for the specific combination of inline and extract, it is a semantic preserving grammar transformation that is pretty-printed as renameN.
[nonterminal] rename:
from::nonterminal to::nonterminal
Given the input:
[constant] expr:
int
[binary] expr:
expr op::binary_op expr
[unary] expr:
op::unary_op expr
After using this transformation:
renameN(expr, exp);
Will look like this:
[constant] exp:
int
[binary] exp:
exp op::binary_op exp
[unary] exp:
op::unary_op exp
shared/prolog/xbgf1.pro
shared/prolog/xbgf2.pro
shared/rascal/src/transform/library/Nonterminals.rsc
shared/xsd/xbgf.xsd
- RenameN is a part of XBGF