cppParser.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file cppParser.h
  10. * @author drose
  11. * @date 1999-10-19
  12. */
  13. #ifndef CPPPARSER_H
  14. #define CPPPARSER_H
  15. #include "dtoolbase.h"
  16. #include "cppScope.h"
  17. #include "cppPreprocessor.h"
  18. #include "filename.h"
  19. #include <set>
  20. /**
  21. *
  22. */
  23. class CPPParser : public CPPScope, public CPPPreprocessor {
  24. public:
  25. CPPParser();
  26. virtual bool is_fully_specified() const;
  27. bool parse_file(const Filename &filename);
  28. CPPExpression *parse_expr(const std::string &expr);
  29. CPPType *parse_type(const std::string &type);
  30. };
  31. /*
  32. * Normally, this variable should be left true, especially while parsing.
  33. * However, after parsing has finished, and you want to output the results of
  34. * parsing in a way that can be successfully compiled by VC++, you may need to
  35. * set this variable to false. It controls the way typenames are written.
  36. * When true, class names are written 'class X', which is the way the parser
  37. * expects things to come, and which compiles successfully under every
  38. * compiler except VC++. When false, class names are written simply 'X',
  39. * which is the only way they'll compile under VC++.
  40. */
  41. extern bool cppparser_output_class_keyword;
  42. #endif