hi there,

say I have a way to automatically generate a json structure
representing C++ classes, functions,... (the code to do so uses gccxml[0]
and Reflex[1]. once I migrated it to use the new gcc-4.5 plugin
architecture and/or clang, I'll release it under a BSD-like licence)

this json structure looks like so for the moment (from cython C++
test-case class):

{'bases': [],
 'dso': 'libFoo.so',
 'members': [{'name': 'number', 'offset': 0L, 'size': 8, 'type':
 'double'}],
 'methods': [{'args': [],
              'doc': '',
              'name': '~DoubleKeeper',
              'prototype': 'void DoubleKeeper::~DoubleKeeper()',
              'return': 'void'},
             {'args': [{'default': None,
                        'name': None,
                        'type': 'const DoubleKeeper&'}],
              'doc': '',
              'name': 'operator=',
              'prototype': 'DoubleKeeper& DoubleKeeper::operator=(const 
DoubleKeeper& )',
              'return': 'DoubleKeeper&'},
             {'args': [{'default': None,
                        'name': None,
                        'type': 'const DoubleKeeper&'}],
              'doc': '',
              'name': 'DoubleKeeper',
              'prototype': 'DoubleKeeper DoubleKeeper::DoubleKeeper(const 
DoubleKeeper& )',
              'return': 'DoubleKeeper'},
             {'args': [{'default': None,
                        'name': 'number',
                        'type': 'double'}],
              'doc': '',
              'name': 'DoubleKeeper',
              'prototype': 'DoubleKeeper DoubleKeeper::DoubleKeeper(double 
number)',
              'return': 'DoubleKeeper'},
             {'args': [{'default': None, 
                        'name': 'num', 
                        'type': 'double'}],
              'doc': '',
              'name': 'set_number',
              'prototype': 'void DoubleKeeper::set_number(double num)',
              'return': 'void'},
             {'args': [],
              'doc': '',
              'name': 'get_number',
              'prototype': 'double DoubleKeeper::get_number()',
              'return': 'double'},
             {'args': [{'default': None, 
                        'name': 'value', 
                        'type': 'double'}],
              'doc': '',
              'name': 'transmogrify',
              'prototype': 'double DoubleKeeper::transmogrify(double value)',
              'return': 'double'}],
 'name': 'DoubleKeeper',
 'size': 12,
 'typeinfo': '12DoubleKeeper'}

which should be more or less self-describing.

I am wondering if there is an API or a facility to write the
corresponding .pxd file ?

cheers,
sebastien.

[0]: http://www.gccxml.org/HTML/Index.html
[1]: http://root.cern.ch/drupal/content/reflex
-- 
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to