...
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 Blockpanel |
---|
grammar MyGrammar; options {
// rest of grammar follows
|
Specifying the namespace for your recognizer
Namespace can be set via:You can specify that your generated recognizer should be declared within a specific namespace as ahown below. By default all recognizers are generated as top-level types with no enclosing namespace.
Code Block |
---|
@lexer::namespace { mynamespace.parserMy.Custom.NameSpace.For.Lexers } @parser::namespace { mynamespace.parserMy.Custom.NameSpace.For.ParsersInclTreeParsers } |