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 Mising name is currently offline Shashi Mising nameFriend
Messages: 47
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: 14665
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 &.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Cross reference problem with rename element
Next Topic:Overriding Rules - Erroneos Generated Interfaces
Goto Forum:
  


Current Time: Fri Apr 26 13:46:15 GMT 2024

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

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

Back to the top