Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / ASTInterpreter.h
diff options
context:
space:
mode:
Commit6c2f7812f65b4a5c60f85297d1bc4f918e32936e (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2018-11-03 14:47:20 +0200
Committer
 martin dobrev <martindobrev0@gmail.com>
2018-11-03 14:47:20 +0200
Files58a4ea3aba9ed7664908eff465aafd647c274124 /JSImpl/src/ASTInterpreter.h
IPL-6c2f7812f65b4a5c60f85297d1bc4f918e32936e.tar
IPL-6c2f7812f65b4a5c60f85297d1bc4f918e32936e.tar.gz
IPL-6c2f7812f65b4a5c60f85297d1bc4f918e32936e.zip
Parent4e7231b52c36fdff699f8d3afd973c184854fdea (diff)
Introduce interactive interpreter.
1 files changed, 8 insertions, 0 deletions
-rw-r--r--JSImpl/src/ASTInterpreter.h8
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);