Interpreter prototype alpha
c++ interpreter for make believe language
 
Loading...
Searching...
No Matches
lexer Class Reference

tokenizes the entire program line by line More...

#include <lexer.h>

Public Member Functions

 lexer (const std::string &textfile, const std::string &filepath, const int &linenumber)
 constructor
 
std::vector< token__RUN__LEXER___ ()
 tokenizes the program
 

Private Member Functions

void advance ()
 advances the lexer to the next character to tokenize in the textfile being read
 
token generate_identifier ()
 generates an identifier or keyword based on the sequence of characters being read
 
void generate_tokens ()
 matches the current character to it's corresponding token type
 
token generate_number ()
 generates a number data type
 
token generate_string ()
 generates a string data type
 

Private Attributes

std::string textFile
 file data in string format
 
std::string filePath
 path of the file
 
std::vector< tokentokenObjVector
 stores the tokens of the current line in the program
 
int lnNum
 current line number in the file
 
std::string current_char
 the current char in the textfile being read
 
int current_index
 the current index of the current char in the textfile being read
 

Detailed Description

tokenizes the entire program line by line

Author
Michael

The documentation for this class was generated from the following files: