2009/9/26 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
Sig,
Is it something you have made available? Â One snag in my world is that the "code" is not always something that can be compiled. Â However, for GSL and other libraries of interest, the code is valid, if not full of macro-based annoyances and other distractions.
the code i written is the module to SWIG. The project what i developed once is to write a smalltalk interpreter by own, and the aim was to use it as a scripting engine for C++ projects. My experiments stopped shortly after i understood that my interpreter implementation having some flaws and i need to spend much time to rewrite everything :) But, along the way, i started making bindings to Ogre 3D engine (http://www.ogre3d.org/) and my SWIG-based binding code generator were able to reflect C++ classes in my own smalltalk, including being able to call constructors/destructors, methods and directly access the fields by using auto-generated primives. If you wanna to get deeper into that, i can send you the sources and examples. With a little effort, the code generation could be easily changed to satisfy the FFI/Alien demands, then you will be able to bind any C library with Squeak VM.
Bill
-----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Igor Stasenko Sent: Friday, September 25, 2009 11:03 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] CAnalyer
2009/9/26 Schwab,Wilhelm K <bschwab@anest.ufl.edu>:
I was digging around on Squeak Source for OSProcess and friends, and ran across CAnalyzer. Â Are there any papers on it? Â How robust is it? Â What does it extract from C code? Â For example, might one put the GSL (www.gnu.org/software/gsl) header files into it, pull out all of the structure definitions and function prototypes, and generate LOTS of FFI code to make a wrapper? Â Just a thought...
I having a modified version of SWIG, which can parse C++ files, including classes and nested classes, to produce smalltalk code wrappers.
Reproducing the SWIG in smalltalk would be very time consuming. But it would be cool to have a C/C++ parser implementation.
SWIG is not only parsing, its also doing macro preprocessing, so its can't be fooled with macros :)
Bill
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.