Xtext - 运行我的语法

时间:2018-06-18 09:21:06

标签: eclipse xtext

我在xtext中为ALF语言编写了一个语法,我可以从plugin.xml启动eclipse应用程序并测试我的语法。

我需要添加一个按钮"运行"执行我的alf代码。

我该怎么做?

1 个答案:

答案 0 :(得分:1)

向Eclipse添加Things的常用方法是命令和处理程序。 你会添加一个读取模型的处理程序,然后调用你的解释器。 你可以在这里找到关于如何为mydsl文件添加处理程序的例子:https://dietrich-it.de/xtext/2011/10/15/xtext-calling-the-generator-from-a-context-menu.html(它调用生成器而不是解释器)

对于一般运行命令,您需要实现启动委托(https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fdebug_launch_adding.htm