2 * Example trivial client program that uses the sparse library
5 * Copyright (C) 2003 Transmeta Corp.
7 * Copyright 2003 Jeff Garzik
9 * Licensed under the Open Software License version 1.1
25 #include "expression.h"
28 static void clean_up_symbols(struct symbol_list
*list
)
32 FOR_EACH_PTR(list
, sym
) {
35 } END_FOR_EACH_PTR(sym
);
38 int main(int argc
, char **argv
)
40 const char *basename
, *filename
;
41 struct symbol_list
*list
;
43 list
= sparse(argc
, argv
);
45 filename
= stream_name(1);
46 basename
= strrchr(filename
, '/');
48 filename
= basename
+1;
50 // Do type evaluation and simplification
51 emit_unit_begin(filename
);
52 clean_up_symbols(list
);
56 // And show the allocation statistics
60 show_expression_alloc();
61 show_statement_alloc();