Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了我的生态模型:
我已经在我的 xtext 文件中指定了它:
MinRequirementsType returns MinRequirementsType: 'MinRequirementsType'
接下来我想实现规则,但是当我尝试
enum minrequire: 0|1 ;
我搞错了!
正确的语法如何?
您的枚举声明是错误的。尝试以下操作:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: test+=Test*; enum OneOrZero: one = '1' | zero = '0'; Test returns Test: value = OneOrZero;
问候,
泽维尔