aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-08 04:28:54 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2012-11-08 04:28:54 +0100
commitb58893781bcb8feeba8c4743ae3d5e6083dc010e (patch)
tree2fc9c98fa2f7fadf67508536be8c2c08843422e4 /parser.h
parentd0020c7f6faeff4b415f15884eea3270d306aff9 (diff)
downloadsciteco-b58893781bcb8feeba8c4743ae3d5e6083dc010e.tar.gz
insert (I) and <TAB> commands implemented
* StateExpectString does not yet handle string building chars
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/parser.h b/parser.h
index 8ceb3e2..2798469 100644
--- a/parser.h
+++ b/parser.h
@@ -39,6 +39,24 @@ protected:
}
};
+/*
+ * Super-class for states accepting string arguments
+ * Opaquely cares about alternative-escape characters,
+ * string building commands and accumulation into a string
+ */
+class StateExpectString : public State {
+public:
+ StateExpectString() : State() {}
+
+private:
+ virtual State *custom(gchar chr);
+
+protected:
+ virtual void initial(void) {}
+ virtual void process(const gchar *str, gint new_chars) {}
+ virtual State *done(const gchar *str) = 0;
+};
+
class StateStart : public State {
public:
StateStart();
@@ -58,6 +76,13 @@ private:
State *custom(gchar chr);
};
+class StateInsert : public StateExpectString {
+private:
+ void initial(void);
+ void process(const gchar *str, gint new_chars);
+ State *done(const gchar *str);
+};
+
#include "goto.h"
extern gint macro_pc;
@@ -66,6 +91,7 @@ extern struct States {
StateStart start;
StateLabel label;
StateControl control;
+ StateInsert insert;
} states;
extern enum Mode {