| Validate against model structure [message #1008176] |
Mon, 11 February 2013 04:32  |
Mr Manner Messages: 18 Registered: January 2013 |
Junior Member |
|
|
Say I have a model with a supertype rule:
Options:
'{'
members+=Member
(',' members+=Member)*
'}';
Member:
A | B | C | D | E | F;
RequiredMembers:
A | B | C;
I want to write a validation method for "Options" where I check if the "members" feature has a entry for each of the RequiredMembers.
The example above is just pseudo code, the real live code is a bit mode complicated, I can't put the required members in "Options" and chain them with the & operator without forcing an order in the required members.
How can I get get the members in RequiredMembers from emf so I can use this info in my validator.
[Updated on: Mon, 11 February 2013 04:58] Report message to a moderator
|
|
|
|
|
| Re: Validate against model structure [message #1008475 is a reply to message #1008434] |
Tue, 12 February 2013 11:10  |
Christian Dietrich Messages: 4387 Registered: July 2009 |
Senior Member |
|
|
Hi rach DSL has a grammar access which offers such information. But
AS long AS you don't come up with a real world example it is hard to
tell if this will help you. You may have to debug into the stuff to
see what to do exactly.
--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
|
|
|
Powered by
FUDForum. Page generated in 0.02292 seconds