Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Getting a Lexer from a file extension(Lexer, Xtext, File Extension)
Getting a Lexer from a file extension [message #870789] Wed, 09 May 2012 13:10
Eclipse UserFriend
Hi,

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?

Regards,
Olivier.
Previous Topic:Outline View flicker
Next Topic:mismatched input 'cmpResearchItem' expecting RULE_ID
Goto Forum:
  


Current Time: Sat Jul 05 06:52:54 EDT 2025

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

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

Back to the top