test-inspect.c 899 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <stdarg.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <ctype.h>
  6. #include <unistd.h>
  7. #include <fcntl.h>
  8. #include <locale.h>
  9. #include "lib.h"
  10. #include "allocate.h"
  11. #include "token.h"
  12. #include "parse.h"
  13. #include "symbol.h"
  14. #include "expression.h"
  15. #include "ast-view.h"
  16. static void expand_symbols(struct symbol_list *list)
  17. {
  18. struct symbol *sym;
  19. FOR_EACH_PTR(list, sym) {
  20. expand_symbol(sym);
  21. } END_FOR_EACH_PTR(sym);
  22. }
  23. int main(int argc, char **argv)
  24. {
  25. struct string_list *filelist = NULL;
  26. char *file;
  27. struct symbol_list *view_syms = NULL;
  28. gtk_init(&argc,&argv);
  29. setlocale(LC_ALL, "C");
  30. expand_symbols(sparse_initialize(argc, argv, &filelist));
  31. FOR_EACH_PTR(filelist, file) {
  32. struct symbol_list *syms = sparse(file);
  33. expand_symbols(syms);
  34. concat_symbol_list(syms, &view_syms);
  35. } END_FOR_EACH_PTR(file);
  36. treeview_main(view_syms);
  37. return 0;
  38. }