Hi,
I'm currently working on a language that does namespace-based imports like in Java (incl. a package declaration at the beginning of the file).
Example Grammar:
File:
'package' name=QualifiedName ';'
(types += Type)*
;
Import:
'import' importedNamespace=QualifiedNameWithWildcard ';'
;
Type:
'type' name=ID (':' baseTypes += [Type|QualifiedName] (',' baseTypes += [Type|QualifiedName])*)? ';'
;
Let's consider the following files.
File1.mydsl
package a.b.c;
type FirstType;
File2.mydsl
package d.e.f;
type SecondType : a.b.c.FirstType;
File3.mydsl
package g.h.i;
import a.b.c.*;
type ThirdType : FirstType;
File4.mydsl
package a.b.c;
type FourthType : FirstType; // Couldn't resolve reference to Type 'FirstType'
Files 1-3 resolve fine as all EReferences are fully qualified when the resolution is attempted but File 4 fails. I guess it's because it uses the simple name to scan the index in the Global Scope. If so - how can I override the EReference's qualified name if it's not qualified?
If that's not the reason - what am I doing wrong?
Best regards and many thanks in advance for your help
[Updated on: Wed, 19 July 2017 22:34]
Report message to a moderator