Webserv
|
Performs syntax analysis on a stream of tokens to build a configuration tree. More...
#include <Parser.hpp>
Static Public Member Functions | |
static std::vector< ConfigNode > | parse (TokenArray const &) |
Private Member Functions | |
Parser () | |
Parser (TokenArray const &) | |
size_t | size () const |
Token const & | currentToken () const |
Token const & | peekToken () const |
void | consumeToken () |
void | expectToken (TokenType type) |
void | expectToken (std::string literal) |
bool | isTokenAValue () const |
void | displayCurrentToken () const |
void | addDirective (ConfigNode &node, DirectivePair const &pair) const |
void | handleServerBlock () |
void | handleStatement () |
void | handleLocationBlock () |
DirectivePair | handleDirective () |
Private Attributes | |
std::vector< ConfigNode > | nodes_ |
TokenArray const & | tokens_ |
size_t | pos_ |
Performs syntax analysis on a stream of tokens to build a configuration tree.
The Parser consumes tokens from the Lexer and validates them against a defined grammar. Its primary role is to build a tree of ConfigNode objects (the IR) that represents the structure of the configuration file. It ensures syntactic correctness but does not validate the meaning of directives.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |