home *** CD-ROM | disk | FTP | other *** search
-
- /* xlisp - a small subset of lisp */
-
- #ifdef CI_86
- #include "A:STDIO.H"
- #include "xlisp.h"
- #endif
-
- #ifdef AZTEC
- #include "a:stdio.h"
- #include "a:setjmp.h"
- #include "xlisp.h"
- #endif
-
- #ifdef DECUS
- #include <stdio.h>
- #include <setjmp.h>
- #include <xlisp.h>
- #endif
-
- /* External variables */
-
- extern struct node *xlenv;
- extern struct node *xlstack;
- extern int xlpvals;
-
- /* Local variables */
-
- static char ljmp[6];
-
- /**************************
- * main - the main routine *
- **************************/
-
- main(argc,argv)
- int argc; char *argv[];
- {
- struct node expr;
-
- xldmeminit(); /* initialize the dynamic memory module */
- /* (must be first initilization call */
- #ifdef DEBUG
- xldebuginit();
- #endif
- /* initialize each lisp module */
- xlinit();
- xleinit();
- xllinit();
- xlminit();
- xloinit();
- xlsinit();
- xlfinit();
- xlpinit();
-
- #ifdef KEYMAPCLASS
- xlkinit();
- #endif
-
- xltin(FALSE);
-
- if (argc > 1) /* read the input file if specified */
- xlfin(argv[1]);
- else
- printf("XLISP version 1.2\n");
-
- setjmp(ljmp); /* Set up the error return */
- while (TRUE) /* Main command processing loop */
- {
- xlstack = xlenv = NULL; /* Free any previous expression and */
- /* left over context */
-
- xlsave(&expr,NULL); /* create a new stack frame */
-
- expr.n_ptr = xlread(); /* Read and evaluate an expression */
- expr.n_ptr = xleval(expr.n_ptr);
-
- if (xlpvals) /* print it if necessary */
- {
- xlprint(expr.n_ptr, TRUE);
- putchar('\n');
- }
- }
- }
-
-
- xlabort()
- {
- /* Procedure to localize machine dependent abort jump */
-
- longjmp(ljmp);
- }