lua-users home
lua-l archive

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


Hello!

 

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>

public:

// </END_ NO_TO_LUA >

 

            MyClass();

            ~MyClass();

 

            unsigned int Get() const;

            void Set(unsigned int setValue);

 

// <BEGIN_TO_LUA_COMMENT>

private:

            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

 

-e-


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