[antlr-interest] CSharp Targets

Jim Idle jimi at temporal-wave.com
Mon Nov 2 09:13:15 PST 2009

CSharp2 target works just fine, so perhaps you have not downloaded the .Net/C# runtime for CSharp2 and added the .dlls as references to your project?


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Andrew More
> Sent: Monday, November 02, 2009 6:01 AM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] CSharp Targets
> Does anybody have these working?  Right now I'm attempting to get my
> grammar to work with CSharp2, but I could use CSharp1 or CSharp2.
> Right now I seem to be running into a number of compiler errors and
> warnings, so I'm not even confident that this works.  Maybe I've got
> something setup wrong?  Anyway, I'm using the latest version of the
> compiler (3.2), and I'm attempting to compile the results using Visual
> Studio 2008.  I can't use anything but C# since that's what the rest
> of the project is using.  (I guess I could go to C, but I'd REALLY
> rather avoid it, if possible.)
> Here are a couple of the errors I ran into:
> 1)  "using Stack                 =
> Antlr.Runtime.Collections.StackList;"  (line 61 of CSharp2.stg)
> This doesn't appear to be tied into anything in the DLLs I'm
> attempting to use.  Right now I have references to Antlr3.Runtime,
> Antlr3.Runtime.Debug, Antlr3.StringTemplate.  I couldn't find any
> references to it, so I removed it.
> 2)  "override public object Tree" (line 59 of AST.stg)
> I removed "override" because there didn't appear to be anything to
> override.
> Once I removed these two things, I got a ton of other errors, which
> makes me wonder if I'm doing this right, or if the C# target(s) work
> at all.
> Here are my options for the grammar:
> grammar RuleEngine;
> options {
>         language=CSharp2;
>         output=AST;
> }
> I'm hoping this is something simple that I'm missing.  I've been very
> impressed with ANTLRWorks, the ANTLR compiler and the documentation in
> Terence's book (which I've read cover to cover).  Any help that
> anybody could give me would be appreciated.
> Thanks!
> Andrew
> 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