Neither the C nor the C++ languages support reflection and their meta-programming capabilities are very limited. Both of these problems can be addressed by adding a preprocessing step, which can analyze and modify the code before it is passed to the actual compiler. By using this method, we can simplify many typical C/C++ tasks without having to change the languages at all. In order to investigate this, we have created CHIMP, a meta-programming tool that demonstrates the concept and can be used to explore the full capacity of the proposed programming technique. This paper presents CHIMP and demonstrates the benefits of this kind of meta-programming by applying it to a frequently encountered XML problem.
John Kenyon, Frederick C. Harris Jr., Sergiu M. Da