Used Variables instead of Options, in SConstruct
[mcc.git] / cc.c
blob23bde3fe96d05a30253c5a0a860f0ed8d72ea64c
1 #include "cc.h"
2 #include "stree.h"
3 #include "scanner.h"
4 #include "parse.h"
5 #include "stdio.h"
6 #include "stdlib.h"
7 #include "string.h"
8 #include "errors.h"
10 int cpp_main(int argc, char **argv);
11 int cc_main(int argc, char **argv);
13 int cc_main(int argc, char **argv)
15 struct cc cc_obj, *cc = &cc_obj;
17 lex_create(&cc->lex);
19 cpp_include_file(&cc->lex.cpp, "<stdin>", stdin, false);
20 lex_start(&cc->lex);
22 cc_parse(cc);
24 stree_dump(cc, cc->stree, stdout);
25 stree_destroy(cc->stree);
26 lex_delete(&cc->lex);
28 return 0;
31 int main(int argc, char **argv)
33 if (strstr(argv[0], "cpp")){
34 cpp_main(argc, argv);
35 } else {
36 cc_main(argc, argv);