-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQL.java
35 lines (33 loc) · 1.34 KB
/
SQL.java
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
//////////////////////////////////////////////////////
// PROJECT ASSIGNMENT #4 //
// Stephen Erdelyi Jr - CS 457 - SQL Sim //
//////////////////////////////////////////////////////
public class SQL {
static boolean allowFatalExecution = true;
static Console console = new Console();
static Tokenizer tokenizer = new Tokenizer();
static SQLEngine sql = new SQLEngine();
static int version = 4;
public static void main(String[] args) {
/////////////////////////////////////////////////////
// STARTUP ACTIONS //
/////////////////////////////////////////////////////
console.printDiv();
console.log("SQL SIMULATOR - PA " + version + " - Steve Erdelyi");
console.printDiv();
/////////////////////////////////////////////////////
// SYSTEM READY //
/////////////////////////////////////////////////////
if(args.length == 1) {
sql.parseFile(args[0]);
} else {
String retCommand = "";
while(retCommand != "exit") {
Token token = tokenizer.parse(console.getInput());
retCommand = token.command;
sql.run(token);
}
}
console.printNewline();
}
}