10#include "../tokens/tokens.h"
24 lexer(
const std::string& textfile,
const std::string& filepath,
const int& linenumber);
int current_index
the current index of the current char in the textfile being read
Definition lexer.h:62
void advance()
advances the lexer to the next character to tokenize in the textfile being read
Definition lexer.cpp:16
std::vector< token > tokenObjVector
stores the tokens of the current line in the program
Definition lexer.h:47
token generate_number()
generates a number data type
Definition lexer.cpp:250
token generate_identifier()
generates an identifier or keyword based on the sequence of characters being read
Definition lexer.cpp:283
std::string textFile
file data in string format
Definition lexer.h:37
token generate_string()
generates a string data type
Definition lexer.cpp:303
int lnNum
current line number in the file
Definition lexer.h:52
std::vector< token > __RUN__LEXER___()
tokenizes the program
Definition lexer.cpp:11
std::string current_char
the current char in the textfile being read
Definition lexer.h:57
std::string filePath
path of the file
Definition lexer.h:42
void generate_tokens()
matches the current character to it's corresponding token type
Definition lexer.cpp:26
tokenizes the entire program line by line
Definition lexer.h:15
creates an object with the mapping of a token that was assigned to it from the 'tokens' class
Definition tokens.h:200