ppMain.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Filename: ppMain.h
  2. // Created by: drose (28Sep00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. #ifndef PPMAIN_H
  6. #define PPMAIN_H
  7. #include "ppremake.h"
  8. #include "ppDirectoryTree.h"
  9. #include "ppNamedScopes.h"
  10. #include "filename.h"
  11. class PPScope;
  12. class PPCommandFile;
  13. ///////////////////////////////////////////////////////////////////
  14. // Class : PPMain
  15. // Description : Handles the toplevel processing in this program:
  16. // holds the tree of source files, and all the scopes,
  17. // etc. Generally get the ball rolling.
  18. ////////////////////////////////////////////////////////////////////
  19. class PPMain {
  20. public:
  21. PPMain(PPScope *global_scope);
  22. ~PPMain();
  23. bool read_source(const string &root);
  24. bool process_all();
  25. bool process(string dirname);
  26. void report_depends(const string &dirname) const;
  27. void report_reverse_depends(const string &dirname) const;
  28. static string get_root();
  29. static void chdir_root();
  30. private:
  31. bool r_process_all(PPDirectory *dir);
  32. bool p_process(PPDirectory *dir);
  33. bool read_global_file();
  34. static Filename get_cwd();
  35. PPScope *_global_scope;
  36. PPScope *_def_scope;
  37. PPCommandFile *_defs;
  38. PPDirectoryTree _tree;
  39. PPNamedScopes _named_scopes;
  40. PPScope *_parent_scope;
  41. static Filename _root;
  42. string _original_working_dir;
  43. };
  44. #endif