如何在xtext列表中添加分隔符?

问题描述 投票:0回答:1

我有以下语法片段:

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

在实例中,我可以为以上规则键入以下内容:

FrontLeft: FrontLeft1 FrontLeft2;

但是,我喜欢输入的是两者之间的加号:

FrontLeft: FrontLeft1 + FrontLeft2;

我应该如何改变语法来实现这一目标?

eclipse grammar dsl xtext
1个回答
2
投票

通常的模式是

':' (fixtures += [Fixture] ('+' fixtures += [Fixture])*)?
© www.soinside.com 2019 - 2024. All rights reserved.