Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Allow keywords in any order
Allow keywords in any order [message #984412] Wed, 14 November 2012 17:26 Go to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I need this feature in my grammar:

ClassDefinition : ('opt1'|'opt2'|'opt3')*? name=ID ";" ;

where "*?" means "any of them in any order but each one only once".

How can I do something like that?

Background: I have some places where a rule has 5-10 options and I want to enable users to give them in any order.

Regards,

A. Digulla
Re: Allow keywords in any order [message #984457 is a reply to message #984412] Wed, 14 November 2012 18:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi an unordered group doesnt work?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Allow keywords in any order [message #985386 is a reply to message #984412] Thu, 15 November 2012 11:03 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Aaron,

I see you are familiar with unordered groups, this solves the "any of them in any order" part.

Solve the "each of them only once" by a validation rule.

Regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: Allow keywords in any order [message #985529 is a reply to message #985386] Thu, 15 November 2012 13:21 Go to previous message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
Thanks, "unordered group" was the keyword I was looking for.

For all the people who have the same problem, you can find an explanation and example here: http://www.eclipse.org/Xtext/documentation.html#syntax

Search for "Unordered Groups" in the page.

Regards,

A. Digulla
Previous Topic:Xtext and left recursive
Next Topic:Creating Proxies from JvmType
Goto Forum:
  


Current Time: Tue Mar 19 06:38:10 GMT 2024

Powered by FUDForum. Page generated in 0.03129 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top