slowly writing a lexer, literally not functional lmao
This commit is contained in:
22
src/sylt/lexer.h
Normal file
22
src/sylt/lexer.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef LEXER_H
|
||||
#define LEXER_H
|
||||
#include "token.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int position;
|
||||
int readPosition;
|
||||
int lineNumber;
|
||||
|
||||
char currentChar;
|
||||
char *source;
|
||||
} Lexer;
|
||||
|
||||
Lexer initLexer(char *source);
|
||||
void readChar(Lexer *lexer);
|
||||
void skipWhitespace(Lexer *lexer);
|
||||
Token nextToken(Lexer *lexer);
|
||||
char *tokenToCStr(Token token);
|
||||
|
||||
#endif // !LEXER_H
|
||||
Reference in New Issue
Block a user