ANTLR and Xtext integration for developing plugin

↘锁芯ラ 提交于 2019-12-11 00:18:43

问题


My current project is focusing on code generation from High-level specification. More specifically, developers write high-level specifications and compiler parses them and generates Java code. For parser, I have used ANTLR grammar and for code generation I have used StringTemplateFiles.

For providing nice editor support (with syntax high lighting & coloring), I have used xText.

Now, the real problem comes - how can I integrate xText editor support with ANTLR parser and code generator? I want to provide nice eclipse plugin to developers.

Should I stick with xText and try to solve integration problem?/ Should I use only ANTLR and StringTemplateFiles and try to create Eclipse plugin out of it (I do not know - how can I do this)?

Other alternative suggestions are also welcomed.


回答1:


Xtext generates Antlr parser and support template based generation via xtend in addition to the eclipse plugin - why not use it exclusively?




回答2:


You do not have to use xtend to write the code generator. the only thing you have to cope with is the interface IGenerator it should be possible to call StringTemplate from there (Implementing the call in Java or Xtend)



来源:https://stackoverflow.com/questions/23290093/antlr-and-xtext-integration-for-developing-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!