forked from ground/cground
24 lines
354 B
C
24 lines
354 B
C
|
|
#ifndef LEXER_H
|
||
|
|
#define LEXER_H
|
||
|
|
|
||
|
|
#include <stdlib.h>
|
||
|
|
|
||
|
|
typedef struct Token {
|
||
|
|
char* text;
|
||
|
|
} Token;
|
||
|
|
|
||
|
|
typedef struct TokenLine {
|
||
|
|
Token* tokens;
|
||
|
|
size_t count;
|
||
|
|
} TokenLine;
|
||
|
|
|
||
|
|
typedef struct LexedFile {
|
||
|
|
TokenLine* lines;
|
||
|
|
size_t lineCount;
|
||
|
|
} LexedFile;
|
||
|
|
|
||
|
|
LexedFile lexFile(const char* fileContents);
|
||
|
|
void freeLexedFile(LexedFile* lf);
|
||
|
|
|
||
|
|
#endif
|