Skip to content

ParserCore Declerations - #7

Closed
Basil-Ismail wants to merge 1 commit into
buildfrom
ParserCore
Closed

Basil-Ismail wants to merge 1 commit into
buildfrom
ParserCore

Conversation

@Basil-Ismail

Copy link
Copy Markdown
Member

No description provided.

@Basil-Ismail Basil-Ismail self-assigned this Aug 16, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread models/headers/Parser.hpp
ServerContainer *parserProcess();

public:
Parser(const std::string &filePath);

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor declaration is missing the destructor declaration. The destructor is implemented in the .cpp file but not declared in the header.

Suggested change
Parser(const std::string &filePath);
Parser(const std::string &filePath);
~Parser();

Copilot uses AI. Check for mistakes.
Comment thread models/srcs/Parser.cpp
}

void Parser::validateServers() const
void Parser::parseTokinizer()

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name 'parseTokinizer' contains a spelling error. It should be 'parseTokenizer'.

Suggested change
void Parser::parseTokinizer()
void Parser::parseTokenizer()

Copilot uses AI. Check for mistakes.
Comment thread models/headers/Parser.hpp
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();

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name 'parseTokinizer' contains a spelling error. It should be 'parseTokenizer'.

Suggested change
void parseTokinizer();
void parseTokenizer();

Copilot uses AI. Check for mistakes.
Comment thread models/srcs/Parser.cpp
{
parseTokinizer();
ParserBlock* parserBlock = parserPrepBlocks();
ServerContainer* serverContainer = parserProcess();

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using raw pointer with 'new' without corresponding 'delete' can lead to memory leaks. Consider using smart pointers or ensure proper memory management.

Copilot uses AI. Check for mistakes.
Comment thread models/srcs/Parser.cpp
{
parseTokinizer();
ParserBlock* parserBlock = parserPrepBlocks();
ServerContainer* serverContainer = parserProcess();

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using raw pointer with 'new' without corresponding 'delete' can lead to memory leaks. Consider using smart pointers or ensure proper memory management.

Copilot uses AI. Check for mistakes.
Comment thread models/srcs/Parser.cpp
{
parseTokinizer();
ParserBlock* parserBlock = parserPrepBlocks();
ServerContainer* serverContainer = parserProcess();

Copilot AI Aug 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ParserBlock pointer returned from parserPrepBlocks() is not used or freed, creating a potential memory leak.

Suggested change
ServerContainer* serverContainer = parserProcess();
ServerContainer* serverContainer = parserProcess();
delete parserBlock;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants