summaryrefslogtreecommitdiff
path: root/src/scriptengine.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/scriptengine.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/scriptengine.h b/src/scriptengine.h
index 74924d6..b25c651 100644
--- a/src/scriptengine.h
+++ b/src/scriptengine.h
@@ -2,11 +2,12 @@
2#define SCRIPT_ENGINE_H 2#define SCRIPT_ENGINE_H
3 3
4#include "number.h" 4#include "number.h"
5#include "expression.h"
5 6
6#include <bu/hash.h> 7#include <bu/hash.h>
7#include <bu/list.h> 8#include <bu/list.h>
8#include <bu/string.h> 9#include <bu/string.h>
9 10#include <bu/signals.h>
10 11
11namespace Bu 12namespace Bu
12{ 13{
@@ -16,18 +17,31 @@ class Expression;
16 17
17class ScriptEngine 18class ScriptEngine
18{ 19{
20private:
21 typedef Bu::Hash<Bu::String, Number> VarHash;
22 typedef Bu::List<Number> NumStack;
23
19public: 24public:
20 ScriptEngine(); 25 ScriptEngine();
21 virtual ~ScriptEngine(); 26 virtual ~ScriptEngine();
22 27
23 Number exec( const Bu::String &sExpr ); 28 void exec( const Bu::String &sExpr );
24 Number exec( Bu::Stream &sInput ); 29 void exec( Bu::Stream &sInput );
25 Number exec( Expression *pExpr ); 30 void exec( Expression *pExpr );
31
32 bool isRunning() const { return bRunning; }
33
34public:
35 Bu::Signal1<void, const class Number &> sigNumResult;
36 Bu::Signal1<void, const Bu::String &> sigError;
37 Bu::Signal1<void, const Bu::String &> sigMessage;
38
39private:
40 void command( Expression::iterator &i );
26 41
27private: 42private:
28 typedef Bu::Hash<Bu::String, Number> VarHash;
29 typedef Bu::List<Number> NumStack;
30 VarHash hVarState; 43 VarHash hVarState;
44 bool bRunning;
31}; 45};
32 46
33#endif 47#endif