ANTLR 4.6 and C#

87 views
Skip to first unread message

Keith Boshoff

unread,
Feb 21, 2017, 8:04:54 AM2/21/17
to antlr-discussion
Hi,

I'm keen to use ANTLR in a few C# projects, I downloaded and installed 4.6 (Windows 10), got the Java Target running and generating Parsers, Lexers, etc. easily enough.

When I tried a C# target with the following command:

C:\JavaLib>java org.antlr.v4.Tool -Dlanguage=C# Hello.g


I got the following response:

error(31):  ANTLR cannot generate C# code as of version 4.6

I can't find that error anywhere online and I can't find any solution for this.

Do I attach the C# runtime to the .jar somehow? (I'm a JAVA noob, so I have no clue)
Must I use a different command?
Must I roll back to 4.5x? (I'd rather not)

Thanks.

Mike Lischke

unread,
Feb 21, 2017, 8:44:32 AM2/21/17
to antlr-di...@googlegroups.com
Keith,

I'm keen to use ANTLR in a few C# projects, I downloaded and installed 4.6 (Windows 10), got the Java Target running and generating Parsers, Lexers, etc. easily enough.

When I tried a C# target with the following command:

C:\JavaLib>java org.antlr.v4.Tool -Dlanguage=C# Hello.g


I got the following response:

error(31):  ANTLR cannot generate C# code as of version 4.6

I can't find that error anywhere online and I can't find any solution for this.

Best is to read the description of the C# target: https://github.com/antlr/antlr4/blob/master/runtime/CSharp/README.md. In short: the language code is CSharp, not C#, but there is other interesting info for you in that document.


Keith Boshoff

unread,
Feb 23, 2017, 3:10:20 AM2/23/17
to antlr-discussion
Noice! Thanks, Mike!
Reply all
Reply to author
Forward
0 new messages