Tokenizer.h 544 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef TOKENIZER_H
  2. #define TOKENIZER_H
  3. #include <stdbool.h>
  4. typedef enum Token {
  5. T_INT,
  6. T_FLOAT,
  7. T_NULL,
  8. T_TRUE,
  9. T_FALSE,
  10. T_ADD,
  11. T_MUL,
  12. T_PRINT,
  13. T_SEMICOLON,
  14. T_OPEN_BRACKET,
  15. T_CLOSE_BRACKET,
  16. T_END
  17. } Token;
  18. typedef int16_t int16;
  19. bool tTokenize(const char* path);
  20. const char* tGetError();
  21. void tResetReader();
  22. Token tPeekToken();
  23. Token tReadToken();
  24. bool tReadInt(int* i);
  25. bool tReadInt16(int16* i);
  26. bool tReadFloat(float* i);
  27. const char* tGetTokenName(Token token);
  28. void tPrint();
  29. #endif