aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp40
1 files changed, 21 insertions, 19 deletions
diff --git a/main.cpp b/main.cpp
index 01b78b2..cca0636 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,38 +1,40 @@
+#include <cstdio>
#include <iostream>
#include <exception>
#include <fstream>
#include "Parser.h"
-#include "Circuit.h"
+// #include "Circuit.h"
using std::cout;
using std::endl;
-using std::fstream;
using std::exception;
+using std::ifstream;
+using std::istream;
int main(int argc, char** argv) {
- Parser main_parser;
- Circuit circuit;
+ Parser main_parser;
+ // Circuit circuit;
- main_parser.setCircuit(circuit);
+ // main_parser.setCircuit(circuit);
- fstream file{"circuits/full-adder.txt", file.out};
+ ifstream file("circuits/full-adder.txt");
- try {
- main_parser << file;
- } catch (exception e) {
- cout << "Parser error: " << e.what() << endl;
- return EXIT_FAILURE;
- }
+ try {
+ file >> main_parser;
+ } catch (exception e) {
+ cout << "Parser error: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
- try {
- circuit.run();
- } catch (exception e) {
- cout << "Circuit error: " << e.what() << endl;
- return EXIT_FAILURE;
- }
+ // try {
+ // circuit.run();
+ // } catch (exception e) {
+ // cout << "Circuit error: " << e.what() << endl;
+ // return EXIT_FAILURE;
+ // }
- cout << "Circuit output: " << circuit.getOutput() << endl;
+ // cout << "Circuit output: " << circuit.getOutput() << endl;
return EXIT_SUCCESS;
}