-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_inter.cpp
More file actions
39 lines (36 loc) · 778 Bytes
/
test_inter.cpp
File metadata and controls
39 lines (36 loc) · 778 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
34
35
36
37
38
39
/**
* @file
* @brief the test file of Interpreter
* @author elf@ZJU
* @version 1.0
*
* run the Interpreter and output the result to the screen
*/
#include "miniSQL.h"
#include "Interpreter.h"
/**
* @brief the main function
* @param none
* @exception ErCreateFile
* @return an integer
*/
int main(){
cout << "Welcome to the miniSQL. Commands end with ;." << endl;
cout << "Version 1.0. Copyright elf@ZJU. All rights reserved." << endl;
cout << "\nType 'help;' or '\h' for help. Type '\c' to clear the current input statement." << endl;
while(1){
try{
//throw ErCreateFile();
//throw ErTooLongIdent();
HandleOneSQL(cin);
}
catch(ErQuit &e){
cout << e.what() << endl;
break;
}
catch(DbEr &e){
cout << e.what() << endl;
}
}
system("pause");
}