Skip to content
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.

Syntax

rassoc:
        production

Example

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

Relevant files

See also

  • RAssoc is a part of XBGF

Contributors

Clone this wiki locally