How can I suppress the generation of the variable "_saveIndex" in the C++ code? This variable is declared in a lot of lexer rules but not used.

Martin Bradley

I'm not sure you can turn off the generation of "_saveIndex" but you can turn off the warning message. I don't usually like to do this but in this limited scope it appears to be safe. Place the compiler directives before the class definition for your lexer in your grammar file. The following works for Microsoft VC++ { #if defined(_MSC_VER) //disable unreferenced local var msg #pragma warning(disable:4101) #endif /* _MSC_VER */ }