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).
'package' name=QualifiedName ';'
(types += Type)*
'import' importedNamespace=QualifiedNameWithWildcard ';'
'type' name=ID (':' baseTypes += [Type|QualifiedName] (',' baseTypes += [Type|QualifiedName])*)? ';'
Let's consider the following files.
type SecondType : a.b.c.FirstType;
type ThirdType : FirstType;
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