My current project is focusing on code generation from DSL ( i.e., high-level specification). More specifically, developers write high-level specifications and these specifications are parsed and generate code in Java and Android. For parser, I have used ANTLR grammar and for code generation I have used StringTemplateFiles.
However, developer writes high-level specifications in notepad. Because of it, I am not able to provide syntax highlighting, coloring , and error handling. To provide this support, I am thinking to use xText.
I am thinking to integrate xText as follows:
- Developers will write high-level specifications into editor support provide by xtext (Basically, I will write xtext grammar and generate editor support). Here, Xtext editor will handle syntax coloring, syntax highlighting and error handling.
- I will take all these specifications as .txt inputs and then ANTLR parse these files. And generate Java and Android code.
Need your suggestions on the following questions:
(1) How can I extract files, written in xtext editor, and provide input to ANTLR parser? OR (2) Should I stick with xText and try to integrate ANTLR parser and xtext? (kindly advise the - how could I integrate xtext and ANTLR with a simple example) OR (3) Should I use only ANTLR and StringTemplateFiles and try to create Eclipse plugin out of it?
Other alternative suggestions are also welcomed.