JavaCC quote with escape character
问题 What is the usual way of tokenizing quoted strings that can contain an escape character? Here are some examples: 1) "this is good" 2) "this is\"good\"" 3) "this \is good" 4) "this is bad\" 5) "this is \\"bad" 6) "this is bad 7) this is bad" 8) this is bad Below is a sample parser that doesn't work quite right; it has expected results for all except examples 4 and 5, which parse successfully. options { LOOKAHEAD = 3; CHOICE_AMBIGUITY_CHECK = 2; OTHER_AMBIGUITY_CHECK = 1; STATIC = false; DEBUG