2 * Example test program that just uses the tokenization and
3 * preprocessing phases, and prints out the results.
5 * Copyright (C) 2003 Transmeta Corp, all rights reserved.
18 int main(int argc
, char **argv
)
20 int fd
= open(argv
[1], O_RDONLY
);
24 die("No such file: %s", argv
[1]);
27 token
= tokenize(argv
[1], fd
, NULL
);
29 token
= preprocess(token
);
31 while (!eof_token(token
)) {
33 struct token
*next
= token
->next
;
34 char * separator
= "";
35 if (next
->pos
.whitespace
)
37 if (next
->pos
.newline
) {
38 separator
= "\n\t\t\t\t\t";
43 printf("%s%.*s", show_token(token
), prec
, separator
);
47 show_identifier_stats();