From 523947d30c5fb2e1a804023dcf7f1aa70a9a6932 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 10 Nov 2012 21:23:36 +0100 Subject: use namespace "States" instead of "states" structure has several advantages * better to read * namespace can be "extended" from everywhere allowing the declaration of states in the files that implement them * include file mess could be cleaned up a bit --- parser.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'parser.h') diff --git a/parser.h b/parser.h index e655e34..91ee036 100644 --- a/parser.h +++ b/parser.h @@ -91,21 +91,16 @@ private: State *done(const gchar *str); }; -#include "goto.h" -#include "qbuffers.h" - extern gint macro_pc; -extern struct States { - StateStart start; - StateLabel label; - StateControl control; - StateECommand ecommand; - StateFile file; - StateInsert insert; -} states; +namespace States { + extern StateStart start; + extern StateControl control; + extern StateECommand ecommand; + extern StateInsert insert; -extern State *current_state; + extern State *current; +} extern enum Mode { MODE_NORMAL = 0, -- cgit v1.2.3