lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



To cut this discussion short, use the 'luac' command to generate precompiled Lua code.

Then run it through the 'bin2c' tool, either from Lua etc/ or from here.

Try, fiddle, improvise, and if you ask for help, be specific.

Oh, btw: it won't generate C code for you. It gives you a binary chunk of Lua code that can be embedded in a C program. Is that what you want?

-asko

Attachment: bin2c.lua
Description: Binary data





<adimurthy.sriramulu@wipro.com> <adimurthy.sriramulu@wipro.com> kirjoitti 21.7.2008 kello 17:19:

Hi,

Its generating zero bytes size .c file.

Could you forward lua2c file,if you have one with you.


Thanks & Regards,
Adimurthy

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Rob Kendrick
Sent: Monday, July 21, 2008 7:29 PM
To: lua@bazar2.conectiva.com.br
Subject: Re: How to Generate c source code from LUA source
codeusinglua2c.lua utility.(ex:-from .lua to .c file)

On Mon, 21 Jul 2008 19:13:19 +0530
<adimurthy.sriramulu@wipro.com> wrote:

Hi Rob Kendrick,

Thanks for your suggestions..

Is the below example is correct to generate the *.c file from *.lua
file.

Where lua - interpreter
Lua2c.lua -utility to convert to *.c file.
ftp.lua  - file to convert to ftp.c file.

Lua lua2c.lua ftp.lua

I don't know - it depends on your lua2c implementation.  Try it and
examine its output.

B.

Please do not print this email unless it is absolutely necessary.

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com