Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Exporting DSL as Xtext feature has cross reference problems
Exporting DSL as Xtext feature has cross reference problems [message #1814576] Fri, 13 September 2019 09:25 Go to next message
Eclipse UserFriend
Hello,

I am using Eclipse 2019-06 (DSL) . I have the following grammar:

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://sorry-cant-include-links-to-external-sites-in-this-forum"

Model:
	'package' name=QualifiedName
	imports+=Import*
	greetings+=Greeting*
	byes+=GoodBye*;

Import:
    'import' importedNamespace=QualifiedNameWithWildcard;	

QualifiedNameWithWildcard:
    QualifiedName '.*'?;
	
QualifiedName:
    ID ('.' ID)*;

Greeting:
	'Hello' name=ID '!';
	
GoodBye:
	'Goodbye' name=ID to=[Greeting|QualifiedName]
;


This grammar is the only change that I made to the default xtext project.

When I run the plugin via contextual menu -> Run as -> Eclipse Application the plugin is working fine. I mean that i have 2 files:

first.mydsl:
package something
import something.*
Hello Giovanni !
Goodbye AAAA Giovanni
Goodbye BBBB Antonio


second.mydsl:
package something
Hello Antonio !


There are no errors, and when I ctrl-click in the first.mydsl on "Antonio" I get open the second.mydsl, highlighting the 'Antonio' word.

However, I then try to export the dsl feature as an archive, get installed in another instance of eclipse (a 2019-06 C++ eclipse), install it, and open the same project.

In this case, the line 'Goodbye BBBB Antonio' is not working. Antonio gets underlined red, when hovering the mouse I have Couldn't resolve reference to Greeting 'Antonio'.

Notice that internal references work in both cases, it happens only with reference to a different file.

Any idea?

Thank you in advance,
Giovanni


Re: Exporting DSL as Xtext feature has cross reference problems [message #1814705 is a reply to message #1814576] Mon, 16 September 2019 22:00 Go to previous messageGo to next message
Eclipse UserFriend
Double check that

-the project has Xtext nature and builder
-you have build automatically on
- no errors in error log view
Re: Exporting DSL as Xtext feature has cross reference problems [message #1814733 is a reply to message #1814705] Tue, 17 September 2019 04:44 Go to previous message
Eclipse UserFriend
Hello Christian,

I double checked and indeed the project didn't have xtext nature and "build automatically" was off.
After enabling both of them it worked.

However, I remember having selected "yes" when creating the .mydsl files the first time, so I wonder how that could have happen.

Thank you for you time!
Giovanni
Previous Topic:Maven code generation
Next Topic:Empty line separated language elements
Goto Forum:
  


Current Time: Fri Mar 21 17:36:11 EDT 2025

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

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

Back to the top