#ifndef STATE_H #define STATE_H #ifndef NULL #define NULL 0 #endif #include "util.h" #include "ParseRule.h" #include #include #include #include class State { public: State(int number, ParseRule* basis); State(int number, ParseRule* basis, State* parent); ~State(); bool const operator==(const State &other); bool const basisEquals(const State &other); bool const basisEqualsExceptLookahead(const State &other); bool const operator!=(const State &other); std::vector* getBasis(); std::vector* getRemaining(); std::vector* getTotal(); bool containsRule(ParseRule* rule); void addRuleCombineLookahead(ParseRule* rule); std::string toString(); void combineStates(State &other); void addParents(std::vector* parents); std::vector* getParents(); std::vector* getDeepParents(int depth); std::vector basis; std::vector remaining; private: std::vector parents; std::vector total; int number; }; #endif