#ifndef LEXER_H
#define LEXER_H

enum token_type {
    TK_NOT_FOUND,
    TK_IDENT,
    TK_INT_LIT,
    TK_FLOAT_LIT,
    TK_CHAR_LIT,
    TK_STR_LIT,
    TK_HASHTAG,
    TK_LPAREN,
    TK_RPAREN,
    TK_LCURLY,
    TK_RCURLY,
    TK_LSQUARE,
    TK_RSQUARE,
    TK_COLON,
    TK_SEMI,
    TK_COMMA,
    TK_DOT,
    TK_QMARK,
    TK_NOT,
    TK_NEQ,
    TK_XOR,
    TK_XEQ,
    TK_AMP,
    TK_LOG_AND,
    TK_AND_EQ,
    TK_STAR,
    TK_MUL_EQ,
    TK_NEG,
    TK_NEG_EQ,
    TK_ARROW,
    TK_ASSIGN,
    TK_TEST_EQ,
    TK_PLUS,
    TK_PLUS_EQ,
    TK_BSLASH,
    TK_PIPE,
    TK_LOG_PIPE,
    TK_PIPE_EQ,
    TK_DIV,
    TK_DIV_EQ,
    TK_MOD,
    TK_MOD_EQ,
    TK_LT,
    TK_GT,
    TK_LEQ,
    TK_GEQ,
    TK_SHR,
    TK_SHR_EQ,
    TK_SHL,
    TK_SHL_EQ
};

typedef unsigned long long int_lit_t;
typedef double float_lit_t;

struct token {
    enum token_type type;
    union {
        char* ident;
        int_lit_t int_lit;
        float_lit_t float_lit;
        char char_lit;
        char* str_lit;
        void* unused;
    } data;

    const char* PATH;
    unsigned long LINE;
    unsigned long COL;
};

void lexer_load(const char* path);
void lexer_close();
bool lexer_peek(struct token* p_token);
bool lexer_pop(struct token* p_token);
bool lexer_eof();

#endif
