aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h12
1 files changed, 8 insertions, 4 deletions
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);