The import
statement or the tokenVocab
option can be put in a parser grammar to reuse a lexer grammar.
Sam Harwell advises to always use tokenVocab
rather than import
[1].
Is there any difference between import
and tokenVocab
? If there's no difference (and Sam says to use tokenVocab
), then why have the import
statement?