[alt.sources] C/C++ interpreter generator

anderson@snow.Berkeley.EDU (David Anderson) (11/21/90)

I need a program that, given some C functions, generates
an "interpreter" that lets you interactively invoke the functions
with arbitrary arguments.  (I hope to avoid writing such a program myself).
In other words, given as input a C program containing
	int foo(int, char);
	float blah();
	...
it would generate a program like
	main() {
		for (;;) {
			gets(buf);
			name = strtok(buf, " (");
			if (strcmp(name, "foo") == 0) {
				scanf(..., &n, &c);
				i = foo(n, c);
				printf("%d", i);
			}
			if (strcmp(name, "blah" == 0) {
				...
Sort of a poor man's Sabre C.
If you know of something along these lines, please send me email.
(A similar thing for C++ would be even nicer).

David Anderson
anderson@snow.Berkeley.EDU