antlr4 How to fix lexer mode implicit token error?

58 views
Skip to first unread message

garym

unread,
Mar 31, 2018, 3:27:20 AM3/31/18
to antlr-discussion

I have a token collision with some text and was thinking about using lexer modes to work around the issues.


I create the mode in the Lexer file, but when I complie the Parser file I get the following warnings:

warning(125): TSqlParser.g4:2377:26: implicit definition of token DISK in parser
warning(125): TSqlParser.g4:2377:31: implicit definition of token TAPE in parser
warning(125): TSqlParser.g4:2377:36: implicit definition of token URL in parser


How can I fix this ?


My mode definition are:

BACKUP:                                'BACKUP' -> pushMode(BackupTokens);

mode BackupTokens:
DISK:                                  'DISK' -> popMode();
TAPE:                                  'TAPE' -> popMode();
URL:                                   'URL' -> popMode();
Reply all
Reply to author
Forward
0 new messages