September 7th, 2009, 04:34 PM
Alternative C++ Preprocessing
What I'm trying to do is make declaring objects for a script virtual machine transparent, and the system I had before was a combination of the C Preprocessor and CPP templates which created static objects that were then executed and added to the VM upon runtime -- that is needlessly inefficient though, and not terribly transparent.
What I -want- is to find a preprocessor that will parse my code, and when it finds a class/function/method/variable/member that has the pseudomodifier 'SCRIPT' behind it (#define SCRIPT) will add it to a source file so it can be included in the build later.
As far as I know, the C preprocessor could not possibly handle this, and I don't want to have to write a Python script to parse C++ simply to accomplish this task, so I was wondering if there were a simpler method by which to accomplish such...
September 7th, 2009, 05:54 PM
Re: Alternative C++ Preprocessing
Systems like that certainly exist. Qt for example has its own preprocessor called MOC (Meta-Object Compiler) which translates some custom Qt code into standard C++. I don't know though if there are any available that are really meant to be customizable for your own uses.
Tags for this Thread
Click Here to Expand Forum to Full Width