...
Code Block |
---|
tree grammar MyGrammar; options { language=CSharp2; } @namespace { My.Custom.NameSpace.For.TreeParser } // rest of grammar follows .... |
{{@embers} Alternative
...
@members vs C# v2 Partial Classes
In addition to the the use of the @members
block to define class members inline within the grammar file, the CSharp2
target also supports the use of the C# v2 partial classes feature. This has the additional advantage of being able to use the favored that you can use your favourite editor for C# , as to define class members since ANTLRworks doesn't support syntax highlighting for target languages.
...
As you can see, only the inbuilt value types are supported. As adding value types to this map is an open-ended task, the maintainer does not make any changes in that structure for all users. Any changes have to be done by the user locally (and repeatedly for each new used version of ANTLR). It is recommend to that users switch to the CSharp2
target (which requires C# v2+ and use .NET 2 v2.0 or higher as target platforms, ) as the problem has been fixed there in an environment-independent manner.
...