Token.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef TOKEN_H
  2. #define TOKEN_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. typedef enum {
  7. T_VOID,
  8. T_INT32,
  9. T_INT64,
  10. T_BOOL,
  11. T_FLOAT,
  12. T_CONST_INT32,
  13. T_CONST_INT64,
  14. T_CONST_FLOAT,
  15. T_TEXT,
  16. T_NULLPTR,
  17. T_TRUE,
  18. T_FALSE,
  19. T_ADD,
  20. T_SUB,
  21. T_MUL,
  22. T_DIV,
  23. T_MOD,
  24. T_LESS,
  25. T_LESS_EQUAL,
  26. T_GREATER,
  27. T_GREATER_EQUAL,
  28. T_EQUAL,
  29. T_NOT_EQUAL,
  30. T_NOT,
  31. T_AND,
  32. T_OR,
  33. T_BIT_NOT,
  34. T_BIT_AND,
  35. T_BIT_OR,
  36. T_BIT_XOR,
  37. T_LEFT_SHIFT,
  38. T_RIGHT_SHIFT,
  39. T_SET,
  40. T_ADD_SET,
  41. T_SUB_SET,
  42. T_MUL_SET,
  43. T_DIV_SET,
  44. T_MOD_SET,
  45. T_BIT_AND_SET,
  46. T_BIT_OR_SET,
  47. T_BIT_XOR_SET,
  48. T_LEFT_SHIFT_SET,
  49. T_RIGHT_SHIFT_SET,
  50. T_INCREMENT,
  51. T_DECREMENT,
  52. T_LITERAL,
  53. T_IF,
  54. T_ELSE,
  55. T_WHILE,
  56. T_FOR,
  57. T_BREAK,
  58. T_CONTINUE,
  59. T_RETURN,
  60. T_STRUCT,
  61. T_COMMA,
  62. T_SEMICOLON,
  63. T_OPEN_BRACKET,
  64. T_CLOSE_BRACKET,
  65. T_OPEN_CURVED_BRACKET,
  66. T_CLOSE_CURVED_BRACKET,
  67. T_POINT,
  68. T_ARROW,
  69. T_OPEN_SQUARE_BRACKET,
  70. T_CLOSE_SQUARE_BRACKET,
  71. T_NEW,
  72. T_DELETE,
  73. T_LENGTH,
  74. T_CONST,
  75. T_END
  76. } Token;
  77. const char* tGetName(Token token);
  78. Token tFromName(const char* name);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif