Skip to main content



      Home
Home » Modeling » TMF (Xtext) » XImportSection and global scoping
XImportSection and global scoping [message #1803631] Tue, 05 March 2019 13:10 Go to next message
Eclipse UserFriend
I'm having "cannot be resolved to a type"error for below setup.

Here is the grammar:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.xbase.Xbase

generate myDsl 

Model:
	('package' name=QualifiedName ';')?
	imports+=XImportSection?
	classes+=Class*;

Class:
	'class' name=ID ('extends' superclass=[Class|QualifiedName])?
	'{' '}';


Class A in file one:
package com.A ; 
class A { }


And class B in file two:
package com.B ; 
import com.A.A;

class B extends A { }


I'm having "com.A.A cannot be resolved to a type" in eclipse. There isn't any problem if it uses
class B extends com.A.A { }


Thanks in advance.
Re: XImportSection and global scoping [message #1803922 is a reply to message #1803631] Wed, 13 March 2019 12:28 Go to previous message
Eclipse UserFriend
Hi,
the usual way of doing this is xbase is

'class' name=ID ('extends' superclass=JvmTypeReference)?

i cannot reproduce it otherwise.
can you provide a complete minimal example
Previous Topic:DSL with white spaces
Next Topic:Cross reference to duplicate items in the model
Goto Forum:
  


Current Time: Sun Aug 31 18:42:23 EDT 2025

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

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

Back to the top