![]() |
| | #1 |
| Registered User Join Date: Jun 2008
Posts: 8
| I would like to know if there is any way to parse C code so I can automatically generate template code (such as header files). For example I would like to generate enums for each global variable and have them modified through a single function as follows: Code: // set the variable 'vname' to the specified value int s_set_option( enum s_opt vname, void *new_value); // return the variable 'vname' value void *s_get_option( enum s_opt vname); such a tool would make a lovely addition to my make file for future projects. I am working with Ubuntu Thanks |
| lordmule is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| You should have a "protoize", which is part of the gcc package. Here's some info: http://gcc.gnu.org/onlinedocs/gcc/Running-Protoize.html -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
![]() |
| Tags |
| c code, code generation, parse, precompile header |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Proposal: Code colouring | Perspective | General Discussions | 28 | 05-14-2007 07:23 AM |
| Values changing without reason? | subtled | C Programming | 2 | 04-19-2007 10:20 AM |
| Obfuscated Code Contest | Stack Overflow | Contests Board | 51 | 01-21-2005 04:17 PM |
| Updated sound engine code | Bubba | Game Programming | 8 | 11-18-2004 12:38 PM |
| Interface Question | smog890 | C Programming | 11 | 06-03-2002 05:06 PM |