|imports 'out of the box' [message #972147]
||Mon, 05 November 2012 06:48
| Martin Baker
Registered: July 2009
I am implementing a java-like language that starts with 'package' and 'imports' .It uses xbase and it works fairly well. However there are two issues:|
1) Classes in the same package are not imported by default.
2) Importing native java classes or interfaces does not work properly (the classes are visible but I can't call methods on them).
I am trying to implement this 'out of the box', that is by using the magic 'importedNamespace' name in the grammar, like this:
File returns EuclidFile :
('package' importedNamespace=QualifiedName ';'?)?
Import returns EuclidImport :
| importedNamespace=QualifiedNameWithWildCard) ';'?
Is this possible? That is can I fix the two issues above without adding custom fragments or guice imports (which I don't know how to do). I am not using @Inject extension IQualifiedNameProvider.
Apart from the grammar file and the generator (myJvmModelInferrer) file everything else is left with the default file contents. (so I am using QualifiedNamesFragment).
I can get round issue 1 like this:
but I would like to avoid the need for the additional import.
I can use methods on the built-in java library such as 'String' but not java code that I have written myself (in the same eclipse project).
I would appreciate any information about this or pointers to further reading that I could do.
(I have already read this: blogs.itemis.de/stundzig/archives/773)
Powered by FUDForum
. Page generated in 0.01533 seconds