Update ParseCompnents.hpp.

This commit is contained in:
Username404-59 2021-03-05 11:34:02 +01:00
parent 24195f9a6c
commit 2fe59c9c43
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 8 additions and 7 deletions

View File

@ -10,18 +10,19 @@
using namespace std;
class ParseComponent {
public:
};
class ParseTree {
private:
unsigned int compCount = 0;
protected:
vector<ParseComponent> 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<ParseComponent>& components) { for (const auto& comp: components) add(comp); }
ParseTree(): subComponents() {};
ParseComponent(): subComponents() {};
~ParseComponent() = default;
};
struct ParseTree: public ParseComponent {};
#endif //YERBACON_PARSECOMPONENTS_HPP