2 * Example test program that just uses the tokenization and
3 * preprocessing phases, and prints out the results.
5 * Copyright (C) 2003 Transmeta Corp.
8 * Licensed under the Open Software License version 1.1
21 int main(int argc
, char **argv
)
23 int fd
= open(argv
[1], O_RDONLY
);
27 die("No such file: %s", argv
[1]);
30 token
= tokenize(argv
[1], fd
, NULL
);
32 token
= preprocess(token
);
34 while (!eof_token(token
)) {
36 struct token
*next
= token
->next
;
37 char * separator
= "";
38 if (next
->pos
.whitespace
)
40 if (next
->pos
.newline
) {
41 separator
= "\n\t\t\t\t\t";
46 printf("%s%.*s", show_token(token
), prec
, separator
);
50 show_identifier_stats();