diff --git a/src/headers/ParseComponents.hpp b/src/headers/ParseComponents.hpp index 00833b1..d493d30 100644 --- a/src/headers/ParseComponents.hpp +++ b/src/headers/ParseComponents.hpp @@ -10,18 +10,19 @@ using namespace std; class ParseComponent { -public: - -}; - -class ParseTree { +private: + unsigned int compCount = 0; protected: vector subComponents; public: + unsigned int& getCompCount() { return compCount; } auto& getComponents() { return subComponents; } - void add(const ParseComponent component) { subComponents.emplace_back(component); }; + void add(const ParseComponent& component) { subComponents.push_back(component); ++compCount; }; void addAll(const vector& components) { for (const auto& comp: components) add(comp); } - ParseTree(): subComponents() {}; + ParseComponent(): subComponents() {}; + ~ParseComponent() = default; }; +struct ParseTree: public ParseComponent {}; + #endif //YERBACON_PARSECOMPONENTS_HPP