// // C++ Interface: regexpengine // // Description: // // // Author: Lorenzo Bettini , (C) 2004 // // Copyright: See COPYING file that comes with this distribution // // #ifndef REGEXPENGINE_H #define REGEXPENGINE_H #include "regexpstate.h" class TextFormatter; #include #include #include #include "fileinfo.h" /** the class that actually performs regular expression processing @author Lorenzo Bettini */ class RegExpEngine { protected: RegExpStatePtr currentstate, initial_state; FileInfo *fileinfo; private: TextFormatter *formatter; typedef std::stack stack_of_states; stack_of_states states_stack; protected: virtual void enterState(RegExpStatePtr state, int index); virtual void exitState(int level); virtual void exitAll(); virtual void format(int index, RegExpStatePtr state, const std::string &s); public: RegExpEngine(RegExpStatePtr v, TextFormatter *pre, FileInfo *f) : currentstate(v), fileinfo(f), formatter(pre) { } virtual ~RegExpEngine(); void process_file(const char *file); }; typedef boost::shared_ptr RegExpEnginePtr; #endif