[antlr-interest] How to use antlr V3 with C++

Jim Idle jimi at temporal-wave.com
Mon Aug 18 15:06:50 PDT 2008


On Mon, 2008-08-18 at 09:50 -0700, miles mccoo wrote:
> Thank you, Jim, for the reply.
> 
> The existence of the c library told me that there's a way to
> generate .c output and not just Java and your mail confirms this. The
> thing is, I haven't managed to get anltworks to generate anything
> other than java code. 
> 
> I looked in the file->preferences popup and didn't see anything about
> targetting other languages. when I run generate->generate code, I get
> java code.
> 
> so perhaps the real question is: what option do I need to set to
> generate non-java (C, in my case, but I don't see any others either)
> code?

ANTLR Works will let you generate the C code but that is not useful as
it does not know how to compiler it. You need to incorporate the grammar
in your Makefile of VC project then generate it with -debug and debug
remote from ANTLRWorks.

You just need ot look at the C examples and use:

options
{
   language=C;
}

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080818/6cffddc8/attachment.html 


More information about the antlr-interest mailing list