You can use ANTLRWorks . In run -> Interpret lexer you can see the result for the lexer grammar. You may also click Window → Lexer Debugger Controller Window if it does not automatically display. Under it you can see types, tokens, channels, modes, lookahead. Tokens are very useful to see which "string" was recognized as a token. Also, if I have lexer modes, I always use antlrworks.


source
share