Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src / main.cpp
diff options
context:
space:
mode:
Commitd5fd7629fc6b85df0f27f3069bffef407a94cef8 (patch)
Author
 martin dobrev <martindobrev0@gmail.com>
2020-10-22 23:18:55 +0300
Committer
 martin dobrev <martindobrev0@gmail.com>
2020-10-22 23:18:55 +0300
Filescbac830ef08493038517abb7bae20bb89023ea11 /JSImpl/src/main.cpp
IPL-d5fd7629fc6b85df0f27f3069bffef407a94cef8.tar
IPL-d5fd7629fc6b85df0f27f3069bffef407a94cef8.tar.gz
IPL-d5fd7629fc6b85df0f27f3069bffef407a94cef8.zip
Parent71c5ba7b86ddb1fe1d6b768fb19e698e8badb410 (diff)
Reorganize ASTPrinter.
1 files changed, 12 insertions, 14 deletions
-rw-r--r--JSImpl/src/main.cpp26
diff --git a/JSImpl/src/main.cpp b/JSImpl/src/main.cpp
index ef5ac1b..3a6b84e 100644
--- a/JSImpl/src/main.cpp
+++ b/JSImpl/src/main.cpp
@@ -20,17 +20,16 @@ void RunParseCalc()
// TODO make actual test :D
auto expr = Parse(tokens);
- //ASTPrinter p(std::cout);
- //expr->Accept(p);
- ASTInterpreter i;
- std::cout << "Running" << std::endl;
- auto result = i.Run(expr.get());
- std::cout << "Stack after run, top to bottom:" << std::endl;
- while (!result.empty()) {
- std::cout << result.back() << std::endl;
- result.pop_back();
- }
- std::cout << "S = " << i.ModifyVariable("a") << std::endl;
+ PrintAST(expr, std::cout);
+ //ASTInterpreter i;
+ //std::cout << "Running" << std::endl;
+ //auto result = i.Run(expr.get());
+ //std::cout << "Stack after run, top to bottom:" << std::endl;
+ //while (!result.empty()) {
+ // std::cout << result.back() << std::endl;
+ // result.pop_back();
+ //}
+ //std::cout << "S = " << i.ModifyVariable("a") << std::endl;
}
class InterpreterPrinter : public ASTInterpreter::Printer
@@ -113,9 +112,8 @@ void Generate()
int main()
{
- //RunParseCalc();
- //InteractiveInterpreter();
- Generate();
+ auto r = Tokenize("a#4", {true ,true});
+ RunParseCalc();
#if defined(_WIN32)
//std::system("pause");
#endif