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 */ }

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact