Antlr Lexer exclude a certain pattern
问题 In Antlr Lexer, How can I achieve parsing a token like this: A word that contains any non-space letter but not '.{' inside it. Best I can come up with is using a semantics predicate. WORD: WL+ {!getText().contains(".{")}; WL: ~[ \n\r\t]; I'm a bit worried to use semantics predicate though cause WORD here will be lexed millions of times I would think to put a semantics predicate will hit the performance. This is coming from the requirement that I need to parse something like: TOKEN_ONE.{TOKEN