Some grammars like C.g4 have parser rules that have string literals that don't have a corresponding lexer rule for the string literal. For example, in the C.g4 grammar, we don't have a lexer rule for '__asm'. String literals in a parser rule get unfolded by the Antlr4 tool. If it cannot find a lexer rule for the string literal, Antlr will generate a rule internally.
Parser rule string literals are okay as long as one doesn't need to split the grammar, because once split, the Antlr4 tool will then complain that you don't have a lexer rule for the string literal. It might be best to find all string literals in all grammars-v4, and make sure we declare string literals with explicitly.
See https://github.com/antlr/antlr4/discussions/4212#discussioncomment-5739418
Some grammars like C.g4 have parser rules that have string literals that don't have a corresponding lexer rule for the string literal. For example, in the C.g4 grammar, we don't have a lexer rule for
'__asm'
. String literals in a parser rule get unfolded by the Antlr4 tool. If it cannot find a lexer rule for the string literal, Antlr will generate a rule internally.Parser rule string literals are okay as long as one doesn't need to split the grammar, because once split, the Antlr4 tool will then complain that you don't have a lexer rule for the string literal. It might be best to find all string literals in all grammars-v4, and make sure we declare string literals with explicitly.