src-highlite.git - src-highlite

index : src-highlite.git
src-highlite
summary refs log tree commit diff
path: root/src/lib/regexpengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/regexpengine.h')
-rw-r--r--src/lib/regexpengine.h 57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/lib/regexpengine.h b/src/lib/regexpengine.h
new file mode 100644
index 0000000..aefa716
--- /dev/null
+++ b/src/lib/regexpengine.h
@@ -0,0 +1,57 @@
+//
+// C++ Interface: regexpengine
+//
+// Description:
+//
+//
+// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef REGEXPENGINE_H
+#define REGEXPENGINE_H
+
+#include "regexpstate.h"
+
+class TextFormatter;
+
+#include <string>
+#include <stack>
+#include <boost/shared_ptr.hpp>
+#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<RegExpStatePtr> 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<RegExpEngine> RegExpEnginePtr;
+
+#endif
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月17日 15:24:25 +0000

AltStyle によって変換されたページ (->オリジナル) /