Webserv
|
A static utility class that performs lexical analysis on a config string. More...
#include <Lexer.hpp>
Static Public Member Functions | |
static void | tokenize (std::string const &content, TokenArray &res) |
static TokenArray | tokenize (std::string const &content) |
static void | printTokens (TokenArray const &tokens) |
Private Member Functions | |
Lexer (std::string const &content, std::vector< Token > &res) | |
void | run () |
void | pushToken (TokenType type, std::string const &literal) |
void | pushToken (TokenType type, char) |
void | readChar () |
void | eatWhitespaces () |
void | identifyLastToken () |
bool | isPunctuation () |
bool | handleValue () |
void | handleComment () |
void | handleUnknown () |
void | handlePunctuation () |
Private Attributes | |
std::string const & | content_ |
TokenArray & | tokens_ |
size_t | pos_ |
char | ch_ |
A static utility class that performs lexical analysis on a config string.
The Lexer breaks down a raw string into a sequence of Tokens, which can then be consumed by the Parser. It handles basic elements like keywords, strings, numbers, and punctuation, ignoring whitespace and comments.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
|
private |
|
private |
|
private |