When using a grammar with optional non-terminals, the parser (or imploder) in Spoofax yields an empty list instead of None() and a singular list instead of Some().

For example a type definition with an optional super type declaration:


Name (“::” Name)? “{” Att* “}” -> Type {cons(“Type”)}

Applied to a definition of type Event:


Event { moment : DateTime min(1) max(1) }

Yields the AST:


Type(“Event”, [], […])

The empty list should be None() IMO.

Submitted by Sander Vermolen on 28 April 2010 at 14:09

On 3 May 2010 at 17:21 Lennart Kats commented:

The standard Stratego imploder gives us this AST instead:

Type("Event", [], Some((...)))

i.e., it suffers from StrategoXT/814.

Note: Spoofax/113 should be revisited when we fix this issue.


On 14 July 2010 at 13:38 Lennart Kats closed this issue.

On 14 July 2010 at 13:38 Lennart Kats commented:

Fixed in r21101.

Log in to post comments