|
Re: Run the text generation from my editor [message #664858 is a reply to message #664854] |
Tue, 12 April 2011 10:13 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
Hi, in the Eclipse b3 project I wrote several different "runners" that
operate on the file being in the editor (with a console, with a dialog,
parameterized actions defined in extension points, etc). In my case I
execute an interpreter - but should not be difficult to use a similar
setup to run generation.
This info is naturally not worth much if your question is really "how do
I run generation from code?" - I have not done that, so I can't answer.
- henrik
On 4/12/11 11:37 AM, Sam wrote:
> Hi all,
>
> I'm abeginner with Xtext and I don't know how to the run the generation
> process defined in the 'generator' project.
>
> I already defined my grammar and the generation template with Xpand. I
> already test it in the 'generator' project and it wiorks well.
>
> When I run my projects as Eclipse Application, I can edit files
> according to my grammar. At this step, I want to run the generation to
> transform the file I am editing.
>
> I don't know how to do that.
> Anyone can help me ?
|
|
|
|
Re: Run the text generation from my editor [message #664868 is a reply to message #664864] |
Tue, 12 April 2011 10:57 |
|
Hi,
the problem is that the is not the way to do this. you could do something "automatically" like it is done in the domain model example. or call the workflow programmatically. or or or
The Basic Problem is that the Workflow in the Generator Project by default is meant to work on n dsl files.
so what you can do is eg.
(1) enable wizard in workflow
// project wizard (optional)
fragment = projectWizard.SimpleProjectWizardFragment {
generatorProjectName = "${projectName}.generator"
modelFileExtension = file.extensions
}
(2) mere plugin.xml_gen to plugin.xml in ui project
(3) start runtime and create new yourdsl project via new project wizard (in the XText section)
(4) the wizard creates a project with dsl file and a workflow that triggers the generator
~Christian
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 5.05936 seconds