aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'parser.h')
-rw-r--r--parser.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/parser.h b/parser.h
index dba304d..3c4f543 100644
--- a/parser.h
+++ b/parser.h
@@ -11,6 +11,18 @@ 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();