Michel Keijzers
Michel Keijzers

Reputation: 15357

how to add a separator in in xtext list?

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?

Upvotes: 0

Views: 213

Answers (1)

Christian Dietrich
Christian Dietrich

Reputation: 11868

the ususal pattern is

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

Upvotes: 2

Related Questions