Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760041/#msg_760041
I've been looking, but the closest thing I can find is the org.eclipse.emf.transaction.listeners extension point, but I'm not sure if this will work, given that none of the projects extend the org.eclipse.emf.transaction.editingDomains extension point, at least as far as I can see.
Is there an extension point that I can extend, or something that I can add to the xtext generator which will let me get at this?]]>Jeff 2011-12-01T04:55:42-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760338/#msg_760338
Every time a project is built from my DSL, it generates java code from an AST.
All I'm looking for is to hook into the AST at that point. How do I do this?]]>Jeff 2011-12-01T23:45:53-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760354/#msg_760354
> So, I'm still stuck on this.
> Every time a project is built from my DSL, it generates java code from
> an AST.
> All I'm looking for is to hook into the AST at that point. How do I do
> this?
Look for the *.ecore file; it is a (meta-)model
Regards
Ed Willink]]>Ed Willink2011-12-02T06:06:29-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760478/#msg_760478
Your DSL (x) is expressed in a grammar x.xtext.
Xtext generates (among other things) an ecore model (x.ecore).
EMF then generates Java code - an implementation of this model.
Later an instance of your language x.dsl is parsed by the generated
parser and an instance of the ecore.model is created.
At this point, you may have a builder that generates Java code for this
model (i.e. x.java).
What exactly is it you want to process? The x.ecore, or the model of an
x.dsl ?
Regards
- henrik
On 2011-02-12 24:45, Jeff wrote:
> So, I'm still stuck on this.
> Every time a project is built from my DSL, it generates java code from
> an AST.
> All I'm looking for is to hook into the AST at that point. How do I do
> this?]]>Henrik Lindberg2011-12-02T14:04:03-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760725/#msg_760725
I think I may have figured out a way of doing it, but I'm not sure if it's right - I'll have a shot at it, but any tips are appreciated.]]>Jeff 2011-12-04T20:58:05-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760811/#msg_760811
https://github.com/dslmeinte/EMF-Statistics-View (fork)
Also, "Visualizing the AST" in http://dslmeinte.wordpress.com/2010/09/06/tricks-for-implementing-scoping/ explains how to do this manually in Eclipse.]]>Meinte Boersma2011-12-05T10:46:28-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/760813/#msg_760813
> The model of an x.dsl.
> I think I may have figured out a way of doing it, but I'm not sure if
> it's right - I'll have a shot at it, but any tips are appreciated.
A builder would probably work the best.
- henrik]]>Henrik Lindberg2011-12-05T10:47:16-00:00Re: How to get AST from plugin project
https://www.eclipse.org/forums/index.php/mv/msg/263041/761181/#msg_761181
Quote:
You could have a look at: [link](fork)
Also, "Visualizing the AST" in [link] explains how to do this manually in Eclipse.
Thanks Meinte, that stats view project was really helpful - just what I needed.
]]>Jeff 2011-12-06T03:26:38-00:00