aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/qregisters.h
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-14 00:55:04 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2013-02-14 05:21:03 +0100
commit9cd71e16b30e2f0061a6d74421a5357333721a70 (patch)
treebb362c1ffed48fe9af5ca0cf70c38caacfca2e45 /src/qregisters.h
parent91ae87c7ab0c26a387eb42243e50baf0ded30250 (diff)
micro state machine for Q-Register specifications: allow long Q-Reg names
syntax is as follows: ["."]("#" CHR1 CHR2 | "{" STRING_BUILDING "}" | CHR1) * the short one/two char names are turned upper case, while no case folding is performed on verbose names
Diffstat (limited to 'src/qregisters.h')
-rw-r--r--src/qregisters.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/qregisters.h b/src/qregisters.h
index a5b20cb..2e1772a 100644
--- a/src/qregisters.h
+++ b/src/qregisters.h
@@ -254,6 +254,27 @@ public:
bool pop(QRegister &reg);
};
+class QRegSpecMachine : public MicroStateMachine<QRegister *> {
+ StringBuildingMachine string_machine;
+
+ bool is_local;
+ gint nesting;
+ gchar *name;
+
+public:
+ QRegSpecMachine() : MicroStateMachine(),
+ is_local(false), nesting(0), name(NULL) {}
+
+ ~QRegSpecMachine()
+ {
+ g_free(name);
+ }
+
+ void reset(void);
+
+ QRegister *input(gchar chr) throw (State::Error);
+};
+
/*
* Command states
*/
@@ -262,7 +283,7 @@ public:
* Super class for states accepting Q-Register specifications
*/
class StateExpectQReg : public State {
- bool got_local;
+ QRegSpecMachine machine;
public:
StateExpectQReg();