cppTypeParser.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Filename: cppTypeParser.h
  2. // Created by: drose (14Dec99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) Carnegie Mellon University. All rights reserved.
  8. //
  9. // All use of this software is subject to the terms of the revised BSD
  10. // license. You should have received a copy of this license along
  11. // with this source code in a file named "LICENSE."
  12. //
  13. ////////////////////////////////////////////////////////////////////
  14. #ifndef CPPTYPEPARSER_H
  15. #define CPPTYPEPARSER_H
  16. #include "dtoolbase.h"
  17. #include "cppPreprocessor.h"
  18. class CPPType;
  19. class CPPScope;
  20. ///////////////////////////////////////////////////////////////////
  21. // Class : CPPTypeParser
  22. // Description :
  23. ////////////////////////////////////////////////////////////////////
  24. class CPPTypeParser : public CPPPreprocessor {
  25. public:
  26. CPPTypeParser(CPPScope *current_scope, CPPScope *global_scope);
  27. ~CPPTypeParser();
  28. bool parse_type(const string &type);
  29. bool parse_type(const string &type, const CPPPreprocessor &filepos);
  30. void output(ostream &out) const;
  31. CPPScope *_current_scope;
  32. CPPScope *_global_scope;
  33. CPPType *_type;
  34. };
  35. inline ostream &
  36. operator << (ostream &out, const CPPTypeParser &ep) {
  37. ep.output(out);
  38. return out;
  39. }
  40. #endif