dcsimg
Is there an option to disable automatic token generation?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mark_Stevans
Posted On:   Tuesday, March 15, 2005 11:35 AM

Hi. I'm new to ANTLR, but already I encountered a frustrating case of user error (that is, my error): I spelled a token name incorrectly in my parser grammar file. ANTLR generated a new token for it automatically (silently), and it took me a while to figure out what I had done wrong. I am using an explicit "tokens" section in the parser grammar to list all the "imaginary tokens" I am adding to the imported lexer grammar. Is there an option to disable automatic token generation, so that if a token is not listed explicitly in the "tokens" section (or the imported vocabulary), ANTLR would refuse to compile the grammar? This would give me protection against such typos, similar to that offered by C++ and other moder   More>>

Hi. I'm new to ANTLR, but already I encountered a frustrating case of user error (that is, my error): I spelled a token name incorrectly in my parser grammar file. ANTLR generated a new token for it automatically (silently), and it took me a while to figure out what I had done wrong.


I am using an explicit "tokens" section in the parser grammar to list all the "imaginary tokens" I am adding to the imported lexer grammar. Is there an option to disable automatic token generation, so that if a token is not listed explicitly in the "tokens" section (or the imported vocabulary), ANTLR would refuse to compile the grammar? This would give me protection against such typos, similar to that offered by C++ and other modern languages....

   <<Less
About | Sitemap | Contact