[gnu.gcc] protoize and parsing C and C++ headers to Scheme

ham@Neon.Stanford.EDU (Peter R. Ham) (05/30/90)

I'm considering writing a  program that parsed C and
C++ header files and maybe .c files and generated a Scheme description
of them probably in Joel Bartlett's cdecl notation in order to 
facilitate producing interface code for foreign function calling 
interfaces from Scheme. Hopefully, this would help to automate the
process. Is this similar to what Ron Guillmette's "protoize" program 
does using gcc and g++? 

Anybody thought of doing this? If I want to code in Scheme and interface
to Scheme, maybe this would help without being to much work. I would like
to try and make a Scheme->C interface to InterViews (C++ based UII toolkit)
this way?

Impossible? Maybe I could get this to work on some stylized subset of
C++ and C?

--
Peter Ham			PO Box 3430	(h)(415) 322-4390
MS Computer Science Student	Stanford, CA	ham@cs.stanford.edu
Stanford University 		94309		(o)(415) 723-2067

rfg@ics.uci.edu (Ronald Guilmette) (05/30/90)

In article <HAM.90May30000709@Neon.Stanford.EDU> ham@Neon.Stanford.EDU (Peter R. Ham) writes:
>I'm considering writing a  program that parsed C and
>C++ header files and maybe .c files and generated a Scheme description
>of them probably in Joel Bartlett's cdecl notation in order to
>facilitate producing interface code for foreign function calling
>interfaces from Scheme. Hopefully, this would help to automate the
>process. Is this similar to what Ron Guillmette's "protoize" program
>does using gcc and g++?
>
>Anybody thought of doing this? If I want to code in Scheme and interface
>to Scheme, maybe this would help without being to much work. I would like
>to try and make a Scheme->C interface to InterViews (C++ based UII toolkit)
>this way?
>
>Impossible? Maybe I could get this to work on some stylized subset of
>C++ and C?
>
>--
>Peter Ham			PO Box 3430	(h)(415) 322-4390
>MS Computer Science Student	Stanford, CA	ham@cs.stanford.edu
>Stanford University 		94309		(o)(415) 723-2067


When you run GCC (with the protoize patches installed) and use the
-fgen-aux-info option, you will get a set of .X files which contain
function prototypes for the code which you have compiled.  These .X
files may contain material which could possibly be useful to your
project.  Then again, they may not.

You should look at the contents of the .X files to see for yourself
if you can make use of the information there.


// Ron Guilmette (rfg@ics.uci.edu)
// C++ Entomologist
// Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.