2 * Example trivial client program that uses the sparse library
3 * to tokenize, preprocess and parse a C file, and prints out
6 * Copyright (C) 2003 Transmeta Corp.
9 * Licensed under the Open Software License version 1.1
24 #include "expression.h"
26 static void clean_up_symbols(struct symbol_list
*list
)
30 FOR_EACH_PTR(list
, sym
) {
32 } END_FOR_EACH_PTR(sym
);
35 int main(int argc
, char **argv
)
37 struct symbol_list
* list
;
38 struct string_list
* filelist
= NULL
;
41 list
= sparse_initialize(argc
, argv
, &filelist
);
44 clean_up_symbols(list
);
47 show_symbol_list(list
, "\n\n");
51 FOR_EACH_PTR_NOTAG(filelist
, file
) {
55 clean_up_symbols(list
);
58 // Show the end result.
59 show_symbol_list(list
, "\n\n");
62 } END_FOR_EACH_PTR_NOTAG(file
);
65 // And show the allocation statistics
69 show_expression_alloc();
70 show_statement_alloc();