Sometimes Spoofax generates in the automatically generated files some random entries which do not make any sense. The following snipplet was taken from the *-Folding.generated.esv file:

TranslationUnit.TranslationUnit

Pointer.PointerOf

StringLiteralList

StringLiteralList.StringLit

DeclarationQualifierList.DQualifiers

ListPlusOfTypeQualifier0

MemberDeclaration.MemDecl1

ListPlusOfTypeQualifier0

Declaration.Declaration

ListPlusOfTypeQualifier0

IdDecl.IdDeclInit

Initializer.AssignInit

Declaration.Declaration2

VarDecl.DeclInit

Submitted by Sven Stork on 7 December 2012 at 00:13

On 7 December 2012 at 08:18 Gabriƫl Konat commented:

These are from the include/language_name.rtg file, which contain some generated productions for lists (sort* or sort+) in SDF.


On 8 January 2013 at 13:16 Eelco Visser tagged esv

On 8 January 2013 at 13:19 Eelco Visser tagged sdf

On 8 January 2013 at 13:20 Eelco Visser tagged rtg

On 8 January 2013 at 13:20 Eelco Visser tagged minor

On 10 March 2013 at 11:14 Guido Wachsmuth commented:

This happens when you apply EBNF operators to anything else than a single sort:

A B+ C D   -> E {"E1"}
A (B C)+ D -> E {"E2"}

For the first rule, it is clear how the constructor needs to look like:

E1: A * List(B) * C * D -> E

For the second rule, there is no sort for the list, why Spoofax introduces one:

E2: A * List(NewSort) * D -> E
  : B * C -> NewSort

You see exactly these sort names in the generated esv files.
The deeper issue behind this is lack of support for generic tuples in signatures. I will open a new issue for this.

Typically, this is a smell indicating issues in your abstract syntax. Can you provide me the grammar fragments which caused this?


On 10 March 2013 at 11:14 Guido Wachsmuth closed this issue.

Log in to post comments