문제

I have created my ecore model:

enter image description here

I have specified it in my xtext file:

MinRequirementsType returns MinRequirementsType:
    'MinRequirementsType'

Next I want to implement the rule, but when I try

enum minrequire: 0|1 ;

I get a mistake!

How is the correct syntax?

도움이 되었습니까?

해결책

Your enum declaration is wrong. Try the following:

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;

Regards,

Xavier

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top