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

Krishna Venuturimilli krishnavss at gmail.com
Fri Feb 25 16:14:41 PST 2011


I tried using 3.3;
Not sure what I am doing wrong...but the code doesn't even get generated
now.
Here's the error message.
thanks
-Krishna

ectflnx1001> java -cp
"/disks/data1/HDMT/hdmt_project/thirdparty/Antlr/antlr-3.3/lib/antlr-3.3-complete.jar"
org.antlr.Tool
/disks/data1/HDMT/hdmt_project/src/hdmt/tos/common/HdmtTplParser2/tplParser.g3pl
-fo .

Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/antlr/Tool (Unsupported major.minor version 49.0)

        at java.lang.ClassLoader.defineClass0(Native Method)

        at java.lang.ClassLoader.defineClass(ClassLoader.java:502)

        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)

        at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)

        at java.net.URLClassLoader.access$100(URLClassLoader.java:54)

        at java.net.URLClassLoader$1.run(URLClassLoader.java:193)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:186)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:255)

        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

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

> 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
>
> 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