-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdAutomata.cpp
44 lines (41 loc) · 927 Bytes
/
IdAutomata.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
41
42
43
44
#include "IdAutomata.h"
void IdAutomata::S0(const std::string &input) {
check.clear();
if (isalpha(input[index])) {
check.push_back(input[index]);
inputRead++;
index++;
S1(input);
}
else {
Serr();
}
}
void IdAutomata::S1(const std::string &input) {
if (std::isalpha(input[index])) {
check.push_back(input[index]);
inputRead++;
index++;
S1(input);
}
else if (std::isdigit(input[index])) {
check.push_back(input[index]);
inputRead++;
index++;
S1(input);
}
else {
if (check == "Queries") {
Serr();
}
else if (check == "Facts") {
Serr();
}
else if (check == "Rules") {
Serr();
}
else if (check == "Schemes") {
Serr();
}
}
}