|
|
Re: Not valid for cross reference [message #1839409 is a reply to message #1839384] |
Sat, 20 March 2021 11:27 |
John Henbergs Messages: 239 Registered: October 2020 |
Senior Member |
|
|
Hi Christian,
If I try to follow your approach by having the following grammar:
Element:
name="element"
;
Type:
A | B | C
;
A:
name=ID
;
B:
name=ID
;
C:
name=ID
;
TypeorElement:
Type | Element
;
Machine:
name = ID find = [TypeorElement]
I get this error:
Decision can match input such as "RULE_ID" using multiple alternatives: 1, 2, 3.
I believe this is because A,B,C are identified by an ID and Xtext will now know if what we are writing belong to A,B, or C. How could it work in this case? Without changing the ID for A,B,C.
Furthermore, one other thing is that A,B,C are reachable from the root rule, while Element is not. I want to say that the rule Element has this specific keyword "element", and when I am at the rule Machine, I will either get suggestions for the names of A,B,C which I have defined prior, or the "element" suggestion.
Hope this is clear enough :)
Thank you!
[Updated on: Sat, 20 March 2021 11:27] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04246 seconds