-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (24 loc) · 683 Bytes
/
main.cpp
File metadata and controls
33 lines (24 loc) · 683 Bytes
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
#include <iostream>
#include <string>
#include "Parser.h"
#include "regexp.h"
#include "gtest/gtest.h"
using namespace std;
int main(int argc, char *argv[])
{
Parser p;
p.parse("abc")->print(0);
cout << "==========="<< endl;
p.parse("a(b|c).a*bc?")->print(0);
cout << "==========="<< endl;
p.parse("abc(a|b|c)d")->print(0);
cout << "===========" << endl;
p.parse("(abc)")->print(0);
cout << "===========" << endl;
ParseTreeNode* root = p.parse("a[bc]");
root->print(0);
Automata* root_automata = root->gen_automata();
root_automata->print();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}