Closed mageniao2 closed 2 weeks ago
Is the resetBuiltInToken
function actually called? And the this
binding is wrong. That's not the token, but the lexer. If all you want is to change the token type use the type
lexer command:
LETTERS : [a-zA-Z]+ -> type(VALUE_FUNCTION_NAME);
I added action for LETTERS in the lexer file, which adjusts the token type to VALUE_FUNCTION_NAME (1), but it doesn't take effect, and the output in antlr4-debug is still LETTERS, not VALUE_FUNCTION_NAME.
But the syntax tree I get through antlr4-listener outputs the token as VALUE_FUNCTION_NAME Maybe I got something wrong? My code is as follows: