-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cpp
38 lines (32 loc) · 810 Bytes
/
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
#include <iostream>
#include "args_parser.h"
#include "parser/Parser.hpp"
#include "Global.h"
#include "ui/widgets.h"
#include "compiler/Compiler.h"
using namespace llvm;
#ifdef CGUI
#include "ui/widgets.h"
static void activate(GtkApplication *app, gpointer data);
#endif
int main(int argc, char **argv) {
#ifdef CGUI
return initWindow(argc, argv, "../ui/ui/main.glade", APPNAME);
#else
// Open a new module.
auto args = ArgsParser::inst(argc, argv);
if (args == NIL) {
return RINVALID;
}
if (startAnalyze(args) == ROK) {
if (genCode(args->getOpts(), args->getOutputPath().c_str()) == ROK) {
return ROK;
} else {
errs() << "生成代码失败";
}
} else {
errs() << "分析失败";
}
#endif
return ROK;
}