ParserCore Declerations - #7
Basil-Ismail wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR restructures the Parser class to implement a multi-phase parsing approach with tokenization, block preparation, and processing phases. The changes introduce new data structures for representing parsed configuration blocks and entries.
- Replaces direct file processing with a tokenizer-based parsing approach
- Introduces ParserBlock and ParserEntry data structures for hierarchical configuration parsing
- Implements a three-phase parsing pipeline (tokenization, block preparation, processing)
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| models/srcs/Parser.cpp | Implements new parsing methods and removes old file handling logic |
| models/headers/Parser.hpp | Adds new data structures and method declarations for multi-phase parsing |
| includes/utils.hpp | Adds deque header for new container usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ServerContainer *parserProcess(); | ||
|
|
||
| public: | ||
| Parser(const std::string &filePath); |
There was a problem hiding this comment.
The constructor declaration is missing the destructor declaration. The destructor is implemented in the .cpp file but not declared in the header.
| Parser(const std::string &filePath); | |
| Parser(const std::string &filePath); | |
| ~Parser(); |
| } | ||
|
|
||
| void Parser::validateServers() const | ||
| void Parser::parseTokinizer() |
There was a problem hiding this comment.
The method name 'parseTokinizer' contains a spelling error. It should be 'parseTokenizer'.
| void Parser::parseTokinizer() | |
| void Parser::parseTokenizer() |
| because of inner blocks which would require hardcoding the behaviour and especially | ||
| inheritance handling which can be painful if we would process entries one by one | ||
| */ | ||
| void parseTokinizer(); |
There was a problem hiding this comment.
The method name 'parseTokinizer' contains a spelling error. It should be 'parseTokenizer'.
| void parseTokinizer(); | |
| void parseTokenizer(); |
| { | ||
| parseTokinizer(); | ||
| ParserBlock* parserBlock = parserPrepBlocks(); | ||
| ServerContainer* serverContainer = parserProcess(); |
There was a problem hiding this comment.
Using raw pointer with 'new' without corresponding 'delete' can lead to memory leaks. Consider using smart pointers or ensure proper memory management.
| { | ||
| parseTokinizer(); | ||
| ParserBlock* parserBlock = parserPrepBlocks(); | ||
| ServerContainer* serverContainer = parserProcess(); |
There was a problem hiding this comment.
Using raw pointer with 'new' without corresponding 'delete' can lead to memory leaks. Consider using smart pointers or ensure proper memory management.
| { | ||
| parseTokinizer(); | ||
| ParserBlock* parserBlock = parserPrepBlocks(); | ||
| ServerContainer* serverContainer = parserProcess(); |
There was a problem hiding this comment.
The ParserBlock pointer returned from parserPrepBlocks() is not used or freed, creating a potential memory leak.
| ServerContainer* serverContainer = parserProcess(); | |
| ServerContainer* serverContainer = parserProcess(); | |
| delete parserBlock; |
No description provided.