[antlr-interest] Compile errors with CSharp2 Target

Johannes Luber JALuber at gmx.de
Tue Feb 15 05:15:01 PST 2011


> Hello all,
> 
> I'm trying to get the CSharp2 target to work. I followed the
> instructions here:
> 
> http://www.antlr.org/wiki/pages/viewpage.action?pageId=557075
> 
> except that I generated using the command line rather than using Antlrworks:
> 
> java -classpath antlr-3.1.3.jar org.antlr.Tool -o . Test.g
> 
> The test example worked just fine and produced valid CSharp code, but
> when I tried a PHP grammar (which works fine when generating to Java
> code) it produced a build error:
> 
> C:\Temp\PHPParser\PhpLexer.cs(132,22): error CS0722:
> 'Antlr.Runtime.Token': static types cannot be used as return types
> 
> I tried using various different .NET targets (2.0, 3.0, 3.5), but it
> didn't help.
> 
> Can anyone give me some hints about what might be wrong here?


Hi,

The problem lies in the fact the for current state of the CSharp2 target I didn't release any binaries because of a bug which kills the execution of an example grammar. I'm currently backporting the CSharp3 runtime to isolate if the error is in the runtime or in the templates for the code generation. In the meantime use CSharp3 instead. It only misses debugging support via ANTLRworks, which I hope to add to the backport again. Sorry for the less-than-ideal situation. :(

Johannes

> 
> Cheers & Thanks!
> 
> Simon
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list