12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef TOKENIZER_H
- #define TOKENIZER_H
- #include <stdbool.h>
- #include <stdint.h>
- typedef enum Token {
- T_INT,
- T_FLOAT,
- T_NULL,
- T_TRUE,
- T_FALSE,
- T_ADD,
- T_MUL,
- T_SET,
- T_LITERAL,
- T_PRINT,
- T_FUNCTION,
- T_RETURN,
- T_COMMA,
- T_SEMICOLON,
- T_OPEN_BRACKET,
- T_CLOSE_BRACKET,
- T_OPEN_CURVED_BRACKET,
- T_CLOSE_CURVED_BRACKET,
- T_END
- } Token;
- typedef int16_t int16;
- bool tTokenize(const char* path);
- const char* tGetError();
- void tResetReader();
- Token tPeekToken();
- Token tReadToken();
- bool tReadInt(int* i);
- bool tReadInt16(int16* i);
- bool tReadFloat(float* f);
- const char* tReadString();
- int tGetMarker();
- void tResetToMarker(int marker);
- const char* tGetTokenName(Token token);
- void tPrint();
- #endif
|