Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XBase Imports with Cross References to Another File
XBase Imports with Cross References to Another File [message #1849967] Thu, 10 February 2022 00:43 Go to next message
Ben Holland is currently offline Ben HollandFriend
Messages: 34
Registered: April 2019
Member
I'm very confused about how I should manage the resource set so that cross references to resources in another file are resolved correctly (specifically for an xbase grammar). I am using an Eclipse xtext project to manage resources, but I know I need to populate the resource set manually if I were to use the standalone entry point.

I have an XBase grammar along the lines of:

grammar com.example.MyDsl with org.eclipse.xtext.xbase.Xbase

Model:
  imports=XImportSection?
  namespace=Namespace
;

Namespace:
  'package' name=QualifiedName ';'?
  (elements+=Element)+
;

Element:
	T1 | T2
;

't1' name=ValidID '{' '}' ;

't2' name=ValidID '{'
		ref=[Element|QualifiedName]
'}' ;


Then say I have file 1 with:

package test;
t1 foo {}


and file 2 with:

import test.foo;
package test;
t2 bar{ foo }


Right now I have both file 1 and file 2 inside an Eclipse src folder xtext project and both elements are inferred to classes with a JVMInferrer.

I find that often the refence to foo is an unresolved proxy, which causes a "org.eclipse.xtext.xbase.jvmmodel.JvmModelAssociator - Error calling inferrer" error, but then compilation actually succeeds anyway.

Do I need to create a custom global scope provider?
Re: XBase Imports with Cross References to Another File [message #1849970 is a reply to message #1849967] Thu, 10 February 2022 04:52 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14349
Registered: July 2009
Senior Member
Sorry I don't understand the problem. Can you provide more information

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Whitespace issue with nested blocks
Next Topic:Xtext & Xtend Milestone 2.26.0.M3 is available now
Goto Forum:
  


Current Time: Sun Sep 25 08:28:45 GMT 2022

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

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

Back to the top