#ifndef RNGLRPARSER_H #define RNGLRPARSER_H #include #include #include "Parser.h" #include "GraphStructuredStack.h" class RNGLRParser: public Parser { public: RNGLRParser(); ~RNGLRParser(); NodeTree* parseInput(std::string inputString); private: void reducer(int i); void shifter(int i); void addChildren(NodeTree* parent, std::vector*> children, int nullablePartsIndex); void addStates(std::vector< State* >* stateSets, State* state); bool reducesToNull(ParseRule* rule); bool reducesToNull(ParseRule* rule, std::vector avoidList); bool belongsToFamily(NodeTree* node, std::vector*>* nodes); bool arePacked(std::vector*>* nodes); bool isPacked(NodeTree* node); void setPacked(NodeTree* node, bool isPacked) std::vector input; GraphStructuredStack gss; //start node, lefthand side of the reduction, reduction length std::queue*, Symbol*>, int > > toReduce; //Node coming from, state going to std::queue< std::pair*, int> > toShift; std::vector*> nullableParts; std::map*, bool> packedMap; }; #endif