|Re: Invoking Expand generator from Java [message #485227 is a reply to message #484710]
||Thu, 10 September 2009 20:37
| Sven Efftinge
Registered: July 2009
you're on the right track :-)
The XpandFacade can be used like this:
// create an execution context
XpandExecutionContextImpl execCtx = new
// create a facade
XpandFacade facade = XpandFacade.create(execCtx);
// invoke a template definition
Hope that helps.
> As I develop a generator with Xtext, I'm curious about options to reduce
> the resource requirements. One thing that seems expensive in my
> scenario is initializing the workflow for each model file. My project
> has several thousand model files, so it looks like significant time may
> go into initializing the MWE workflow.
> Since I'm running the process from a Java application that is already
> invoking the parser directly (through XtextResourceSet), I wonder if
> there is a reasonable API to invoke the Xpand without starting an MWE
> Workflow. What I'm not clear on is how I may provide the the instance
> with the model instance that will drive template expansion. I see
> org.eclipse.xpand2.XpandFacade, but its JavaDoc is bare and searches
> don't yield any apparently useful references.
> Thanks for you advice!
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Powered by FUDForum
. Page generated in 0.01634 seconds