[antlr-interest] generating C code from g3pl file for 64 bit linux

Jim Idle jimi at temporal-wave.com
Fri Feb 25 12:34:03 PST 2011


I think that there is one place where the generated code is not quite
correct – something to do with tree parser output. Can you post the error
you are getting or send me the grammar files?



Jim



*From:* Krishna Venuturimilli [mailto:krishnavss at gmail.com]
*Sent:* Friday, February 25, 2011 11:11 AM
*To:* Jim Idle
*Cc:* antlr-interest at antlr.org
*Subject:* Re: [antlr-interest] generating C code from g3pl file for 64 bit
linux



we are using antlr 3.1.1 - and yes we did compile the runtime libs with the
enable 64 bit.

The libs compile fine and link with our application code fine; When did not
have the enable 64 bit the link against our application code would fail
because the libs were built in 32 bit.



May be I should try with 3.3 (the latest version of antlr).

thank you

-Krishna

On Fri, Feb 25, 2011 at 10:34 AM, Jim Idle <jimi at temporal-wave.com> wrote:

Did you set the enable-64bit flag when you built the runtime? Did you use
the latest release? It is 64 bit compatible and ANTLR_MARKER is 64 bits when
you build the runtime for 64 bits. Sounds like you built it with the default
32 bits.



Jim



*From:* Krishna Venuturimilli [mailto:krishnavss at gmail.com]
*Sent:* Friday, February 25, 2011 10:32 AM
*To:* Jim Idle
*Cc:* antlr-interest at antlr.org
*Subject:* Re: [antlr-interest] generating C code from g3pl file for 64 bit

linux



Well the generated code is using ANTLR_UINT32 variable and is assigning
ANTLR_MARKER type value to it; this doesn't work on 64 bit. So I was
wondering if the generated C code is dependent on 32 vs 64 bit.



Is there a way to make it use UINT64 instead of UINT32?



thanks

-Krishna

On Fri, Feb 25, 2011 at 9:01 AM, Jim Idle <jimi at temporal-wave.com> wrote:

1) What file is this and from where?
2) These days you can just rename it to a .g file, the extension names
were because older versions of Visual Studio needed it to see what the
output files were but that isn't relevant any more.
3) The generated C is the same on all platforms and there is nothing
special to do to generate 64 but, 32 bit, Linux, Win32, Solaris etc. In
fact it is designed so that you can generate the C on one platform and
compile it on any. I had to do that because HPUX Java (and HPUX in
general) sucks and could not even run the ANTLR tool jar without patching
the kernel.

So, just like any other file you run the ANTLR tool on it and it will give
you a .c and .h file. The generated files are both 32 and 64 bit
compatible but if you read the docs for the C runtime it will point you at
./configure --help where you will see a flag that you supply to build the
libraries in 64 bit mode.

As to searching all over the interweb, look at the API documentation link
on the ANTLR home page and remember antlr.markmail.org as per the link on
the support page.

Jim


> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Krishna Venuturimilli
> Sent: Thursday, February 24, 2011 4:59 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] generating C code from g3pl file for 64 bit
> linux
>
> I searched all over the net, but can't find a way to compile g3pl file
> to generate C code for 64 bit target.
> Any help is appreciated.
> thanks a lot.
> -Krishna
>

> 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

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