C/C++ interpreter generator (query)

David Anderson anderson at snow.Berkeley.EDU
Wed Nov 21 18:21:50 AEST 1990


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 at snow.Berkeley.EDU



More information about the Comp.unix.programmer mailing list