-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (31 loc) · 863 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include "AutomatonException.h"
#include "DeterminateFiniteAutomaton.h"
#include "State.h"
#include <cstdlib>
#include <fstream>
#include "Operations.h"
#include "UserIO.h"
using namespace std;
int main() {
DFAutomaton<int> automInt;
DFAutomaton<char> automChar;
printMenu();
cout << "Choose option: ";
int option;
while (cin >> option) {
if (option == 0) break;
if (option > 14) {
cout << "Choose between options from -1 to 14! Choose option: ";
continue;
}
if ((option >= 12 && option <= 14) && (automInt.getTransitionTable() == nullptr && automChar.getTransitionTable() == nullptr)) {
cout << std::endl << "You must first create an automaton using option 1 or 2!" << std::endl;
cout << "Choose option: ";
continue;
}
menu(option, automInt, automChar);
cout << "Choose option: ";
}
return 0;
}