Token.h 1.1 KB

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