From 5d59aa3e9dffe2912215335ce0b76c67ebbe5a4e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 1 Dec 2016 15:51:52 -0700 Subject: Signals solve many problems. The command structures will be changed, I think. I want the lexer to actually lex the command names into tokens, then the parser and the engine can both use them to update their state when necesarry. It will be less ambiguous and easier for both sides to stay synchronized. --- src/scriptengine.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/scriptengine.h') 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 @@ #define SCRIPT_ENGINE_H #include "number.h" +#include "expression.h" #include #include #include - +#include namespace Bu { @@ -16,18 +17,31 @@ class Expression; class ScriptEngine { +private: + typedef Bu::Hash VarHash; + typedef Bu::List NumStack; + public: ScriptEngine(); virtual ~ScriptEngine(); - Number exec( const Bu::String &sExpr ); - Number exec( Bu::Stream &sInput ); - Number exec( Expression *pExpr ); + void exec( const Bu::String &sExpr ); + void exec( Bu::Stream &sInput ); + void exec( Expression *pExpr ); + + bool isRunning() const { return bRunning; } + +public: + Bu::Signal1 sigNumResult; + Bu::Signal1 sigError; + Bu::Signal1 sigMessage; + +private: + void command( Expression::iterator &i ); private: - typedef Bu::Hash VarHash; - typedef Bu::List NumStack; VarHash hVarState; + bool bRunning; }; #endif -- cgit v1.2.3