lua-users home
lua-l archive

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


I too am interested in toLua. Do you know anything about it’s internals?




From: [] On Behalf Of Eddie Parker
Sent: 29 November 2004 23:55
Subject: ToLua Questions? (Two Features I'm Curious About?)




I’m uncertain if this is the list to ‘bother’ about toLua, but I couldn’t find one on the toLua site.. So I’m just going to try here. Sorry if I offend by doing so! J


I *love* toLua. While the documentation was a little bit antiquated, it worked pretty darned well. (Well, except when I had a class method that returned a const char * const… toLua didn’t like that. J)


Anyhow, two things I’d be interested to know if anybody knows a way of doing:


a)       Adding #line directives to the generated cpp file, a’la bison.

b)       Any way to markup an *existing* .h file to be a ‘cleaned’ header file?


I’m curious about a), because it’ll make things a little easier – for instance, I once had my .pkg file use a global constant, that I had removed.


As for b), I’d just like to see this as a solution to the synchronization of the C++ .h file and the ‘cleaned’ header file. I was thinking of something like the following:


1)       Assume the tolua.exe understands the following as a ‘begin comment section’:      // <NO_TO_LUA>

2)       Assume the tolua.exe understands the following as an ‘end comment section’:       // </END_ NO_TO_LUA >


Now, picture a header that gets compiled by C++ *and* tolua.exe, that looks like this:


// <NO_TO_LUA>

#ifndef MY_CLASS_H

#define MY_CLASS_H

// </END_ NO_TO_LUA >


class MyClass


// <NO_TO_LUA>


// </END_ NO_TO_LUA >





            unsigned int Get() const;

            void Set(unsigned int setValue);




            unsigned int x;

// </END_ NO_TO_LUA >




Or something near this. Anybody have any thoughts?


Anyhow – thank you for your time, I apologize if this *is* in fact the wrong list.


Cheers! J



Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004