#ifndef LEXER_H #define LEXER_H #include typedef enum { TokenTypeEof, TokenTypeInvalidChar, TokenTypeMalformedMultilineComment, TokenTypeMalformedChar, TokenTypeMalformedString, TokenTypeId, TokenTypeInt, TokenTypeHex, TokenTypeBinary, TokenTypeFloat, TokenTypeChar, TokenTypeString, TokenTypeIf, TokenTypeElse, TokenTypeWhile, TokenTypeBreak, TokenTypeLParen, TokenTypeRParen, TokenTypeLBrace, TokenTypeRBrace, TokenTypeLBracket, TokenTypeRBracket, TokenTypeDot, TokenTypeComma, TokenTypeColon, TokenTypeSemicolon, TokenTypePlusEqual, TokenTypeMinusEqual, TokenTypeAsteriskEqual, TokenTypeSlashEqual, TokenTypePercentEqual, TokenTypeDoubleEqual, TokenTypeExclamationEqual, TokenTypeLtEqual, TokenTypeGtEqual, TokenTypePlus, TokenTypeMinus, TokenTypeAsterisk, TokenTypeSlash, TokenTypePercent, TokenTypeEqual, TokenTypeExclamation, TokenTypeLt, TokenTypeGt, } TokenType; typedef struct { size_t index; int line, column; } Position; typedef struct { TokenType type; Position position; size_t length; } Token; typedef struct Lexer Lexer; void lexer_create(Lexer* lexer, const char* text, size_t text_length); Token lexer_next(Lexer* lexer); #endif