ppMain.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. private:
  28. bool r_process_all(PPDirectory *dir);
  29. bool p_process(PPDirectory *dir);
  30. bool read_global_file();
  31. static string get_cwd();
  32. PPScope *_global_scope;
  33. PPScope *_def_scope;
  34. PPCommandFile *_defs;
  35. PPDirectoryTree _tree;
  36. PPNamedScopes _named_scopes;
  37. PPScope *_parent_scope;
  38. };
  39. #endif