第一条规则永远不会奏效。它应该处理类似“ID1.ID2.ID3.ID4.ID5”的东西。但其他规则按预期工作。它有什么问题?
grammar testInt;
data_source:
(ID '.' ID '.' ID ('.' ID)+)=>program_ref
| (ID '.' ID '.' ID)=>var_ref
| (ID '.' ID)=>program_ref
| resource;
program_ref: ID ('.' ID)+;
var_ref: ID '.' ID '.' ID;
resource: ID;
ID: (LETTER | ('_'(LETTER | DIGIT))) ('_'? (LETTER | DIGIT))*;
WSFULL:(' '|'\r'|'\t'|'\u000C'|'\n') {$channel=HIDDEN;};
fragment LETTER: (('a'..'z') | ('A'..'Z'));
fragment DIGIT: '0'..'9';