home *** CD-ROM | disk | FTP | other *** search
- From: anderson@snow.Berkeley.EDU (David Anderson)
- Newsgroups: alt.sources,comp.unix.programmer
- Subject: C/C++ interpreter generator (query)
- Message-ID: <39685@ucbvax.BERKELEY.EDU>
- Date: 21 Nov 90 07:21:50 GMT
-
- 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
-