Skip to main content



      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 07:14 Go to next message
Eclipse UserFriend
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 07:20 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Unordered group problem [message #695273 is a reply to message #695246] Mon, 11 July 2011 08:12 Go to previous message
Eclipse UserFriend
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: Thu Jul 10 06:46:26 EDT 2025

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

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

Back to the top