C++ Declarative Parsing Serialization C++ Declarative Parsing Serialization xml xml

C++ Declarative Parsing Serialization


Lately, I had a look at the following:

Have a good read :)


There is a really good book on using the C++ template processor:

Andrei Alexandrescu Modern C++ Design Generic Programming and Design Patterns Applied Addison-Wesley, U.S.A., 2001 ISBN 0-201-70431-5

Andrei starts writing programs using C++ templates!


The template metaprogramming is a really powerful tool, but the thing is simple: your just have to invent your own additional syntax for describing properties.

Yes, parsing C++ is hard, but we only need the limited parsing capabilities: read the class listwith hierarchy information and the list of all the serialized properties.

This can be done even in a C/C++ tool with a linear scanning algorithm, if we define some dummy macros.

Templates can abstract the class instantiation and on top of that we add the intrusive RTTI.

The complete description of the technique is described in my answer to this question

How to implement serialization in C++