webpage/lexer.h

34 lines
429 B
C
Raw Normal View History

2023-12-31 14:54:14 +01:00
#ifndef LEXER_H
#define LEXER_H
#include <stdio.h>
#include <stdlib.h>
2024-01-01 19:13:39 +01:00
#include <string.h>
#include "page.h"
2023-12-31 14:54:14 +01:00
typedef enum TokenType {
NO_TYPE,
TEXT,
BODY,
END_BODY,
UL, LI,
H1, H2, H3, H4, H5, H6,
} TokenType;
typedef struct Token {
TokenType type;
char* value;
} Token;
typedef struct Cursor {
int chunk;
int offset;
} Cursor;
Token* nexttoken(void);
void printtoken(Token* token);
#endif // LEXER_H