|Getting a Lexer from a file extension [message #870789]
||Wed, 09 May 2012 17:10
| Olivier Parisy
Registered: June 2011
I would like to get access to the Xtext-generated ANTLR parser, without triggering a full file parsing and linking.
As I understand it, I need to get hold of an Injector for the Module generated for the associated grammar, and ask the Injector for a Provider<Lexer>.
I would like this code to be as generic as possible. So my question is: how can I get the Injector (or the Activator) associated with a given IFile?
It seems like this relationship is only defined in the plugin.xml of each ui plugin through file extension => AbstractGuiceAwareExecutableExtensionFactory subclasses mappings.
But I fail to see how I can use this to get hold of an AbstractGuiceAwareExecutableExtensionFactory instance (and call its getInjector method).
As an alternative, if I get the IResourceFactory or IResourceUIServiceProvider associated with a given IFile, is there any way I can get the Injector from there?
Powered by FUDForum
. Page generated in 0.01569 seconds