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.
7 * 2003-2004 Linus Torvalds
9 * Licensed under the Open Software License version 1.1
24 #include "expression.h"
25 #include "linearize.h"
27 static void emit_entrypoint(struct entrypoint
*ep
)
32 static void emit_symbol(struct symbol
*sym
)
34 struct entrypoint
*ep
;
35 ep
= linearize_symbol(sym
);
40 static void emit_symbol_list(struct symbol_list
*list
)
44 FOR_EACH_PTR(list
, sym
) {
47 } END_FOR_EACH_PTR(sym
);
50 int main(int argc
, char **argv
)
52 struct string_list
*filelist
= NULL
;
55 emit_symbol_list(sparse_initialize(argc
, argv
, &filelist
));
56 FOR_EACH_PTR_NOTAG(filelist
, file
) {
57 emit_symbol_list(sparse(file
));
58 } END_FOR_EACH_PTR_NOTAG(file
);