1 /* Loglan82 Compiler&Interpreter
2 Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw
3 Copyright (C) 1993, 1994 LITA, Pau
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
16 =======================================================================
24 Define WSIZE to 2 or 4 !
27 char blank_[ (unsigned long)( 302 + LMEMSIZE ) * WSIZE ]; /* whole memory of compiler */
35 #define SIGIOT SIGTRAP
42 static void sigdie(s, kill) register char *s; int kill; {
43 /* print error message, then clear buffers */
46 fprintf(stderr, "%s\n", s);
58 static void sigfdie(n){ sigdie("Floating Exception", 1);}
59 static void sigidie(n){ sigdie("IOT Trap", 1); }
60 static void sigqdie(n){ sigdie("Quit signal", 1); }
61 static void signdie(n){sigdie("Interrupt", 0); }
62 static void sigtdie(n){ sigdie("Killed", 0); }
65 int main(argc, argv) int argc; char **argv; {
70 signal(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
71 signal(SIGIOT, sigidie);
73 if( (int)signal(SIGQUIT,sigqdie) & 01) signal(SIGQUIT, SIG_IGN);
75 if( (int)signal(SIGINT, signdie) & 01) signal(SIGINT, SIG_IGN);
76 signal(SIGTERM,sigtdie);
79 ldfps(01200); /* detect overflow as an exception */
83 for (i = 1; i < argc; i++)
85 strcat( parbuf, " " );
86 strcat( parbuf, argv[i] );
88 parlen = strlen(parbuf);
89 loglan_( &parlen, parbuf );