home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 018.lha / sources / drive.h < prev    next >
C/C++ Source or Header  |  1986-10-19  |  2KB  |  99 lines

  1. /*
  2.     Little Smalltalk
  3.  
  4.         defines used by both parser and driver
  5.  
  6. */
  7.  
  8. # define TWOBIT         0
  9. # define PUSHINSTANCE   1
  10. # define PUSHTEMP       2
  11. # define PUSHLIT        3
  12. # define PUSHCLASS      4
  13. # define PUSHSPECIAL    5
  14. # define POPINSTANCE    6
  15. # define POPTEMP        7
  16. # define SEND           8
  17. # define SUPERSEND      9
  18. # define UNSEND        10
  19. # define BINSEND       11
  20. # define ARITHSEND     12
  21. # define KEYSEND       13
  22. # define BLOCKCREATE   14
  23. # define SPECIAL       15
  24.  
  25. /* arguments for special */
  26.  
  27. # define NOOP           0
  28. # define DUPSTACK       1
  29. # define POPSTACK       2
  30. # define RETURN         3
  31. # define BLOCKRETURN    4
  32. # define SELFRETURN     5
  33. # define SKIPTRUEPUSH   6
  34. # define SKIPFALSEPUSH  7
  35. # define SKIPFORWARD    8
  36. # define SKIPBACK       9
  37. # define PRIMCMD       10
  38. # define SKIPT         11
  39. # define SKIPF         12
  40.  
  41. /* enum pseuvars {nilvar, truevar, falsevar, selfvar, supervar, smallvar,
  42.         procvar};*/
  43. #define nilvar 0
  44. #define truevar 1
  45. #define falsevar 2
  46. #define selfvar 3
  47. #define supervar 4
  48. #define smallvar 5
  49. #define procvar 6
  50.  
  51. # define streq(a,b) (strcmp(a,b) == 0)
  52.  
  53. /* only include driver code in driver, keeps both lint and the 11/70 quiet */
  54. # ifdef DRIVECODE
  55.  
  56. /* enum lextokens { nothing, LITNUM , LITFNUM , LITCHAR , LITSTR , LITSYM , 
  57.     LITARR , LITBYTE , ASSIGN , BINARY , PRIMITIVE , PSEUDO , 
  58.     UPPERCASEVAR , LOWERCASEVAR , COLONVAR , KEYWORD ,
  59.      LP , RP , LB , RB , PERIOD , BAR , SEMI , PS , MINUS , PE , NL }; */
  60.  
  61. #define nothing 0
  62. #define LITNUM 1
  63. #define LITFNUM  2
  64. #define LITCHAR 3
  65. #define LITSTR 4
  66. #define LITSYM 5
  67. #define LITARR 6
  68. #define LITBYTE 7
  69. #define ASSIGN 8
  70. #define BINARY 9
  71. #define PRIMITIVE 10
  72. #define PSEUDO 11
  73. #define UPPERCASEVAR 12
  74. #define LOWERCASEVAR 13
  75. #define COLONVAR 14
  76. #define KEYWORD 15
  77. #define LP 16
  78. #define RP 17
  79. #define LB 18
  80. #define RB 19
  81. #define PERIOD 20
  82. #define BAR 21
  83. #define SEMI 22
  84. #define PS 23
  85. #define MINUS 24
  86. #define PE 25
  87. #define NL 26
  88.  
  89. typedef union  {
  90.     char         *c;
  91.     double          f;
  92.     int           i;
  93.     /* enum pseuvars */ int      p;
  94.     } tok_type;
  95.  
  96. extern tok_type t;
  97.  
  98. # endif
  99.