Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31107

Re: Generating C++ code

Date 2012-10-11 06:00 -0400
From Etienne Robillard <animelovin@gmail.com>
Subject Re: Generating C++ code
References <781541733.3114900.1349797969037.JavaMail.root@sequans.com> <mailman.2008.1349798449.27098.python-list@python.org> <s6ec78h5iq43h3vv6t9lqmohb5ej8pafhv@4ax.com>
Newsgroups comp.lang.python
Message-ID <mailman.2042.1349949642.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, 10 Oct 2012 20:12:36 -0700
Tim Roberts <timr@probo.com> wrote:

> Jean-Michel Pichavant <jeanmichel@sequans.com> wrote:
> >
> >I'm trying to generate C++ code from an XML file. I'd like to use a template engine, which imo produce something readable and maintainable.
> >My google search about this subject has been quite unsuccessful, I've been redirected to template engine specific to html mostly.
> >
> >Does anybody knows a python template engine for generating C++ code ?
> 
> I'm a big fan of Cheetah.  It's simple but flexible enough to be useful.
> Besides the many web projects I've done with it, I also I use it in one
> project to generate PHP code (it generates data access objects from a live
> database schema).
> -- 
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Also take a look at IDL, for a proper way to handle interface generation in C++. No python or cheetah
required as by definition your interfaces should be portable. What your describing is more or less look
like a hack or something which would be a pain to maintain without SWIG or something more suited for
this purposes than XML. 

http://en.wikipedia.org/wiki/Interface_description_language
http://en.wikipedia.org/wiki/SWIG

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Generating C++ code Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-10-09 18:00 +0200
  Re: Generating C++ code Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-10-10 12:47 +0200
  Re: Generating C++ code Tim Roberts <timr@probo.com> - 2012-10-10 20:12 -0700
    Re: Generating C++ code Etienne Robillard <animelovin@gmail.com> - 2012-10-11 06:00 -0400

csiph-web