how to add a separator in in xtext list?

[亡魂溺海] 提交于 2019-12-11 18:33:54

问题


I have the following grammar fragment:

FixtureGroup:
                            name            = ID 
    ':'                     fixtures += [Fixture]*
    ';';

And in the instance I can type for the above rule the following:

FrontLeft: FrontLeft1 FrontLeft2;

However, what I like to type is a plus in between:

FrontLeft: FrontLeft1 + FrontLeft2;

How should I change the grammar to accomplish this?


回答1:


the ususal pattern is

':' (fixtures += [Fixture] ('+' fixtures += [Fixture])*)?


来源:https://stackoverflow.com/questions/55929123/how-to-add-a-separator-in-in-xtext-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!