lua-users home
lua-l archive

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

David Manura wrote:
Joshua Jensen wrote:
I was trying to use lpeg to put together a C preprocessor
Though one could, I think the larger question is why.
The question of 'why' is easily answered. There is a need to parse through files wrapped with C preprocessor commands (#ifdef, #if, #else, #endif, and #define). The need for a C preprocessor can't be changed; the file format is a worldwide standard.

I appreciate your concern that I might be going the wrong direction and your suggestion of the Lua-based preprocessor. In this case, a C preprocessor is necessary, and given lpeg is already being used to parse through the C-like language, it seems a C preprocessor in lpeg would be ideal.