|Parser Rule Fragments [message #1725076]
||Mon, 29 February 2016 14:43
| Ronan B
Registered: July 2009
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:
& 'des' des=(ConcatenatedString|QuotedConcatenatedString) ';'?
& 'ref' ref=(ConcatenatedString|QuotedConcatenatedString) ';'?
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?
[Updated on: Mon, 29 February 2016 19:38]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01592 seconds