42 #include "compile.h"
43
44 static void clean_up_symbols(struct symbol_list *list)
45 {
46 struct symbol *sym;
47
48 FOR_EACH_PTR(list, sym) {
49 expand_symbol(sym);
50 emit_one_symbol(sym);
51 } END_FOR_EACH_PTR(sym);
52 }
53
54 int main(int argc, char **argv)
55 {
56 char *file;
57 struct string_list *filelist = NULL;
58
59 bits_in_bool = 8;
60
61 clean_up_symbols(sparse_initialize(argc, argv, &filelist));
62 FOR_EACH_PTR_NOTAG(filelist, file) {
63 struct symbol_list *list;
64 const char *basename = strrchr(file, '/');
65 basename = basename ? basename+1 : file;
66
67 list = sparse(file);
68
69 // Do type evaluation and simplification
70 emit_unit_begin(basename);
71 clean_up_symbols(list);
72 emit_unit_end();
73 } END_FOR_EACH_PTR_NOTAG(file);
74
75 #if 0
76 // And show the allocation statistics
77 show_ident_alloc();
78 show_token_alloc();
79 show_symbol_alloc();
80 show_expression_alloc();
81 show_statement_alloc();
82 show_string_alloc();
83 show_bytes_alloc();
84 #endif
85 return 0;
86 }
|
42 #include "compile.h"
43
44 static void clean_up_symbols(struct symbol_list *list)
45 {
46 struct symbol *sym;
47
48 FOR_EACH_PTR(list, sym) {
49 expand_symbol(sym);
50 emit_one_symbol(sym);
51 } END_FOR_EACH_PTR(sym);
52 }
53
54 int main(int argc, char **argv)
55 {
56 char *file;
57 struct string_list *filelist = NULL;
58
59 bits_in_bool = 8;
60
61 clean_up_symbols(sparse_initialize(argc, argv, &filelist));
62 FOR_EACH_PTR(filelist, file) {
63 struct symbol_list *list;
64 const char *basename = strrchr(file, '/');
65 basename = basename ? basename+1 : file;
66
67 list = sparse(file);
68
69 // Do type evaluation and simplification
70 emit_unit_begin(basename);
71 clean_up_symbols(list);
72 emit_unit_end();
73 } END_FOR_EACH_PTR(file);
74
75 #if 0
76 // And show the allocation statistics
77 show_ident_alloc();
78 show_token_alloc();
79 show_symbol_alloc();
80 show_expression_alloc();
81 show_statement_alloc();
82 show_string_alloc();
83 show_bytes_alloc();
84 #endif
85 return 0;
86 }
|