简体   繁体   English

Xtext序列化器生成无效的DSL

[英]Xtext serializer generates not valid DSL

I have DSL instances and I'm trying to serialize them. 我有DSL实例,正在尝试序列化它们。 I have the following grammar: 我有以下语法:

Database returns schema::Database:
    'database' name=EString  '{'
    (keys+=Key ( "," keys+=Key)*)? )
    ('structures''{' structureList+=(Group|Template)(','structureList+=(Group|Template))* '}')?
    '}'
;

Group returns schema::Group: 
    structureType=StructureType name=EString
    ('{'
        ('table' '{' tableFieldList=FieldList '}')?)
    '}')

; ;

First of all the serializer ignores the comma for the keys and doesn't genereta it between "keys". 首先,序列化程序将忽略密钥的逗号,并且不会在“密钥”之间产生逗号。 The second problem is "structures" This keyword is generated for every structure. 第二个问题是“结构”。为每个结构生成此关键字。 When I import the files in the DSL Editor, they are not valid, so the grammar is working fine, but not the serializer. 当我在DSL编辑器中导入文件时,它们是无效的,因此语法运行正常,但序列化程序无效。 Any idea how to fix this? 任何想法如何解决这个问题?

I assume the full version of the grammar that you're having the trouble with makes use of unordered groups, doesn't it? 我认为您遇到麻烦的完整语法版本会使用无序组,不是吗? Unordered groups are elements separated by operator "&". 无序组是由运算符“&”分隔的元素。

If my assumption is true, then https://bugs.eclipse.org/bugs/show_bug.cgi?id=369175 would explain the behavior you're describing. 如果我的假设是正确的,那么https://bugs.eclipse.org/bugs/show_bug.cgi?id=369175将解释您所描述的行为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM