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

miles mccoo miles.mccoo at gmail.com
Mon Aug 18 10:12:14 PDT 2008


Yes! that's it! Danke Danke Danke.

I hadn't realized that
http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+documentation is just a
sub section of http://www.antlr.org/wiki/display/ANTLR3/ANTLR+3+Wiki+Home

I had looked at the sections of the documentation page that seemed relevant,
but that was the wrong starting point.

Either way, I've found it now as well as the c doxygen stuff. Perhaps the
link to the doxygen stuff should be moved to earlier in the c support
section?

Miles

On Mon, Aug 18, 2008 at 10:01 AM, Johannes Luber <jaluber at gmx.de> wrote:

> miles mccoo schrieb:
> > 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?
> >
> > Miles
>
> Use
>
> options {
> language=C;
> }
>
> in your grammar. Please also read the "5 minute introduction" on the
> wiki, as beginner questions tend to have been answered there.
>
> Johannes
> >
> >
> > On Mon, Aug 18, 2008 at 9:34 AM, Jim Idle <jimi at temporal-wave.com
> > <mailto:jimi at temporal-wave.com>> wrote:
> >
> >     On Mon, 2008-08-18 at 07:30 -0700, miles mccoo wrote:
> >>
> >>
> >>     I used the original antlr  ages ago and now I need to use it
> >>     again. From the description Antlr3 is what I want to use, but I
> >>     haven't been able to find any information on how to use it in c++.
> >>
> >>     Is there a wiki, tutorial, example, or msg thread on how to
> >>     generate a parser that I can compile into my c++ application?
> >>     Everything I've found assumes I'm a java programmer, which I'm
> >>     not. Is see the page with the target libs, but no info on how to
> >>     use them.
> >>
> >     Use the C target, but compile the resulting .c files as c++ code and
> >     it will all work. Use the C examples in the examples download for
> >     more guidance (specifically the C parser examples).
> >
> >     The C API is documented by following the API Documentation link from
> >     the main ANTLR home page.
> >
> >     Jim
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080818/08dfc1c7/attachment.html 


More information about the antlr-interest mailing list