diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-07 20:43:33 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-07 20:43:33 +0100 |
commit | ad939b95eb95c7511a371ef7d806ad9bb26453ae (patch) | |
tree | 372ff7ea4bbd4b8d06c3054bf3a4da5aea1b1560 /parser.h | |
parent | 581e39ac203056633a627ad09167adf05753e091 (diff) | |
download | sciteco-ad939b95eb95c7511a371ef7d806ad9bb26453ae.tar.gz |
add helper function to initialize transition table
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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(); |