From 6c2f7812f65b4a5c60f85297d1bc4f918e32936e Mon Sep 17 00:00:00 2001 From: martin dobrev Date: Sat, 3 Nov 2018 14:47:20 +0200 Subject: Introduce interactive interpreter. --- JSImpl/src/ASTInterpreter.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'JSImpl/src/ASTInterpreter.h') diff --git a/JSImpl/src/ASTInterpreter.h b/JSImpl/src/ASTInterpreter.h index 4683d63..cde3dd0 100644 --- a/JSImpl/src/ASTInterpreter.h +++ b/JSImpl/src/ASTInterpreter.h @@ -41,6 +41,14 @@ public: value_type& ModifyVariable(const IPLString& name); bool HasVariable(const IPLString& name); + + class Printer + { + public: + virtual void PrintVariable(const char* name, double value) = 0; + }; + + void Print(Printer& p); private: void RunExpression(const ExpressionPtr& e); bool EvalToBool(const ExpressionPtr& e); -- cgit v1.3.1-23-gd82d