2 * Example test program that just uses the tokenization and
3 * preprocessing phases, and prints out the results.
5 * Copyright (C) 2003 Linus Torvalds, all rights reserved.
18 char *includepath
[] = {
19 "/usr/lib/gcc-lib/i386-redhat-linux/3.2.1/include/",
21 "/home/torvalds/v2.5/linux/include/",
22 "/home/torvalds/v2.5/linux/include/asm-i386/mach-default/",
25 "/usr/local/include/",
32 int main(int argc
, char **argv
)
34 int fd
= open(argv
[1], O_RDONLY
);
38 die("No such file: %s", argv
[1]);
41 token
= tokenize(argv
[1], fd
, NULL
);
43 token
= preprocess(token
);
45 while (!eof_token(token
)) {
46 struct token
*next
= token
->next
;
47 char * separator
= "";
52 printf("%s%s", show_token(token
), separator
);
56 show_identifier_stats();