Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Unordered group problem(Unordered group followed by same element does not behave as I expect)
Unordered group problem [message #695243] Mon, 11 July 2011 11:14 Go to next message
Dyson Mising name is currently offline Dyson Mising nameFriend
Messages: 5
Registered: June 2011
Location: UK
Junior Member
Hi

I have the following fragment in my grammar:

SeqConfig: op=ART_ID ((',' config_elements+=SeqConfigElement)* & (',' labref=LabRef)? ) 
                     (',' config_elements+=SeqConfigElement)* ; 


The intent is that the DSL allows a single LabRef within a set of SeqConfigElement's

This input works (where NOP is a valid ART_ID and x=y is a valid SeqConfigElement:
NOP x=y, lab

But this does not

NOP x=y, lab, a=b

The error marker given in the generated editor is attached to the 'a' in a=b and appears to relate to a separate fragment of the grammar.

I have not yet tried to test my understanding of unordered groups and their interaction with other elements as I wanted to check with more experienced users where I might be going wrong.

Cheers and thanks for any help you can give,
- Dyson
Re: Unordered group problem [message #695246 is a reply to message #695243] Mon, 11 July 2011 11:20 Go to previous messageGo to next message
Alexander Nittka is currently offline Alexander NittkaFriend
Messages: 1193
Registered: July 2009
Senior Member
Hi,

you don't need unordered groups for that. Something like

SeqConfig: op=ART_ID ((',' config_elements+=SeqConfigElement)* (',' labref=LabRef) )?
(',' config_elements+=SeqConfigElement)* ;


should work
Alex


Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@itemis.de
Re: Unordered group problem [message #695273 is a reply to message #695246] Mon, 11 July 2011 12:12 Go to previous message
Dyson Mising name is currently offline Dyson Mising nameFriend
Messages: 5
Registered: June 2011
Location: UK
Junior Member
Good point Alex, thanks? Sometimes ones has to step back and look at these things from a different stance.

- Dyson
Previous Topic:[Xtext 2.0] Problem referencing sub entities
Next Topic:Using element define in one grammar into another
Goto Forum:
  


Current Time: Sat Apr 27 03:00:52 GMT 2024

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

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

Back to the top