-
Notifications
You must be signed in to change notification settings - Fork 15
RAssoc
grammarware edited this page Jan 19, 2013
·
5 revisions
This transformation operator replaces an iterative production found in the grammar by the argument production, which is a right associative repeating equivalent of the former. Its defining expression involves a pattern of binary recursion with regard to the defined nonterminal. The “r” in “rassoc” refers to the intended effect at the level of derivation trees: the list of subtrees is to be converted into a nested binary tree in a right-associative manner.
rassoc:
production
For instance,
[constant] expr:
int
[binary] expr:
expr (op expr)*
After using this transformation:
rassoc(
[binary] expr:
expr op expr
);
Will look like this:
[constant] expr:
int
[binary] expr:
expr op expr
shared/prolog/xbgf1.pro
shared/prolog/xbgf2.pro
shared/rascal/src/transform/library/Associativity.rsc
shared/xsd/xbgf.xsd
- RAssoc is a part of XBGF