27 lines
457 B
C
27 lines
457 B
C
|
|
#include "token.h"
|
|
|
|
#ifndef LEXER_H
|
|
#define LEXER_H
|
|
|
|
typedef struct Lexer {
|
|
char* rawFile;
|
|
int rawLen;
|
|
int position; // current index
|
|
int readPosition; // next index
|
|
char ch; // character under examination
|
|
|
|
// values for current index
|
|
int line;
|
|
int column;
|
|
|
|
} Lexer;
|
|
|
|
Lexer* NewLexer(const char* filename);
|
|
Token* NextToken(Lexer* l);
|
|
void ReadChar(Lexer* l);
|
|
void Parse(Lexer* l);
|
|
void FreeLexer(Lexer* l);
|
|
|
|
#endif
|