Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XImportSection and global scoping
XImportSection and global scoping [message #1803631] Tue, 05 March 2019 18:10 Go to next message
An Li is currently offline An LiFriend
Messages: 2
Registered: February 2019
Junior Member
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 16:28 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13124
Registered: July 2009
Senior Member
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


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:DSL with white spaces
Next Topic:Cross reference to duplicate items in the model
Goto Forum:
  


Current Time: Thu Sep 19 02:42:30 GMT 2019

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

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

Back to the top