home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 357_01 / cstar1.exe / GLB.H < prev    next >
C/C++ Source or Header  |  1991-06-18  |  5KB  |  177 lines

  1. /*
  2.     C* -- global header for variables and functions.
  3.  
  4.     Source:  glb.h
  5.     Started: June 20, 1986
  6.     Version: February 20, 1987
  7.  
  8.     PUBLIC DOMAIN SOFTWARE
  9.  
  10.     The CSTAR program was placed in    the public domain on June 15, 1991,
  11.     by its author and sole owner,
  12.  
  13.         Edward K. Ream
  14.         1617 Monroe Street
  15.         Madison, WI 53711
  16.         (608) 257-0802
  17.  
  18.     CSTAR may be used for any commercial or non-commercial purpose.
  19.  
  20.     See cstar.h or cstar.c for a DISCLAIMER OF WARRANTIES.
  21. */
  22.  
  23. /*
  24.     To compile under DRI, change ^void * to byte *
  25.     DRI does not allow a function to return (void *)
  26. */
  27.  
  28. /*
  29.     Constants describing limits.
  30. */
  31. #define MAX_INCLUDE    20    /* Max depth of #include's     */
  32. #define MAX_SYMBOL    1000    /* Max len of symbols/strings.     */
  33. #define MAX_FILE_NAME    200    /* Maximum length of file names. */
  34. #define MAX_IF        50    /* Max nesting level of #if's.     */
  35. #define MAX_EVAL    500    /* Max complexity of #if expr.     */
  36.  
  37.  
  38. /* exclude the rest if glb.c is the lead-in file */
  39. /* this material can easily be prepared by editing glb.c */
  40. #ifndef no_extern
  41.  
  42. /*
  43.     ============= global tables =============
  44. */
  45. extern char *    xzp_tab [];
  46. extern char *    xlentab [];
  47. extern char *    arp_tab [];
  48. extern int    reg_itb[];
  49. extern int    d_rtb[];
  50. extern int    a_rtb[];
  51. extern int    x_rtb[];
  52. extern char *    kp_tab [];
  53.  
  54. /*
  55.     ============= global variables =============
  56. */
  57.  
  58. /*
  59.     The variable ch should be allocated a register if possible.
  60. */
  61. extern unsigned char    ch;        /* The current character.    */
  62.  
  63. extern int    nest_flag;    /* TRUE if comments can nest.    */
  64. extern int    full_c;        /* TRUE if full C allowed.            */
  65. extern int    array_opt;    /* TRUE for strict array subscript handling */ 
  66. extern int    no_local;    /* TRUE to output no local names in ass'y   */
  67.  
  68. extern bool nomacro_flag;
  69. extern bool noparse_flag;
  70. extern bool nogen_flag;
  71. extern bool nopeep_flag;
  72.  
  73. extern bool token_flag;
  74. extern bool tree_flag;
  75. extern bool code1_flag;
  76. extern bool code2_flag;
  77.  
  78. /*
  79.     Globals describing tokens.
  80.  
  81.     The code assumes that no token or string will ever be longer than
  82.     MAX_SYMBOL.  If that ever is not so the program may crash.  Thus,
  83.     MAX_SYMBOL should be very large -- say 1000 or more.
  84. */
  85. extern char    t_symbol [MAX_SYMBOL];    /* The spelling of the token.        */
  86. extern int    t_length;        /* The length of the token (in the text)*/
  87. extern folded    t_value;        /* Value of integer constants.        */
  88. extern int    t_type;            /* The token itself or it's class.    */
  89. extern int    t_subtype;        /* The subtype of token class.        */
  90.  
  91. /*
  92.     The following globals are set ONLY by the system module and
  93.     used by the preprocessor.
  94. */
  95. extern char *    t_file;            /* Name of current input file.    */
  96. extern int    t_line;            /* Line number within file.    */
  97. extern int    t_inlevel;        /* Current input file level.    */
  98.  
  99. /*
  100.     Globals for use internally to the token routines.
  101. */
  102. extern short    t_ifstack [MAX_IF];    /* Stack for nexted #if's    */
  103. extern int    t_iflevel;        /* Nexting depth of #if's    */
  104. extern long    t_errcount;        /* Number of errors seen.    */
  105.  
  106. extern int    t_evalstk [MAX_EVAL];    /* Operator/operand stack.    */
  107. extern int    t_opptr;        /* Operator index to evalstk[].    */
  108. extern int    t_valptr;        /* Operand index to evalstk[].    */
  109.  
  110. extern struct u_node undef_list;    /* Initial undef list for PP.    */
  111.  
  112. /*
  113.     Defines for the path table.
  114.     This table is used to search for #include files.
  115. */
  116. extern char *    paths [MAX_PATHS];    /* Pointers to path names.    */
  117. extern int    n_paths;        /* Number of paths defined.    */
  118.  
  119. /*
  120.     ----- PARSING -----
  121. */
  122.  
  123. /*
  124.     this is just too inconvenient to return as a return-value
  125.     it is needed for code generation
  126. */
  127. extern int call_1arg;        /* Incremented by the parser when it sets up a
  128.                 call to a function having one argument */
  129.  
  130. /*
  131.     ----- CODE GENERATION -----
  132. */
  133. extern int segment;
  134. extern struct node * code_head;    /* Head of list of global code list. */
  135. extern struct node * code_tail;    /* Pointer to last node in list.     */
  136.  
  137. /* fixed nodes set up by g1.c */
  138. extern struct type_node *    byte_type;    /* Fixed byte node for g2.c */
  139. extern struct type_node *    int_type;    /* Fixed int node for g2.c  */
  140. extern struct type_node *    long_type;    /* Fixed long node */
  141.  
  142. extern int cur_lab;    /* Number of the current internal label. */
  143. extern int u_lab;    /* Number of the current user label. */
  144. extern struct scope_node scope;        /* Current scope. */
  145.  
  146. extern int        f_base;        /* See par.c; this has no conceivable 
  147.                             use as an integer */
  148.  
  149. /* these nodes are NOT to be returned by any routine, but only used as
  150.    arguments to g_ routines which guarantee not to change them */
  151.  
  152. extern struct node * a0_loc;
  153. extern struct node * d0_loc;
  154. extern struct node * a6_loc;    /* stack frame  */
  155. extern struct node * a7_loc;    /* stack itself */
  156. extern struct node * sr_loc;    /* sr        */
  157. extern struct node * ccr_loc;    /* ccr        */
  158. extern struct node * push_loc;    /*  *--sp    */
  159. extern struct node * nopush_loc;    /*  *sp        */
  160. extern struct node * pop_loc;    /*  *sp++    */
  161. extern struct node * one_loc;    /* constant 1    */
  162. extern struct node * zero_loc;
  163.  
  164. /*
  165.     ----- PL68K REGISTERS -----
  166. */
  167.  
  168. /* ------ comment out, this is for simulation
  169. extern long d0, d1, d2, d3, d4, d5, d6, d7;
  170. extern char *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *sp;
  171. extern int a0w, a1w, a2w, a3w, a4w, a5w, a6w;
  172. extern char ccr;
  173. extern int ssr, spw;
  174. ------ */
  175.  
  176. #endif /* no_extern */
  177.