lassoc - grammarware/slps GitHub Wiki

The same as RAssoc, but replaces an iterative production found in the grammar by a left associative repeating equivalent. The “l” in “lassoc” 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 left-associative manner.

Syntax

lassoc:
        production

Example

For instance,

[terminal] expr:
        string
[sequence] expr:
        expr+

After using this transformation:

lassoc(
 [sequence] expr:
        expr expr
);

Will look like this:

[terminal] expr:
        string
[sequence] expr:
        expr expr

Relevant files

See also

  • LAssoc is a part of XBGF

Contributors

⚠️ **GitHub.com Fallback** ⚠️