lua-users home
lua-l archive

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


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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:

http://primemover.svn.sourceforge.net/viewvc/primemover/pm/lib/c.pm?revision=102&view=markup

It's the function calculate_dependencies().

- --
David Given
dg@cowlark.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH274wf9E0noFvlzgRAmyjAKCGxBBuZRSLJL5KTxHePt9GphXm2ACffyx+
VRYtsDjimA1zqzZO9LIZyUA=
=kSn8
-----END PGP SIGNATURE-----