用于开发插件的 ANTLR 和 Xtext 集成 [英] ANTLR and Xtext integration for developing plugin

查看:29
本文介绍了用于开发插件的 ANTLR 和 Xtext 集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的项目专注于从高级规范生成代码.更具体地说,开发人员编写高级规范,编译器解析它们并生成 Java 代码.对于解析器,我使用了 ANTLR 语法,而对于代码生成,我使用了 StringTemplateFiles.

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.

为了提供良好的编辑器支持(语法高亮和着色),我使用了 xText.

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

现在,真正的问题来了 - 如何将 xText 编辑器支持与 ANTLR 解析器和代码生成器集成?我想为开发者提供不错的 Eclipse 插件.

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.

我应该坚持使用 xText 并尝试解决集成问题吗?/我是否应该只使用 ANTLR 和 StringTemplateFiles 并尝试从中创建 Eclipse 插件(我不知道 - 我该怎么做)?

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)?

也欢迎其他替代建议.

推荐答案

除了 eclipse 插件之外,Xtext 还通过 xtend 生成 Antlr 解析器并支持基于模板的生成 - 为什么不单独使用它?

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

这篇关于用于开发插件的 ANTLR 和 Xtext 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆