How to make antlr4 fully tokenize terminal nodes
问题 I'm trying to use Antlr to make a very simple parser, that basically tokenizes a series of . -delimited identifiers. I've made a simple grammar: r : STRUCTURE_SELECTOR ; STRUCTURE_SELECTOR: '.' (ID STRUCTURE_SELECTOR?)? ; ID : [_a-z0-9$]* ; WS : [ \t\r\n]+ -> skip ; When the parser is generated, I end up with a single terminal node that represents the string instead of being able to find further STRUCTURE_SELECTOR s. I'd like instead to see a sequence (perhaps represented as children of the