home *** CD-ROM | disk | FTP | other *** search
- /*
- * 68K/386 32-bit C compiler.
- *
- * copyright (c) 1996, David Lindauer
- *
- * This compiler is intended for educational use. It may not be used
- * for profit without the express written consent of the author.
- *
- * It may be freely redistributed, as long as this notice remains intact
- * and sources are distributed along with any executables derived from them.
- *
- * The author is not responsible for damages, either direct or consequential,
- * that may arise from use of this software.
- *
- * v1.5 August 1996
- * David Lindauer, gclind01@starbase.spd.louisville.edu
- *
- * Credits to Mathew Brandt for original K&R C compiler
- *
- */
- #include <stdio.h>
- #include "expr.h"
- #include "c.h"
- #include "gen.h"
-
- /* global definitions */
-
- FILE *inputFile = 0,
- *listFile = 0,
- *outputFile = 0,
- *cppFile = 0;
-
- int goodcode = 0;
- int lineno = 0;
- int nextlabel = 0;
- int lastch = 0;
- int lastst = 0;
- char lastid[20] = "";
- char laststr[MAX_STRLEN + 1] = "";
- long ival = 0;
- double rval = 0.0;
-
- TABLE gsyms = {0,0},
- lsyms = {0,0};
- SYM *lasthead = NULL;
- struct slit *strtab = 0;
- long lc_static = 0;
- long lc_auto = 0;
- long lc_maxauto = 0;
- long lc_bss = 0;
- struct snode *bodyptr = 0;
- int global_flag = 1;
- TABLE defsyms = {0,0};
- int save_mask = 0, fsave_mask = 0; /* register save mask */
-
- /* Module init */
- void cglbini(void)
- {
- goodcode = 0;
- inputFile = listFile = outputFile = cppFile = 0;
- lineno=nextlabel=lastch = lastst = 0;
- lastid[0] = 0;
- laststr[0] = 0;
- ival = 0;
- rval = 0.0;
- gsyms.head =gsyms.tail = lsyms.head = lsyms.tail = defsyms.head = defsyms.tail = 0;
- lasthead = 0;
- strtab = 0;
- lc_static = lc_auto = lc_maxauto = lc_bss = 0;
- bodyptr = 0;
- global_flag = 1;
- save_mask = fsave_mask = 0;
- }