[antlr-interest] getting C++ to work

Chris verBurg cheetomonster at gmail.com
Tue Apr 27 18:28:52 PDT 2010


Hmm, weird, I've come across a few references to a Cpp target:

http://www.bearcave.com/software/antlr/antlr_examples.html
http://www.antlr.org/grammar/1198064893071/CPP_parser_v_3.2.zip (referenced
from http://www.antlr.org/grammar/list)
http://www.ibm.com/developerworks/aix/library/au-c_plusplus_antlr/index.html

But I did come across an equal number of references saying that there is no
C++ target for Antlr, or it's not ready yet, or whatever else.

The C target seems to generate thread-safe C struct objects, so that'll work
for me.  Thanks!

-Chris





On Tue, Apr 27, 2010 at 5:18 PM, Jim Idle <jimi at temporal-wave.com> wrote:

> There is no Cpp target, use the C target and compile as C++ :-)
>
> Jim
>
> > -----Original Message-----
> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> > bounces at antlr.org] On Behalf Of Chris verBurg
> > Sent: Tuesday, April 27, 2010 5:00 PM
> > To: antlr-interest at antlr.org
> > Subject: [antlr-interest] getting C++ to work
> >
> > Hey guys,
> >
> > I'm trying to get Antlr to generate a parser in C++, but I'm not having
> > much
> > luck:
> >
> >   grammar MyParser;
> >   options {
> >     language="Cpp";
> >   }
> >
> > generates:
> >
> >   error(100): src/MyParser.g:3:14: syntax error: antlr:
> > src/MyfParser.g:3:14: unexpected token: "Cpp"
> >
> > "C++" doesn't work either, though "C" does.
> >
> > I'm using Antlr 3.2 and java 1.5.0_05, on linux.
> >
> > Any ideas?
> >
> > Thanks!!
> > -Chris
> >
> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
> > Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> > email-address
>
>
>
>
> 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