1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #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_SUB,
- T_MUL,
- T_DIV,
- T_LESS,
- T_LESS_EQUAL,
- T_GREATER,
- T_GREATER_EQUAL,
- T_EQUAL,
- T_NOT_EQUAL,
- T_NOT,
- T_SET,
- T_LITERAL,
- T_PRINT,
- T_IF,
- 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
|