|
Re: How to invoke Xtext parser/JvmModelInferrer from a Java project [message #893979 is a reply to message #893684] |
Fri, 06 July 2012 09:46 |
|
On 07/05/2012 11:15 AM, Marcus Mathioudakis wrote:
> I have implemented a simple little DSL that generates classes from input
> files, by using the JvmModelInferrer approach. I am trying to figure out
> how I can invoke the parser and the code genarator within the code of a
> regular java project. So at some point in the main class of my non-Xtext
> project I can just create a file, pass it to the Xtext
> parser/codeGenerator for my DSL, and the result will be that class files
> are generated to a folder of my choice (within my java project).
> This case is not covered in the documentation, so any help would be much
> appreciated, Thanks!
Hi
I don't know whether this might solve your problem, but if in your
workflow you enable this fragment
// generator API
fragment = generator.GeneratorFragment {
generateJavaMain = true
}
you will find a Main.java generated class that implements the command
line compiler... I think you might get inspiration from that class...
hope this helps
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
Powered by
FUDForum. Page generated in 0.02745 seconds