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
24 #include "expression.h"
27 static void clean_up_symbols(struct symbol_list
*list
)
31 FOR_EACH_PTR(list
, sym
) {
34 } END_FOR_EACH_PTR(sym
);
37 int main(int argc
, char **argv
)
39 const char *basename
, *filename
;
40 struct symbol_list
*list
;
42 list
= sparse(argc
, argv
);
44 filename
= input_streams
[1].name
;
45 basename
= strrchr(filename
, '/');
47 filename
= basename
+1;
49 // Do type evaluation and simplification
50 emit_unit_begin(filename
);
51 clean_up_symbols(list
);
55 // And show the allocation statistics
59 show_expression_alloc();
60 show_statement_alloc();