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 / CSTAR.H < prev    next >
C/C++ Source or Header  |  1991-06-18  |  5KB  |  186 lines

  1. /*
  2.     C* -- Main header file.
  3.  
  4.     Source:  cstar.h
  5.     Started: September 20, 1985
  6.     Version:
  7.         January 28, 1987
  8.         February 19, 1989
  9.             include sherlock.h instead of bug.h
  10.             always include enum.h, never cpptok.h
  11.         March 7, 1989
  12.             Eliminate CPMEOF, YES, NO.
  13.  
  14.     PUBLIC DOMAIN SOFTWARE
  15.  
  16.     The CSTAR program was placed in    the public domain on June 15, 1991,
  17.     by its author and sole owner,
  18.  
  19.         Edward K. Ream
  20.         1617 Monroe Street
  21.         Madison, WI 53711
  22.         (608) 257-0802
  23.  
  24.     CSTAR may be used for any commercial or non-commercial purpose.
  25.  
  26.     DISCLAIMER OF WARRANTIES
  27.  
  28.     Edward K. Ream (Ream) specifically disclaims all warranties,
  29.     expressed or implied, with respect to this computer software,
  30.     including but not limited to implied warranties of merchantability
  31.     and fitness for a particular purpose.  In no event shall Ream be
  32.     liable for any loss of profit or any commercial damage, including
  33.     but not limited to special, incidental consequential or other damages.
  34. */
  35.  
  36. /*
  37.     System interface characteristics compiler is to be compiled for.
  38.     These should be defined on the compiler command line.
  39.  
  40.     MICRO_SOFT    use MicroSoft C V5.1
  41.     TURBOC        use Turbo C V1.5
  42.  
  43.     DO_STATS        Gather statistics at run time.
  44.     DEBUG        Make run-time checks.
  45.     STD_DIR        Name of first standard directory.
  46. */
  47. #define DEBUG    1
  48.  
  49. /*
  50.     Memory management characteristics; use multiples of long size!
  51.  
  52.     DATA_SIZE    Size in bytes of data portion of allocation blocks
  53.  
  54.     IDATA_SIZE    Size in bytes of data portion of largest initializer
  55.                 block.  Setting too small proliferates blocks;
  56.                 setting too large may cause incomplete
  57.                 initializers to chew up memory.
  58. */
  59. #define DATA_SIZE 2048
  60. #define IDATA_SIZE 10
  61.  
  62. /*
  63.     Properties of compiler under which this is to be compiled:
  64.  
  65.     INT_DIGITS     number of digits in an int, plus 5
  66.     LONG_DIGITS
  67.     CHAR_SIZE    bytes in a char, as supported by compiler
  68.     SHORT_SIZE
  69.     INT_SIZE
  70.     LONG_SIZE
  71.     POINTER_SIZE
  72. */
  73. #define INT_DIGITS 10
  74. #define LONG_DIGITS 15
  75. #define CHAR_SIZE 1
  76. #define SHORT_SIZE 2
  77. #define INT_SIZE 2
  78. #define INT_MAX 32767
  79. #define    UINT_MAX 65535
  80. #define LONG_SIZE 4
  81. #define POINTER_SIZE 4
  82.  
  83. /*
  84.  
  85.     ASCRATCH    highest scratch register that is saved when a
  86.     DSCRATCH    function is called; set to -1 if no registers
  87.             are saved and functions are totally responsible
  88.             for preserving registers
  89.  
  90.     A_ALLOC        lowest register that may be allocated as a local
  91.     D_ALLOC        register variable. this ought not to overlap
  92.             with the SCRATCH designation.
  93.  
  94.     D0_ONLY        define this to use d0 only as the function
  95.             return interface; otherwise a0 is for non-integers
  96.  
  97.     EXCESSLENOK    0 or 1
  98.  
  99.             0: register variables treated strictly as to length
  100.                This will sometimes cause extra moves to be done
  101.                to avoid clobbering upper portions, as in
  102.                multiplication, and will prevent the use of, for
  103.                example, moveq.l, which is faster and more
  104.                compact, when move.w # is what is literally meant.
  105.  
  106.             1: upper portions of register variables may be
  107.                clobbered as a result of C-language operations.
  108.                (pseudo functions always do whatever they do.)
  109.                For example, a5w *= 30 may be done in a5
  110.                even though this clobbers the upper half of a5.
  111.                This is certainly the recommended setting,
  112.                since under circumstances where it is obligatory
  113.                to preserve the upper half, the pseudo operations
  114.                usually are better documentation of what is
  115.                going on, and in general it produces better code.
  116.  
  117.     SC_STICKY: 0 or 1
  118.  
  119.             0: const and volatile do not stick to structure/
  120.                union tags, although they do stick to typedefs and
  121.                individual structure/union elements
  122.  
  123.             1: const and volatile do stick to structure/union
  124.                tags as well as typedefs and elements
  125. */
  126.  
  127. #define ASCRATCH 1
  128. #define DSCRATCH 2
  129. #define A_ALLOC 2
  130. #define D_ALLOC 3
  131. #define D0_ONLY 1
  132. #define SC_STICKY 0
  133. #define EXCESSLENOK 1
  134.  
  135.  
  136. /*
  137.     Maximum number of search paths.  Should not be here??
  138. */
  139. #define MAX_PATHS 20
  140.  
  141. /*
  142.     Miscellaneous global constants.
  143. */
  144. #define ZERO    0
  145. #define TRUE    (1)
  146. #define FALSE    (0)
  147. #define END_FILE    0x1a
  148. #define ERROR        -1
  149.  
  150. #define CAST(type) (type)
  151.  
  152. #define FALL_THROUGH    0L
  153. #define LOCAL_LAB    1
  154. #define GLOBAL_LAB    2
  155.  
  156. /* definitions for OBJECTS IN THE COMPILER (as opposed to in the target code) */
  157. typedef int bool;
  158. typedef char byte;    /* object such that sizeof(object) is 1 */
  159. typedef short int word;    /* object such that sizeof(object) is 2 */
  160.             /* long is widely assumed to have size 4; anything
  161.                 shorter won't function for many reasons */
  162. typedef long folded;    /* see lint.doc */
  163.  
  164. #ifdef MICRO_SOFT
  165. #define FAR far
  166. #else
  167. #define FAR
  168. #endif
  169.  
  170. #include "sl.h"
  171. #include "enum.h"
  172. #include "node.h"
  173. #include "glb.h"
  174. #include "tmp.h"
  175. #include "stdio.h"
  176. #include "stdlib.h"
  177.  
  178. /*
  179.     ----------    PREPROCESSOR    ----------
  180. */
  181. #define isdigit(c) (c <= '9' && c >= '0')
  182. #define isalpha(c) (c >= 'A' && (c <= 'Z' || (c >= 'a' && c <= 'z')))
  183. #define ishex(c) (isdigit(c) || (c >= 'A' && (c <= 'F' || (c>='a' && c<='f')))
  184. #define isid1(c) (isalpha(c) || c == '_')
  185. #define isid2(c) (isalpha(c) || isdigit(c) || c == '_')
  186.