Problem cross-referencing to non-ID terminal [message #807084] |
Sat, 25 February 2012 19:17  |
Eclipse User |
|
|
|
I have the following snippet of grammar:
Association:
'Rel' id=REL_ID '{'
(roles+=RelRole)*
'}';
terminal REL_ID :
('R'|'r')('0'..'9')+
;
[..]
AssociationClass:
'Association' 'Class' name=ID 'for' rel=[Association] '{'
(features+=AssocFeature)*
'}'
;
It compiles & generates fine, but with this sample input:
Rel R1 {
//...
}
Association Class Party_Role for R1 {
//...
}
I get an error when trying to run unit tests as follows:
21: mismatched input 'R1' expecting RULE_ID
24: extraneous input '}' expecting EOF
This thread suggests cross-reference targets need to be of terminal type ID. Is that correct?
Goal is simply that the value of Relationship.id matches the pattern above (Rxx). I could implement as a custom validation, or is there a better option?
Thanks.
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05504 seconds