Update ParseCompnents.hpp.
This commit is contained in:
parent
24195f9a6c
commit
2fe59c9c43
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue