-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlexdriver.cpp
More file actions
22 lines (18 loc) · 769 Bytes
/
Copy pathlexdriver.cpp
File metadata and controls
22 lines (18 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <string>
#include <filesystem>
#include "LexicalAnalyzer/LexicalAnalyzer.h"
int main() {
std::vector<std::string> test_files{ "lexpositivegrading" , "lexnegativegrading", "example-polynomial", "example-bubblesort", "edge-cases"};
for (auto filename : test_files) {
std::string source_file = "input/" + filename + ".src";
if(std::filesystem::exists(source_file)) {
LexicalAnalyzer positive = LexicalAnalyzer(filename);
while (positive.has_next_token()) {
Token token = positive.get_next_token();
}
} else {
std::cout << source_file << " doesn't exist. Please make sure the file is in the input folder. Skipping file." << std::endl;
}
}
}