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]);
31 // Initialize type system
34 token
= tokenize(argv
[1], fd
, NULL
);
36 token
= preprocess(token
);
38 while (!eof_token(token
)) {
40 struct token
*next
= token
->next
;
41 char * separator
= "";
42 if (next
->pos
.whitespace
)
44 if (next
->pos
.newline
) {
45 separator
= "\n\t\t\t\t\t";
50 printf("%s%.*s", show_token(token
), prec
, separator
);
54 show_identifier_stats();