swissChili | 923bd53 | 2021-12-08 22:48:58 -0800 | [diff] [blame^] | 1 | #pragma once |
2 | |||||
3 | #include <QString> | ||||
4 | #include <QList> | ||||
5 | |||||
6 | #include "Evaluator.h" | ||||
7 | #include "AstNode.h" | ||||
8 | |||||
9 | class Repl | ||||
10 | { | ||||
11 | public: | ||||
12 | Repl(); | ||||
13 | |||||
14 | void start(); | ||||
15 | char *prompt(); | ||||
16 | |||||
17 | protected: | ||||
18 | QString readLine(); | ||||
19 | bool trySpecialCase(QString line); | ||||
20 | bool tryEvaluate(QString line, QList<AstNode> *expr); | ||||
21 | |||||
22 | Evaluator _eval; | ||||
23 | |||||
24 | bool _running = true; | ||||
25 | }; |