Tokenizer.h 493 B

12345678910111213141516171819202122232425262728293031323334
  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. bool tTokenize(const char* path);
  19. const char* tGetError();
  20. void tResetReader();
  21. Token tPeekToken();
  22. Token tReadToken();
  23. bool tReadInt(int* i);
  24. bool tReadFloat(float* i);
  25. const char* tGetTokenName(Token token);
  26. void tPrint();
  27. #endif