I have following inheritance chain:
class Derivation : public std::vector<Symbol> {
};
class Alternatives : public std::vector<Derivation> { };
class Production : public std::pair<NonTerminal, Alternatives> {
int order = 0;
};
class Productions : public std::vector<Production> { };
class Grammar {
Productions productions;
};
How can I access parent classes to add elements to them?
Or is there maybe even a way to do something like this directly?
productions.production[3].alternatives.push_back(std::vector<Symbol>())
Maybe a little contrived:
productions::parents.last.push_back(std::vector<Symbol()>