diff options
author | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2024-06-12 12:05:45 +0200 |
---|---|---|
committer | UnavailableDev <69792062+UnavailableDev@users.noreply.github.com> | 2024-06-12 12:05:45 +0200 |
commit | 126a3c79516a6417181c3fe924084032d653b596 (patch) | |
tree | 1f1d356eccdf7d316cf7e991af036f0c0a6a53bd /main.cpp | |
parent | c084bee21f66e6322d4d55b8700f0779f2c58d0d (diff) | |
parent | 8e0a865dd375baa71357ce817847ea8a9144434c (diff) |
Merge branch 'master' into node
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 47 |
1 files changed, 34 insertions, 13 deletions
@@ -1,17 +1,38 @@ -#include <cstdio> -// #include "Observer.h" -#include "Net.h" -#include "Gate.h" +#include <iostream> +#include <fstream> + +#include "Parser.h" +#include "Circuit.h" + +using std::cout; +using std::endl; +using std::ifstream; int main(int argc, char** argv) { - // Observer ob(); - Net n; - Gate *g = new GateAnd; - g->addInput(&n); - n.setLevel(HIGH); - int level = 22; - level = n.getLevel(); - printf("hello world! %d\n", level); - return 0; + Parser main_parser; + Circuit circuit; + + main_parser.set_circuit(circuit); + + ifstream file("circuits/full-adder.txt"); + + try { + file >> main_parser; + // main_parser << file; + } catch (ParserException & 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; + // } + + // cout << "Circuit output: " << circuit.getOutput() << endl; + + return EXIT_SUCCESS; } |