如何在xtext列表中添加分隔符? [英] how to add a separator in in xtext list?

查看:99
本文介绍了如何在xtext列表中添加分隔符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下语法片段:

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?

推荐答案

常用模式是

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

这篇关于如何在xtext列表中添加分隔符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆