home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 319_01 / glb.c < prev    next >
C/C++ Source or Header  |  1990-06-18  |  2KB  |  81 lines

  1. /*
  2.     CPP V5 -- global variable definitions.
  3.  
  4.     Source:  glb.c
  5.     Started: April 2, 1986
  6.     Version: January 20, 1988; May 21, 1988
  7.  
  8.     Written by Edward K. Ream.
  9.     This software is in the public domain.
  10.  
  11.     See the read.me file for disclaimer and other information.
  12. */
  13. #define no_extern 1
  14. #include "cpp.h"
  15.  
  16. /*
  17.     ========= increase stack size ========
  18. */
  19. #ifdef TURBOC
  20. extern unsigned _stklen = 0xf000;
  21. #endif
  22.  
  23. /*
  24.     ========= global variables =========
  25. */
  26.  
  27. /*
  28.     The variable ch should be allocated a register if possible.
  29. */
  30. char     ch = '@';        /* The NEXT character.            */
  31.  
  32. /*
  33.     User options.
  34. */
  35. bool    nest_flag = FALSE;    /* TRUE = allow nested comments.    */
  36. bool    com_flag = FALSE;    /* TRUE = leave comments in output.    */
  37. bool    slc_flag = TRUE;    /* TRUE = allow single-line comments.    */
  38.  
  39. /*
  40.     ----- PREPROCESSOR AND TOKENS -----
  41. */
  42. bool    m_flag    = FALSE;    /* TRUE if expanding a macro.    */
  43. char    macro_buf[MAX_RTEXT];    /* Final macro buffer.        */
  44. char *    p_rescan;        /* Pointer into rescan_buf[].    */
  45.  
  46. long    t_errcount = 0;        /* Number of errors seen.        */
  47.  
  48. /*
  49.     The code assumes that no token or string will ever be longer than
  50.     MAX_SYMBOL.  If that ever is not so the program may crash.  Thus,
  51.     MAX_SYMBOL should be very large -- say 1000 or more.
  52. */
  53. en_tokens
  54.     token = NULL_TOK;    /* The token itself or it's class.    */
  55. char    t_symbol [MAX_SYMBOL];    /* The spelling of the token.        */
  56. int    t_length;        /* The length of the token (in the text)*/
  57. long    t_value;        /* Value of integer constants.        */
  58. int    t_subtype;        /* The subtype of token class.        */
  59.  
  60. /*
  61.     The following globals are set ONLY by the system module.
  62.     They are picked up and used by the preprocessor and the
  63.     parser.
  64. */
  65. char *    t_file    = NULL;    /* Name of current input file.    */
  66. int    t_line    = 0;        /* Line number within file.    */
  67. int    t_inlevel = -1;        /* Current input file level.    */
  68.  
  69. /*
  70.     Globals for use internally to the token routines.
  71. */
  72. bool    t_ifstack [MAX_IF];    /* Stack for nexted #if's    */
  73. int    t_iflevel  = 0;        /* Nesting depth of #if's    */
  74.  
  75. /*
  76.     Defines for the path table.
  77.     This table is used to search for #include files.
  78. */
  79. char *    paths [MAX_PATHS];    /* Pointers to path names.    */
  80. int    n_paths = 0;        /* Number of paths defined.    */
  81.