|
Re: Using TMF xText from the commandline [message #55195 is a reply to message #55085] |
Fri, 03 July 2009 09:24 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Hi Louis,
> I'm new to TMF xText, so forgive if this a no brainer.
You're welcome :-)
> - On http://wiki.eclipse.org/MWE_New_Noteworthy it is mentioned that it
> is possible to run the generator from the commandline, but it doesn't
> explain how to do it. Is it described somewhere else? Or could someone
> tell me how to do it?
A brief explanation can be found here :
http://www.eclipse.org/Xtext/documentation/0_7_0/xtext.html# RuntimesetupISetup
But it is very short.
You can use the generated parser through the EMF API.
Writing the following is sufficent in order to get a parsed EMF model
from a file:
TestLanguageStandaloneSetup.doSetup();
ResourceSet resourceSet = new XtextResourceSet();
Resource resource =
resourceSet.getResource(URI.createURI("./mymodel.dsl"), true);
Model rootObject = (Model) resource.getContents().get(0);
//... do stuff with your model
This can be used without OSGi and without any Eclipse workbench
depedendency. All you need is a couple of jars on the classpath (like
EMF, Antlr, Guice, etc,). I've added the list of jars to the end of this
mail.
>
> - Besides being able to run the generator from the commandline, I would
> also like to run the workflow that creates the generator and the editor
> from the commandline. For this I found some reference to a script, but
> the script was so complex that I couldn't distill the essence of it.
It is a matter of writing
new WorkflowFacade("path/to/Workflow.mwe").run();
>
> - Finally I would like to be able to run the generated editor from the
> commandline. Either inside the Eclipse environment or outside of it.
> Currently it seems necessary to create a project...
The editor depends on the workbench, so there might be ways to use it
without projects, it is definitely not something which we did or had in
mind. So sorry I think this is not
>
> To give some background of my questions, I'm thinking of ways to
> introduce TMF xText in a traditional C/C++ style project using make. My
> thinking now is to stay as close to the known structure as possible
> (don't start building from ANT or...).
You need at least a Java process, from where the parser etc. can be invoked.
Cheers,
Sven
Needed jars:
org.eclipse.xtext_0.7.0.v200906222230.jar
org.eclipse.emf.ecore.xmi_2.5.0.v200906151043.jar
org.eclipse.emf.ecore_2.5.0.v200906151043.jar
org.eclipse.emf.common_2.5.0.v200906151043.jar
org.eclipse.xtext.util_0.7.0.v200906222230.jar
com.google.collect_0.8.0.v200906222230.jar
org.antlr.runtime_3.0.0.v200803061811.jar
com.google.guice_1.0.1.v200906222230/aopalliance.jar
com.google.guice_1.0.1.v200906222230/guice-1.0_patched.jar
org.eclipse.xtext.generator_0.7.0.v200906222230.jar
org.eclipse.xtend_0.7.0.v200906230328.jar
org.eclipse.emf.mwe.core_0.7.0.v200906221930.jar
org.apache.commons.logging_1.1.1.v200904062255.jar
org.apache.commons.cli_1.0.0.v20080604-1500.jar
org.eclipse.xpand_0.7.0.v200906230328.jar
org.eclipse.xtend.typesystem.emf_0.7.0.v200906230328.jar
de.itemis.xtext.antlr_0.7.0.200906230945.jar
org.antlr.gen_3.0.1.200906230945/antlr-3.0.1.jar
org.antlr.gen_3.0.1.200906230945/antlr-2.7.7.jar
org.antlr.gen_3.0.1.200906230945/stringtemplate-3.1b1.jar
org.antlr.gen_3.0.1.200906230945
org.eclipse.emf.codegen.ecore_2.5.0.v200906151043.jar
org.eclipse.emf.codegen_2.5.0.v200906151043.jar
org.eclipse.xtext.log4j_1.2.15.v200906222230.jar
org.eclipse.emf.mwe.utils_0.7.0.v200906221930.jar
com.ibm.icu_4.0.1.v20090415.jar
org.eclipse.xtext.xtend_0.7.0.v200906222230.jar
org.eclipse.xtend.util.stdlib_0.7.0.v200906230328.jar
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.16455 seconds