ppMain.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. class PPScope;
  11. class PPCommandFile;
  12. ///////////////////////////////////////////////////////////////////
  13. // Class : PPMain
  14. // Description : Handles the toplevel processing in this program:
  15. // holds the tree of source files, and all the scopes,
  16. // etc. Generally get the ball rolling.
  17. ////////////////////////////////////////////////////////////////////
  18. class PPMain {
  19. public:
  20. PPMain(PPScope *global_scope);
  21. ~PPMain();
  22. bool read_source(const string &root);
  23. bool process_all();
  24. bool process(const string &dirname);
  25. void report_depends(const string &dirname) const;
  26. void report_needs(const string &dirname) const;
  27. static string get_root();
  28. static void chdir_root();
  29. private:
  30. bool r_process_all(PPDirectory *dir);
  31. bool p_process(PPDirectory *dir);
  32. bool read_global_file();
  33. static string get_cwd();
  34. PPScope *_global_scope;
  35. PPScope *_def_scope;
  36. PPCommandFile *_defs;
  37. PPDirectoryTree _tree;
  38. PPNamedScopes _named_scopes;
  39. PPScope *_parent_scope;
  40. static string _root;
  41. };
  42. #endif