Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A complete parser-building tool like ANTLR or YACC is necessary if you want to parse C++ from scratch, but it's overkill for your purposes.</p> <p><i>It reads over my source files, makes a list of classes, their members, their functions, etc. which is then used to generate new code.</i></p> <p>Two main options:</p> <ul> <li><a href="http://www.gccxml.org/HTML/Index.html" rel="nofollow noreferrer">GCC-XML</a> can generate a list of classes, members, and functions. The distribution version on their web site is quite old; try the CVS version instead. I don't know about the availability of a Windows port.</li> <li><a href="http://www.stack.nl/~dimitri/doxygen/" rel="nofollow noreferrer">Doxygen</a> is designed for producing documentation, but it can also produce an XML output, which you should be able to use to do what you want.</li> </ul> <p><i>Currently I just use it to make it easy to read and write my data structures to a plain text file...</i></p> <p>This is known as serialization. Try <a href="http://www.boost.org/doc/libs/release/libs/serialization/" rel="nofollow noreferrer">Boost.Serialization</a> or maybe <a href="http://www.s11n.net/s11n/" rel="nofollow noreferrer">libs11n</a> or <a href="http://code.google.com/p/protobuf/" rel="nofollow noreferrer">Google Protocol Buffers</a>. <a href="https://stackoverflow.com/questions/tagged/serialization%20c%2b%2b">Stack Overflow</a> has further discussion.</p> <p><i>...but I could do other things as well.</i></p> <p>Other cool applications of this kind of automatic code generation include reflection (inspecting your objects' members at runtime, using <a href="http://en.wikipedia.org/wiki/Duck_typing" rel="nofollow noreferrer">duck typing</a> with C++, etc.) and generating wrappers for calling C++ from scripting languages. For a C++ reflection library, see <a href="http://root.cern.ch/drupal/content/reflex" rel="nofollow noreferrer">Reflex</a>. For an example of generating wrappers for scripting languages, see <a href="http://www.boost.org/doc/libs/release/libs/python/doc/" rel="nofollow noreferrer">Boost.Python</a> or <a href="http://www.swig.org/" rel="nofollow noreferrer">SWIG</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload