home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume5 / smallc / part2 / defs.h next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.9 KB  |  127 lines

  1. /*    File defs.h: 2.1 (83/03/21,02:07:20) */
  2.  
  3.  
  4. #define    FOREVER    for(;;)
  5. #define    FALSE    0
  6. #define    TRUE    1
  7. #define    NO    0
  8. #define    YES    1
  9.  
  10. /* miscellaneous */
  11.  
  12. #define    EOS    0
  13. #define    EOL    10
  14. #define    BKSP    8
  15. #define    CR    13
  16. #define    FFEED    12
  17. #define TAB    9
  18.  
  19. /* symbol table parameters */
  20.  
  21. #define    SYMSIZ    14
  22. #define    SYMTBSZ    2800
  23. #define    NUMGLBS    150
  24. #define    STARTGLB    symtab
  25. #define    ENDGLB    (STARTGLB+NUMGLBS*SYMSIZ)
  26. #define    STARTLOC    (ENDGLB+SYMSIZ)
  27. #define    ENDLOC    (symtab+SYMTBSZ-SYMSIZ)
  28.  
  29. /* symbol table entry format */
  30.  
  31. #define    NAME    0
  32. #define    IDENT    9
  33. #define    TYPE    10
  34. #define    STORAGE    11
  35. #define    OFFSET    12
  36.  
  37. /* system-wide name size (for symbols) */
  38.  
  39. #define    NAMESIZE    9
  40. #define    NAMEMAX    8
  41.  
  42. /* possible entries for "ident" */
  43.  
  44. #define    VARIABLE    1
  45. #define    ARRAY    2
  46. #define    POINTER    3
  47. #define    FUNCTION    4
  48.  
  49. /* possible entries for "type" */
  50.  
  51. #define    CCHAR    1
  52. #define    CINT    2
  53.  
  54. /* possible entries for storage */
  55.  
  56. #define    PUBLIC    1
  57. #define    AUTO    2
  58. #define    EXTERN    3
  59.  
  60. #define    STATIC    4
  61. #define    LSTATIC    5
  62. #define    DEFAUTO    6
  63. /* "do"/"for"/"while"/"switch" statement stack */
  64.  
  65. #define    WSTABSZ    100
  66. #define    WSSIZ    7
  67. #define    WSMAX    ws+WSTABSZ-WSSIZ
  68.  
  69. /* entry offsets in "do"/"for"/"while"/"switch" stack */
  70.  
  71. #define    WSSYM    0
  72. #define    WSSP    1
  73. #define    WSTYP    2
  74. #define    WSCASEP    3
  75. #define    WSTEST    3
  76. #define    WSINCR    4
  77. #define    WSDEF    4
  78. #define    WSBODY    5
  79. #define    WSTAB    5
  80. #define    WSEXIT    6
  81.  
  82. /* possible entries for "wstyp" */
  83.  
  84. #define    WSWHILE    0
  85. #define    WSFOR    1
  86. #define    WSDO    2
  87. #define    WSSWITCH    3
  88.  
  89. /* "switch" label stack */
  90.  
  91. #define    SWSTSZ    100
  92.  
  93. /* literal pool */
  94.  
  95. #define    LITABSZ    2000
  96. #define    LITMAX    LITABSZ-1
  97.  
  98. /* input line */
  99.  
  100. #define    LINESIZE    150
  101. #define    LINEMAX    (LINESIZE-1)
  102. #define    MPMAX    LINEMAX
  103.  
  104. /* macro (define) pool */
  105.  
  106. #define    MACQSIZE    1000
  107. #define    MACMAX    (MACQSIZE-1)
  108.  
  109. /* "include" stack */
  110.  
  111. #define    INCLSIZ    3
  112.  
  113. /* statement types (tokens) */
  114.  
  115. #define    STIF    1
  116. #define    STWHILE    2
  117. #define    STRETURN    3
  118. #define    STBREAK    4
  119. #define    STCONT    5
  120. #define    STASM    6
  121. #define    STEXP    7
  122. #define    STDO    8
  123. #define    STFOR    9
  124. #define    STSWITCH    10
  125.  
  126. #define    DEFLIB    inclib()
  127.