#ifndef YERBACON_PARSECOMPONENTS_HPP #define YERBACON_PARSECOMPONENTS_HPP #include #include using namespace std; #include "../lex.hpp" class ParseComponent {}; struct ParseTree: public ParseComponent { private: unsigned int compCount = 0; protected: vector subComponents; public: unsigned int& getCompCount() { return compCount; } auto& getComponents() { return subComponents; } void add(const ParseComponent& component) { subComponents.push_back(component); ++compCount; }; void addAll(const vector& components) { for (const auto& comp: components) add(comp); } void operator<<(const ParseComponent& component) { this->add(component); } ParseTree(): subComponents() {}; ~ParseTree() = default; }; #endif //YERBACON_PARSECOMPONENTS_HPP