Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>See <a href="http://homepage.mac.com/s_lott/iblog/architecture/C20071019092637/E20080830091128/index.html" rel="nofollow noreferrer">Tooling to Build Test Cases</a>.</p> <p>It's not clear what your problem is.</p> <p>If you question is "how do I handle all the special cases in my generating classes?" then here's some advice. If your question is something else, then update your question.</p> <ol> <li><p>Use a template generator. <a href="http://www.makotemplates.org/" rel="nofollow noreferrer">Mako</a>, for example, will make your life simpler.</p> <p>Write an example of your result. Replace parts with <code>${thing}</code> placeholders. Since you started with something that worked, turning it into a template is easy.</p></li> <li><p>When generating code in another language, you need to have all of the class definitions in other other language designed for flexible assembly. You want to generate as little fresh, new code as possible. You want to tweak and customize a bit, but you don't want to generate a lot of stuff from scratch.</p></li> <li><p>Special cases are best handled with ordinary polymorphism. Separate subclasses of a common superclass can implement the various exceptions and special cases. Really complex situations are handled well by the <strong>Strategy</strong> design pattern. </p> <p>In essence, you have Python classes that represent the real-world objects. Those classes have attributes that can be fit into a C++ template to generate the C++ version of those objects. </p></li> </ol>
 

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