Hello, members.
ANTLR4 Question.
I would like to create some tool with JSON.g4
And I want to get STRING value without double quote characters.
Original
STRING
: '"' (ESC | ~ ["\\])* '"'
;
Question
Is it possible to get string value without the double quote from STRING token?
Or is it better to erase double quote char in visitor method?
I tried (But It does not work as I expected)
//STRING
string
// : '"' (ESC | ~ ["\\])* '"'
: '"' STRING_VALUE '"'
;
STRING_VALUE
: (ESC | ~ ["\\])*
;
I got the following warning.
warning(146): JSON.g4:44:0: non-fragment lexer rule STRING_VALUE can match the empty string
Best regards.