11f5207b7SJohn Levon /*
21f5207b7SJohn Levon * Example test program that just uses the tokenization and
31f5207b7SJohn Levon * preprocessing phases, and prints out the results.
41f5207b7SJohn Levon *
51f5207b7SJohn Levon * Copyright (C) 2003 Transmeta Corp.
61f5207b7SJohn Levon * 2003 Linus Torvalds
71f5207b7SJohn Levon *
81f5207b7SJohn Levon * Permission is hereby granted, free of charge, to any person obtaining a copy
91f5207b7SJohn Levon * of this software and associated documentation files (the "Software"), to deal
101f5207b7SJohn Levon * in the Software without restriction, including without limitation the rights
111f5207b7SJohn Levon * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
121f5207b7SJohn Levon * copies of the Software, and to permit persons to whom the Software is
131f5207b7SJohn Levon * furnished to do so, subject to the following conditions:
141f5207b7SJohn Levon *
151f5207b7SJohn Levon * The above copyright notice and this permission notice shall be included in
161f5207b7SJohn Levon * all copies or substantial portions of the Software.
171f5207b7SJohn Levon *
181f5207b7SJohn Levon * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
191f5207b7SJohn Levon * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
201f5207b7SJohn Levon * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
211f5207b7SJohn Levon * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
221f5207b7SJohn Levon * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
231f5207b7SJohn Levon * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
241f5207b7SJohn Levon * THE SOFTWARE.
251f5207b7SJohn Levon */
261f5207b7SJohn Levon #include <stdarg.h>
271f5207b7SJohn Levon #include <stdlib.h>
281f5207b7SJohn Levon #include <stdio.h>
291f5207b7SJohn Levon #include <string.h>
301f5207b7SJohn Levon #include <ctype.h>
311f5207b7SJohn Levon #include <unistd.h>
321f5207b7SJohn Levon #include <fcntl.h>
331f5207b7SJohn Levon
341f5207b7SJohn Levon #include "token.h"
351f5207b7SJohn Levon #include "symbol.h"
361f5207b7SJohn Levon
main(int argc,char ** argv)371f5207b7SJohn Levon int main(int argc, char **argv)
381f5207b7SJohn Levon {
391f5207b7SJohn Levon struct string_list *filelist = NULL;
401f5207b7SJohn Levon char *file;
411f5207b7SJohn Levon
421f5207b7SJohn Levon preprocess_only = 1;
431f5207b7SJohn Levon sparse_initialize(argc, argv, &filelist);
44*c85f09ccSJohn Levon FOR_EACH_PTR(filelist, file) {
451f5207b7SJohn Levon sparse(file);
46*c85f09ccSJohn Levon } END_FOR_EACH_PTR(file);
471f5207b7SJohn Levon show_identifier_stats();
481f5207b7SJohn Levon return 0;
491f5207b7SJohn Levon }
50