This serves for disallowing single unescaped backslashes and single unescaped double quotes. Note that these appear as '\\'
and '\"'
, because at least the former is disallowed in the grammar literal as well.
The EscapeSequence rule in contrast allows escaped backslashes and double quotes.
Omitting the exclusion of a single unescaped double quote would extend String tokenization to the last quote that can be found, however it should terminate at the first unescaped quote.
Omitting the exclusion of a single unescaped backslash would allow sequences beginning with a backslash, that are not supported EscapeSequences.