2 * Example test program that just uses the tokenization and
3 * preprocessing phases, and prints out the results.
5 * Copyright (C) 2003 Transmeta Corp.
7 * Licensed under the Open Software License version 1.1
20 int main(int argc
, char **argv
)
22 int fd
= open(argv
[1], O_RDONLY
);
26 die("No such file: %s", argv
[1]);
29 token
= tokenize(argv
[1], fd
, NULL
);
31 token
= preprocess(token
);
33 while (!eof_token(token
)) {
35 struct token
*next
= token
->next
;
36 char * separator
= "";
37 if (next
->pos
.whitespace
)
39 if (next
->pos
.newline
) {
40 separator
= "\n\t\t\t\t\t";
45 printf("%s%.*s", show_token(token
), prec
, separator
);
49 show_identifier_stats();