diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 01:20:37 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-11-08 01:20:37 +0100 |
commit | 7dbb2831b81ff0174054d30b1fc105b2113c272d (patch) | |
tree | fde5c878e2c9a89e6f41c8535034e1b16927c154 /parser.cpp | |
parent | 1707fcabca80e2e664bef9c02ec5cc9d793ce37b (diff) | |
download | sciteco-7dbb2831b81ff0174054d30b1fc105b2113c272d.tar.gz |
added support for labels, including the goto label table
* uses BSD tree macros, might later be abstracted to a C++ table class
Diffstat (limited to 'parser.cpp')
-rw-r--r-- | parser.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -8,9 +8,7 @@ gint macro_pc = 0; -static struct { - StateStart start; -} states; +States states; static State *current_state = &states.start; @@ -19,10 +17,7 @@ static struct { bool at; } modifiers = {false, false}; -static enum Mode { - MODE_NORMAL = 0, - MODE_PARSE_ONLY -} mode = MODE_NORMAL; +enum Mode mode = MODE_NORMAL; /* FIXME: perhaps integrate into Mode */ static bool skip_else = false; @@ -34,6 +29,8 @@ static bool skip_else = false; static gint nest_level = 0; +gchar *strings[2] = {NULL, NULL}; + bool macro_execute(const gchar *macro) { @@ -113,6 +110,8 @@ StateStart::StateStart() : State() { transitions['\0'] = this; init(" \r\n\v"); + + transitions['!'] = &states.label; } void @@ -426,4 +425,3 @@ StateStart::custom(gchar chr) return this; } - |