lua-users home
lua-l archive

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


I posted an ANSI C lexer in Lpeg here: http://lua-users.org/wiki/LpegRecipes . This is currently without a C preprocessor though. Feel free to improve it.

Johann Hibschman wrote:
> Would a useful intermediate step be using lua to run some kind
> of m4 substitute?  And do you know of such a project anywhere?

That's what http://lua-users.org/wiki/SlightlyLessSimpleLuaPreprocessor and also http://lua-users.org/wiki/TextTemplate do. The latter cites its inspiration from m1, a reduced version of m4.

> What cases can you think of where full parsing is useful?

Possible ideas include reflection, code analysis, syntax extension, code transformation, and code documentation--some of the same directions in C++, Metalua, and Luafish.

Here's another odd idea, turning this process inside-out: http://lua-users.org/wiki/CppMetaprogramming