A Rule with a list of rules where all entrys are allowed once [message #1058842] |
Wed, 15 May 2013 07:45  |
Eclipse User |
|
|
|
Hello,
I am trying to add some optional settings to some elements in my DSL:
Element:
settings+=Settings*
OtherStuff+=MoreRules* ;
Now the settings like version or activation are all allowed only once, so I tryed different approches, but non of them worked.
Settings:
Version? | Activation;
Version_NR:
'vers' version = INT;
Activation:
(active?='activate')?
One try is shown with version, a different one with Activation but all result in an error:
Quote:Decision can match input such as "{')', 'vers'..'activate'}" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
I don't want to call Version_NR and Activation in the Rule Elements because I don't want to force the order. If I use the Settings-Rule the DSL can handle activate bevore version and vice versa.
Has anyone an idea how I can have these Rules called once or not even once without forcing a special order.
Thanks
Liroth
[Updated on: Wed, 15 May 2013 07:47] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: A Rule with a list of rules where all entrys are allowed once [message #1058895 is a reply to message #1058887] |
Wed, 15 May 2013 11:08  |
Eclipse User |
|
|
|
This did the trick and it also eliminated the necissity to make settings a list in the rule Element. So i can directly access the items insted of filtering an iterable in the codegeneration with xtend.
now it looks like:
Element:
settings=Settings //no list here anymore
OtherStuff+=MoreRules*
;
Settings:
('vers' version = INT)? & (active?='activate')?
;
and everything works fine.
Thank you very much!
Liroth
|
|
|
Powered by
FUDForum. Page generated in 3.94232 seconds