Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Cross reference between two Arms in thre AST Diagramm(No working cross reference between two Arms in thre AST Diagramm)
Cross reference between two Arms in thre AST Diagramm [message #1835280] Sun, 29 November 2020 20:58 Go to next message
Marvin Dongus is currently offline Marvin DongusFriend
Messages: 1
Registered: November 2020
Junior Member
Hello Xtexter's,
i have the following Grammar Construct:

Entryrule:
objekt += Objekt*
;

Objekt:
(Class | SignalConnector)
;
Class:
'class' name = ID
'{'
signalsOfClass += Signal*
'}'
;

Signal:
'Signal' name = ID
;

SignalConnector:
connections += Connect*
;
Connect:
'connect' producerSignal = [Signal] 'with' consumerSignal = [Signal]
;

Eclips accept the cross reference of [Signal] in Xtext, but in my runtine projekt my compiler can't resolve the reference to a existing objekt in the project.

If I adapt this example in the way that die rule <Class> don't have a (name = ID) the Cross reference is working, but this isn't a suitable solution for me.
I hope somebody can help me with my problem ;D

Re: Cross reference between two Arms in thre AST Diagramm [message #1835287 is a reply to message #1835280] Mon, 30 November 2020 07:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you dont have a reference to an objekt in your grammar.

so can you please provide complete grammar and a unit test


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Cross reference between two Arms in thre AST Diagramm [message #1835293 is a reply to message #1835287] Mon, 30 November 2020 10:08 Go to previous message
Tamas Miklossy is currently offline Tamas MiklossyFriend
Messages: 157
Registered: February 2016
Senior Member
Hello Marvin,

You should be able to reference the signals using their fully qualified name, such as connect <className>.<signalName> with <className>.<signalName>

From the Xtext documentation:

... the default implementation strategy exports every model element that the IQualifiedNameProvider can provide a name for.

... If you would like to see what's in the index, you could use the 'Open Model Element' dialog from the navigation menu entry.

For further information, see the Linking and the Scoping section of the Xtext documentation.

Hope that helps,
Tamás
Previous Topic:Unit testing - Executing generate code
Next Topic:Xtext / Xtend 2.24 release
Goto Forum:
  


Current Time: Wed Apr 24 23:59:18 GMT 2024

Powered by FUDForum. Page generated in 0.02695 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top