Moved source

This commit is contained in:
Rafał Grodziński
2025-05-28 20:43:06 +09:00
parent 69bf54a62d
commit 7c11a0aee1
7 changed files with 6 additions and 1 deletions

29
src/Lexer.h Normal file
View File

@@ -0,0 +1,29 @@
#ifndef LEXER_H
#define LEXER_H
#include <vector>
#include "Token.h"
class Lexer {
private:
std::string source;
int currentIndex = 0;
int currentLine = 0;
Token nextToken();
Token matchEnd();
Token matchNewLine();
Token matchInvalid();
Token matchSymbol(char symbol, Token::Kind kind);
Token matchInteger();
bool isWhiteSpace(int index);
bool isNewLine(int index);
bool isDigit(int index);
public:
Lexer(std::string source);
std::vector<Token> getTokens();
};
#endif