home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 163_01 / cc.def < prev    next >
Text File  |  1991-01-06  |  4KB  |  166 lines

  1. /*
  2. ** Small-C Compiler Version 2.0
  3. **
  4. ** Portions Copyright 1982 J. E. Hendrix
  5. **
  6. ** Converted to 8088/PCDOS by D. R. Hicks, et al
  7. ** Symbol tables modified for up to 2-D  - D. Lang
  8. **
  9. ** Macro Definitions
  10. */
  11.  
  12. /*
  13. ** compile options
  14. */
  15. #define SEPARATE    /* compile separately                    */
  16. /* #define NOCCARGC /* no calls to CCARGC                    */
  17. /* #define HASH     /* use hash search for macros            */
  18. #define CMD_LINE    /* comand line run option                */
  19. /* #define DYNAMIC  /* allocate memory dynamically           */
  20. #define TAB  9      /* put out tabs of this value            */
  21. #define UPPER       /* force symbols to upper case           */
  22.  
  23. /*
  24. ** machine dependent parameters
  25. */
  26. #define BPW      2  /* bytes per word                        */
  27. #define LBPW     1  /* log2(BPW)                             */
  28. #define SBPC     1  /* stack bytes per character             */
  29. #define STKFRSZ  4  /* stack frame header size in bytes      */
  30. #define ERRCODE  errno /* I/O system error code              */
  31.  
  32. /*
  33. **    symbol table format
  34. */
  35. #define IDENT       0
  36. #define TYPE        1
  37. #define CLASS       2
  38. #define STATUS      3
  39. #define OFFSET      4
  40. #define NDIM        6    /* Number of dimensions if array */
  41. #define CDIM        7    /* Size of the column dimension  */
  42. #define NAME        9
  43. #define OFFSIZE     (NDIM-OFFSET)
  44. #define SYMAVG      14
  45. #define SYMMAX      18
  46.  
  47. /*
  48. **    symbol table parameters
  49. */
  50. #define NUMLOCS     50 /* room for 50 locals (up from 25) */
  51. #define STARTLOC    symtab
  52. #define ENDLOC      (symtab+(NUMLOCS*SYMAVG))
  53. #define NUMGLBS     210         /* was 200 */
  54. #define STARTGLB    ENDLOC
  55. #define ENDGLB      (ENDLOC+((NUMGLBS-1)*SYMMAX))
  56. #define SYMTBSZ     NUMLOCS*SYMAVG + NUMGLBS*SYMMAX
  57.  
  58. /*
  59. ** System wide name size   (for symbols )
  60. */
  61. #define NAMESIZE    9
  62. #define NAMEMAX     8
  63.  
  64. /*
  65. ** possible entries for "IDENT"
  66. */
  67. #define LABEL       0
  68. #define VARIABLE    1
  69. #define ARRAY       2
  70. #define POINTER     3
  71. #define FUNCTION    4
  72.  
  73. /*
  74. ** possible entries for "TYPE"
  75. **    low order 2 bits make type unique within length
  76. **    high order 2 bits give length of object
  77. */
  78. /*      LABEL       0              */
  79. #define CCHAR       (1<<2)
  80. #define CINT        (BPW<<2)
  81.  
  82. /*
  83. ** possible entries for "CLASS"
  84. */
  85. /*      LABEL       0              */
  86. #define STATIC      1
  87. #define PUBLIC      2
  88. #define EXTERNAL    3
  89. #define AUTOMATIC   4
  90.  
  91. /*
  92. ** possible entries for "STATUS" (bit significant)
  93. */
  94. #define DECLARED    128        /* symbol is explicitly declared */
  95. #define USED        64         /* symbol is referenced */
  96.  
  97. /*
  98. **  "switch" table
  99. */
  100. #define SWSIZ       (2*BPW)
  101. #define SWTABSZ     (25*SWSIZ)
  102.  
  103. /*
  104. ** "while" statement queue
  105. */
  106. #define WQTABSZ     30
  107. #define WQSIZ        3
  108. #define WQMAX       (wq+WQTABSZ-WQSIZ)
  109.  
  110. /*
  111. ** entry offsets in while queue
  112. */
  113. #define WQSP        0
  114. #define WQLOOP      1
  115. #define WQEXIT      2
  116.  
  117. /*
  118. **  literal pool
  119. */
  120. #define LITABSZ     700
  121. #define LITMAX      (LITABSZ-1)
  122.  
  123. /*
  124. **  input line
  125. */
  126. #define LINEMAX     160
  127. #define LINESIZE    161
  128.  
  129. /*
  130. ** output staging buffer size
  131. */
  132. #define STAGESIZE   1500
  133. #define STAGELIMIT  (STAGESIZE-1)
  134.  
  135. /*
  136. **  macro (define) pool
  137. */
  138. #ifdef HASH
  139. #define MACNBR      90
  140. #define MACNSIZE    990      /* 90*(NAMESIZE+2)  */
  141. #define MACNEND     (macn+MACNSIZE)
  142. #define MACQSIZE    450      /* 90*5             */
  143. #else
  144. #define MACQSIZE    1250
  145. #endif
  146. #define MACMAX      (MACQSIZE-1)
  147.  
  148. /*
  149. **  statement types
  150. */
  151. #define STIF        1
  152. #define STWHILE     2
  153. #define STRETURN    3
  154. #define STBREAK     4
  155. #define STCONT      5
  156. #define STASM       6
  157. #define STEXPR      7
  158. #define STDO        8    /* compile "do" logic      */
  159. #define STFOR       9    /* compile "for" logic     */
  160. #define STSWITCH    10   /* compile "switch/case/default" logic */
  161. #define STCASE      11
  162. #define STDEF       12
  163. #define STGOTO      13   /* compile "goto" logic    */
  164.  
  165.  
  166.