QuicMaf/QuicMaf/app.cpp

62 lines
942 B
C++
Raw Permalink Normal View History

2019-02-22 07:29:49 +00:00
#pragma once
#define DEBUG_MODE
#include <iostream>
#include <string>
#include "vendor/lexertk.hpp"
2019-03-10 12:43:33 +00:00
#include "maths/solver/Solver.h"
#include "maths/Equations.h"
2019-02-22 07:29:49 +00:00
2019-03-17 14:06:34 +00:00
#include "maths/solver/term_rewriter/QMEvalHelper.h"
2019-03-15 04:12:33 +00:00
#include "maths/solver/term_rewriter/QMEvaluator.h"
#include "maths/solver/term_rewriter/ds/ExprTree.h"
2019-03-10 18:21:34 +00:00
#include "Log.h"
2019-02-22 07:29:49 +00:00
//#define MAIN_APP
//#define APP_TEST
2019-02-22 07:29:49 +00:00
#ifdef MAIN_APP
using namespace std;
2019-02-15 12:57:09 +00:00
int main() {
2019-02-22 07:29:49 +00:00
while (true) {
cout << "Enter an equation: ";
string input;
cin >> input;
2019-03-17 14:06:34 +00:00
cout << "Solution: " << endl;
2019-02-22 07:29:49 +00:00
2019-03-17 14:06:34 +00:00
Solver solver;
solver.CheckEqu(input);
2019-03-17 14:06:34 +00:00
solver.Parse(input);
solver.Solve();
2019-03-10 12:43:33 +00:00
2019-03-17 14:06:34 +00:00
for (auto *lwing : solver.mEquation->lwing)
cout << lwing->to_str();
cout << "=";
for (auto *rwing : solver.mEquation->rwing)
cout << rwing->to_str();
2019-02-22 07:29:49 +00:00
2019-03-17 14:06:34 +00:00
cout << endl;
2019-02-22 07:29:49 +00:00
system("PAUSE");
system("CLS");
}
return true;
}
#endif // MAIN_APP
#ifdef APP_TEST
2019-03-10 12:43:33 +00:00
int main() {
return 0;
}
2019-02-22 07:29:49 +00:00
#endif