summaryrefslogtreecommitdiff
path: root/src/scriptengine.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2016-12-01 10:40:43 -0700
committerMike Buland <eichlan@xagasoft.com>2016-12-01 10:40:43 -0700
commitb96daa4e9849ac9caf5c0dfcea8daac28267ea19 (patch)
tree9be42c8cfe8b875f396b5887742bb936bd081c65 /src/scriptengine.h
parent4efeaef41e57b25d6004e7f91828f7d5b5cd0b20 (diff)
downloadclic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.gz
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.bz2
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.xz
clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.zip
Scripts are executable now!
The main interactive interface doesn't work, and there's a lot left to do with the unit tests, other command line options, etc. but it's pretty exciting. I also still have to figure out how commands will work. I'm thinking they'll be stored in an Expression and executed by the engine as normal.
Diffstat (limited to 'src/scriptengine.h')
-rw-r--r--src/scriptengine.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/scriptengine.h b/src/scriptengine.h
new file mode 100644
index 0000000..74924d6
--- /dev/null
+++ b/src/scriptengine.h
@@ -0,0 +1,33 @@
1#ifndef SCRIPT_ENGINE_H
2#define SCRIPT_ENGINE_H
3
4#include "number.h"
5
6#include <bu/hash.h>
7#include <bu/list.h>
8#include <bu/string.h>
9
10
11namespace Bu
12{
13 class Stream;
14}
15class Expression;
16
17class ScriptEngine
18{
19public:
20 ScriptEngine();
21 virtual ~ScriptEngine();
22
23 Number exec( const Bu::String &sExpr );
24 Number exec( Bu::Stream &sInput );
25 Number exec( Expression *pExpr );
26
27private:
28 typedef Bu::Hash<Bu::String, Number> VarHash;
29 typedef Bu::List<Number> NumStack;
30 VarHash hVarState;
31};
32
33#endif