Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XBase Imports with Cross References to Another File
XBase Imports with Cross References to Another File [message #1849967] Wed, 09 February 2022 19:43 Go to next message
Eclipse UserFriend
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] Wed, 09 February 2022 23:52 Go to previous message
Eclipse UserFriend
Sorry I don't understand the problem. Can you provide more information
Previous Topic:Whitespace issue with nested blocks
Next Topic:Xtext & Xtend Milestone 2.26.0.M3 is available now
Goto Forum:
  


Current Time: Fri Jul 18 22:54:13 EDT 2025

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

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

Back to the top