Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Generating C# code from a grammar

For generating C# code set "language=CSharp;" in the options block of your grammars.To specify that the ANTLR tool should generate C# code (rather than the default of generating Java code) for a grammar, set the grammar-level option named language to the value CSharp as shown below:

Code Block

grammar MyGrammar;

options
{
    language=CSharp;
}

// rest of grammar follows
....

Specifying the namespace for your recognizer

...