Skip to main content



      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 00:06 Go to next message
Eclipse UserFriend
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 00:32 Go to previous message
Eclipse UserFriend
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 &.
Previous Topic:Cross reference problem with rename element
Next Topic:Overriding Rules - Erroneos Generated Interfaces
Goto Forum:
  


Current Time: Wed Jun 25 05:13:54 EDT 2025

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

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

Back to the top