lua-users home
lua-l archive

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


> I think Pierre may well have done the hard work here since this is
> exactly what he's doing.
>
> Although I have a question for him: how are you storing the results of
> the header parsing? Obviously it would be an expensive operation to
> repeat each time. What is the 'database'?

Hmm.. the output from the preprocessing is stored as a string in
memory. gcc outputs a 1.1 meg string when preprocessing #include
<windows.h>, and cl outputs a 2.6 meg string. I dont think that's too
much to keep in memory, which i do.
I'm not 100% sure how the parsed symbols are stored, since it was a
long time since i edited that code last time.
After being parsed, the symbols (and other symbols that are
recursively used) are "quicksaved"(In quickfile.aul), so that it
doesn't need reparsing next time. the saved data is used to directly
'glue' with alien. Sortof.

My test files check the output from the different parsing stages(or
whatever it should be called), by reading the test file one should get
a good feel of how the data is used and stored. (Attached)
#define lol boll koll


typedef int lolboll[5];


struct __simplenamed
{
	lolboll* arne;
	int boll[6];
	struct{
		char **a;
		union{
			struct{
				char b[2];
			}namngiven;
			lolboll koll[10];
		};
	};
	float bloat;
};

typedef struct simple
{
	char arr[5];
}annanas, bananas;


typedef const char carr;

typedef simple imp, *pimple;
typedef const simple cimple;
typedef const SIMPLE *gimple,*pcimple;
typedef const CHAR *LPCCH,*PCSTR,*LPCSTR;

void MessageBox(int, char *Message, char*, int iconetc);

typedef struct HWND__{int i;}*HWND;

Attachment: lpeg_test.lua
Description: Binary data

Attachment: QuickFile.aul
Description: Binary data