Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 17:10
Olivier Parisy is currently offline Olivier ParisyFriend
Messages: 15
Registered: June 2011
Junior Member

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?

Previous Topic:Outline View flicker
Next Topic:mismatched input 'cmpResearchItem' expecting RULE_ID
Goto Forum:

Current Time: Mon Nov 30 09:15:15 GMT 2020

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

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

Back to the top