Xtext 中的 JVM 类型
我正在尝试使用以下语法创建 DSL:
alias date java.util.Date;
所以我的语法是这样的:
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
Model:
(types+= Type)*;
Type:
Alias | Class;
PackageName:
ID ('.' ID)*;
Alias:
'alias' name = ID javaType=[jvmTypes::JvmType|PackageName] ';' ;
这似乎不起作用。
我正在看这篇文章: http://www.eclipse.org/ Xtext/documentation/2_0_0/199a-jvmtypes.php 的作用非常相似。不知道我在这里缺少什么。
I am trying to create a DSL in the following syntax :
alias date java.util.Date;
so what I have in my grammar is something like this :
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes
Model:
(types+= Type)*;
Type:
Alias | Class;
PackageName:
ID ('.' ID)*;
Alias:
'alias' name = ID javaType=[jvmTypes::JvmType|PackageName] ';' ;
This doesn't seem to be working.
I am looking at the article : http://www.eclipse.org/Xtext/documentation/2_0_0/199a-jvmtypes.php which does something very similar. Not sure what I am missing here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
终于明白了。
添加这个有效
注意:
官方教程提到应该添加这个。
MWE2 工作流程从未成功运行,抱怨无法找到该模型。
Finally got it.
Adding this worked
Note :
The official tutorial mentioned that this should be added.
The MWE2 workflow never ran to success with that, complaining that this model could not be located.