Implicit token definition

103 views
Skip to first unread message

Jochen Wiedmann

unread,
Feb 11, 2014, 9:22:36 AM2/11/14
to antlr-di...@googlegroups.com

Hi,

could anyone please be so kind to explain to me the meaning of the warning IMPLICIT_TOKEN_DEFINITION? I am getting these messages:

[WARNING] Message{errorType=IMPLICIT_TOKEN_DEFINITION, args=[END_DIALOG_PARAMETERS], e=null, fileName='com/softwareag/de/s/ns3mod/parser/antlr/Ns3mod.g4', line=16, charPosition=4}
[WARNING] Message{errorType=IMPLICIT_TOKEN_DEFINITION, args=[EMPTY_USER_CODE_SECTION], e=null, fileName='com/softwareag/de/s/ns3mod/parser/antlr/Ns3mod.g4', line=19, charPosition=6}


The only idea I get from searching is that opinions vary, whether this should actually be an error message. At least, I take it, I should understand what it means.

Jochen

Sam Harwell

unread,
Feb 11, 2014, 9:34:25 AM2/11/14
to antlr-di...@googlegroups.com

Hi Jochen,

 

It means you used END_DIALOG_PARAMETERS in a parser rule, but no [known] lexer rule exists that could ever produce that token. In those cases, the parser will create a unique constant and assign it to the identifier END_DIALOG_PARAMETERS, but it order to produce such a token you’ll have to modify a token in your TokenStream by explicitly resetting the type to this value.

 

The same applies for EMPTY_USER_CODE_SECTION.

 

Sam

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages