[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C preprocessing in Lua
- From: David Given <dg@...>
- Date: Sat, 15 Mar 2008 12:16:49 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Eric Tetz wrote:
| I'm writing a tool which needs (as one stage) to resolve the header
| dependencies of C source modules. Currently we are using Opus Make
| MKMF.EXE to parse the sources and generates dependency lists. I would
| *like* to roll this part of the process into the main tool, which is
| written in Lua.
| Has anyone written something like this, or know of a module (in Lua,
| usable by Lua, translatable into Lua) which does this? It doesn't need
| to be a full blown preprocessor, but it needs to handle lines
| continuation, comments, etc. and be able to resolve preprocessor
| conditionals properly.
Prime Mover's got one in its C plugin, for exactly the same reason you
want one. The implementation is an As-Simple-As-Possible-To-Do-The-Job
one that just scans files for #include lines. Look here:
It's the function calculate_dependencies().
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----