#ifndef __PARSER_H #define __PARSER_H #include #include #include "sciteco.h" class State { protected: /* static transitions */ State *transitions[MAX_TRANSITIONS]; inline void init(const gchar *chars, State *state) { while (*chars) transitions[(int)*chars++] = state; } inline void init(const gchar *chars) { init(chars, this); } public: State(); static gboolean input(gchar chr); State *get_next_state(gchar chr); virtual State * custom(gchar chr) { return NULL; } }; class StateStart : public State { public: StateStart(); void move(gint64 n); State *custom(gchar chr); }; #endif