00001 // Filename: cppParser.h 00002 // Created by: drose (19Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef CPPPARSER_H 00020 #define CPPPARSER_H 00021 00022 #include <dtoolbase.h> 00023 00024 #include "cppScope.h" 00025 #include "cppPreprocessor.h" 00026 00027 #include <set> 00028 00029 /////////////////////////////////////////////////////////////////// 00030 // Class : CPPParser 00031 // Description : 00032 //////////////////////////////////////////////////////////////////// 00033 class CPPParser : public CPPScope, public CPPPreprocessor { 00034 public: 00035 CPPParser(); 00036 00037 virtual bool is_fully_specified() const; 00038 00039 bool parse_file(const string &filename); 00040 00041 CPPExpression *parse_expr(const string &expr); 00042 CPPType *parse_type(const string &type); 00043 }; 00044 00045 // Normally, this variable should be left true, especially while 00046 // parsing. However, after parsing has finished, and you want to 00047 // output the results of parsing in a way that can be successfully 00048 // compiled by VC++, you may need to set this variable to false. It 00049 // controls the way typenames are written. When true, class names are 00050 // written 'class X', which is the way the parser expects things to 00051 // come, and which compiles successfully under every compiler except 00052 // VC++. When false, class names are written simply 'X', which is the 00053 // only way they'll compile under VC++. 00054 extern bool cppparser_output_class_keyword; 00055 00056 #endif 00057 00058