Random generation of "ListPlusOfTypeQualifier0" entries in generated files
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
Issue Log
These are from the include/language_name.rtg file, which contain some generated productions for lists (sort* or sort+) in SDF.
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?
Log in to post comments