Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Usage of and(&) operator in grammar rule(Why & when to use and(&) operator in grammar rule)
Usage of and(&) operator in grammar rule [message #1802635] Wed, 13 February 2019 05:06 Go to next message
Shashi D M is currently offline Shashi D MFriend
Messages: 30
Registered: August 2011
Member
Dear All,

In some of the example i observed that, the & operator used inside the rule definition, could any one clarify why and when to use this & operator in rule definition instead of OR(|).

Example
('resolution' resolution=NumberConstant)?
& ('unit' unit=STRING)?
& ('offset' offset=NumberConstant)?
& (range=RangeSpec)?

In the above example each feature is separated by & operator, so why and when we usually apply/use such operator in rule definition

Thank you
Re: Usage of and(&) operator in grammar rule [message #1802636 is a reply to message #1802635] Wed, 13 February 2019 05:32 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13064
Registered: July 2009
Senior Member
From the docs

Quote:

Unordered Groups
The elements of an unordered group can occur in any order, but each element must appear once. Members of unordered groups are separated by &.


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Cross reference problem with rename element
Next Topic:XText 2.16 looking for XBase lib 2.10
Goto Forum:
  


Current Time: Tue Aug 20 06:01:53 GMT 2019

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

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

Back to the top