From 69419eceaca8e347016ccbe42326bcdc881355fc Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 7 Nov 2012 21:41:05 +0100 Subject: undo stack enable/disable, parse-only mode, colon modifiers evaluation --- parser.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'parser.h') diff --git a/parser.h b/parser.h index 3c4f543..40a8c9f 100644 --- a/parser.h +++ b/parser.h @@ -12,23 +12,26 @@ protected: State *transitions[MAX_TRANSITIONS]; inline void - init(const gchar *chars, State *state) + init(const gchar *chars, State &state) { while (*chars) - transitions[(int)*chars++] = state; + transitions[(int)*chars++] = &state; } inline void init(const gchar *chars) { - init(chars, this); + init(chars, *this); } public: State(); - static gboolean input(gchar chr); + static bool input(gchar chr); State *get_next_state(gchar chr); +protected: + static bool eval_colon(void); + virtual State * custom(gchar chr) { @@ -40,6 +43,7 @@ class StateStart : public State { public: StateStart(); +private: void move(gint64 n); State *custom(gchar chr); -- cgit v1.2.3