cppParser.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Filename: cppParser.h
  2. // Created by: drose (19Oct99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef CPPPARSER_H
  19. #define CPPPARSER_H
  20. #include "dtoolbase.h"
  21. #include "cppScope.h"
  22. #include "cppPreprocessor.h"
  23. #include "filename.h"
  24. #include <set>
  25. ///////////////////////////////////////////////////////////////////
  26. // Class : CPPParser
  27. // Description :
  28. ////////////////////////////////////////////////////////////////////
  29. class CPPParser : public CPPScope, public CPPPreprocessor {
  30. public:
  31. CPPParser();
  32. virtual bool is_fully_specified() const;
  33. bool parse_file(const Filename &filename);
  34. CPPExpression *parse_expr(const string &expr);
  35. CPPType *parse_type(const string &type);
  36. };
  37. // Normally, this variable should be left true, especially while
  38. // parsing. However, after parsing has finished, and you want to
  39. // output the results of parsing in a way that can be successfully
  40. // compiled by VC++, you may need to set this variable to false. It
  41. // controls the way typenames are written. When true, class names are
  42. // written 'class X', which is the way the parser expects things to
  43. // come, and which compiles successfully under every compiler except
  44. // VC++. When false, class names are written simply 'X', which is the
  45. // only way they'll compile under VC++.
  46. extern bool cppparser_output_class_keyword;
  47. #endif