I'm using ANTLR V3 to produce C# code for DSL language.
The produced code contain the attribute CLSCompliant on both laxer and parser classes which cause a warning to be generated because my project is not CLS compliant.
I guess you've figured out the easy workaround by now which consists in disabling the corresponding warning (and saves you from fiddling with the templates).
Simply add the following to your grammar file
@parser::header {#pragma warning disable 3021}
@lexer::header {#pragma warning disable 3021}
HTH Gabriel
Instead of suppressing the warnings, it's correct to explicitly state that the assembly is not CLS compliant using an attribute in AssemblyInfo.cs
:
[assembly: CLSCompliant(false)]
This will remove the warnings at compilation as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With