diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 04:28:54 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 04:28:54 +0100 |
commit | b58893781bcb8feeba8c4743ae3d5e6083dc010e (patch) | |
tree | 2fc9c98fa2f7fadf67508536be8c2c08843422e4 /parser.h | |
parent | d0020c7f6faeff4b415f15884eea3270d306aff9 (diff) | |
download | sciteco-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.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 { |