-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
41 lines (34 loc) · 1.12 KB
/
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
41
#include <iostream>
#include <string>
#include "node.h"
int main()
{
std::list <std::string> list;
list.push_back( "221PQ21QP" );
list.push_back( "221QP21PQ" );
list.push_back( "3A1C3EBD" );
list.push_back( "23CABA" );
list.push_back( "31A1C1B" );
list.push_back( "3ABC" );
std::list<std::string>::iterator it = list.begin();
for ( ; it != list.end(); ++it )
{
std::string curr = (*it);
std::cout << "Current string: " << curr << std::endl;
Node* node = Node::parseFromString( curr );
if ( node == NULL )
{
std::cerr << "ERROR: invalid" << std::endl;
continue;
}
node->print();
std::cout << "Test to make sure toString retains input order:\n";
std::cout << "OLD: " << curr << std::endl;
std::cout << "NEW: " << node->toString() << std::endl << std::endl;
std::cout << "Standardized:" << std::endl;
Node::standardize( node );
node->print();
std::cout << "Final output: " << node->toString() << std::endl;
std::cout << "----------" << std::endl;
}
}