home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / SOURCE / CGLBDEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  2.0 KB  |  73 lines

  1. /*
  2.  * 68K/386 32-bit C compiler.
  3.  *
  4.  * copyright (c) 1996, David Lindauer
  5.  * 
  6.  * This compiler is intended for educational use.  It may not be used
  7.  * for profit without the express written consent of the author.
  8.  *
  9.  * It may be freely redistributed, as long as this notice remains intact
  10.  * and sources are distributed along with any executables derived from them.
  11.  *
  12.  * The author is not responsible for damages, either direct or consequential,
  13.  * that may arise from use of this software.
  14.  *
  15.  * v1.5 August 1996
  16.  * David Lindauer, gclind01@starbase.spd.louisville.edu
  17.  *
  18.  * Credits to Mathew Brandt for original K&R C compiler
  19.  *
  20.  */
  21. #include        <stdio.h>
  22. #include        "expr.h"
  23. #include        "c.h"
  24. #include        "gen.h"
  25.  
  26. /*      global definitions      */
  27.  
  28. FILE            *inputFile = 0,
  29.                 *listFile = 0,
  30.                 *outputFile = 0,
  31.                                 *cppFile = 0;
  32.  
  33. int                            goodcode = 0;
  34. int             lineno = 0;
  35. int             nextlabel = 0;
  36. int             lastch = 0;
  37. int             lastst = 0;
  38. char            lastid[20] = "";
  39. char            laststr[MAX_STRLEN + 1] = "";
  40. long            ival = 0;
  41. double          rval = 0.0;
  42.  
  43. TABLE           gsyms = {0,0},
  44.                 lsyms = {0,0};
  45. SYM             *lasthead = NULL;
  46. struct slit     *strtab = 0;
  47. long             lc_static = 0;
  48. long             lc_auto = 0;
  49. long                            lc_maxauto = 0;
  50. long                        lc_bss = 0;
  51. struct snode    *bodyptr = 0;
  52. int             global_flag = 1;
  53. TABLE           defsyms = {0,0};
  54. int             save_mask = 0, fsave_mask = 0;          /* register save mask */
  55.  
  56. /* Module init */
  57. void cglbini(void)
  58. {
  59.     goodcode = 0;
  60.     inputFile = listFile = outputFile = cppFile = 0;
  61.     lineno=nextlabel=lastch = lastst = 0;
  62.     lastid[0] = 0;
  63.     laststr[0] = 0;
  64.     ival = 0;
  65.     rval = 0.0;
  66.     gsyms.head =gsyms.tail = lsyms.head = lsyms.tail = defsyms.head = defsyms.tail = 0;
  67.     lasthead = 0;
  68.     strtab = 0;
  69.     lc_static = lc_auto = lc_maxauto = lc_bss = 0;
  70.     bodyptr = 0;
  71.     global_flag = 1;
  72.     save_mask = fsave_mask = 0;
  73. }