Parser Rule Fragments [message #1725076] |
Mon, 29 February 2016 09:43  |
Eclipse User |
|
|
|
Hi,
I was reading https://www.eclipse.org/forums/index.php/t/1072927/ and hoping to solve my unordered group issue as outlined a while back in https://www.eclipse.org/forums/index.php/t/1071359/.
It seems the Parser Rule Fragments concept introduced in Xtext 2.9 is rather restrictive in that it cannot be used in unordered groups. When I use the following fragment XText complains "Unassigned rule calls may not be used in unordered groups"
fragment X returns xyz::Element :
(( children+=Node ) | ( properties += Property ))*
;
Element returns xyz::Element:
'element'name=OptionallyQuotedName'{'
(
X
& 'des' des=(ConcatenatedString|QuotedConcatenatedString) ';'?
& X
& 'ref' ref=(ConcatenatedString|QuotedConcatenatedString) ';'?
& X
)
'}';
Also I think it is odd that the fragment must have an explicit return type matching the rule from which it is used, or have I misunderstood?
Thanks!
Ronan
[Updated on: Mon, 29 February 2016 14:38] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.27693 seconds