Token.h 1.2 KB

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