Hi guys, i need to do a model like this
Relationships
Vp1 : V1;
Vp2 : V2 V3 V4;
Constraints
V1 require V2
V2 require Vp1
Vp1 require Vp2
And my Grammar is like this
Model:
'Relationships'
a+=ElementA*
'Constraints'
c+=Constraint*
;
Constraint:
c1=[ElementA] 'require' c2=[ElementB] |
c1=[ElementB] 'require' c2=[ElementA] |
c1=[ElementB] 'require' c2=[ElementB]
;
ElementB:
name=ID
;
ElementA:
name=ID ':' b+=ElementB ';'
;
I have had problems because the name of elements are equals:
warning(200): ../org.ovm.ui/src-gen/org/ovm/ui/contentassist/antlr/internal/InternalOvm.g:176:1: Decision can match input such as "RULE_ID 'require' RULE_ID" using multiple alternatives: 1, 2, 3
As a result, alternative(s) 3,2 were disabled for that input
error(201): ../org.ovm.ui/src-gen/org/ovm/ui/contentassist/antlr/internal/InternalOvm.g:176:1: The following alternatives can never be matched: 2,3
I have tried create two terminals with differents names, like ID1 and ID2 with same regex inside. Tried to use the operator =>. Create QualifiedNames, etc, with no success.
Here is my last hope.
Thanks in advance.