00001 // Filename: dcParserDefs.h 00002 // Created by: drose (05Oct00) 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 DCPARSERDEFS_H 00020 #define DCPARSERDEFs_H 00021 00022 #include "dcbase.h" 00023 #include "dcSubatomicType.h" 00024 00025 class DCFile; 00026 class DCClass; 00027 class DCAtomicField; 00028 00029 void dc_init_parser(istream &in, const string &filename, DCFile &file); 00030 void dc_cleanup_parser(); 00031 int dcyyparse(); 00032 00033 // This structure holds the return value for each token. 00034 // Traditionally, this is a union, and is declared with the %union 00035 // declaration in the parser.y file, but unions are pretty worthless 00036 // in C++ (you can't include an object that has member functions in a 00037 // union), so we'll use a class instead. That means we need to 00038 // declare it externally, here. 00039 00040 class DCTokenType { 00041 public: 00042 union U { 00043 int integer; 00044 double real; 00045 DCClass *dclass; 00046 DCAtomicField *atomic; 00047 DCSubatomicType subatomic; 00048 } u; 00049 string str; 00050 }; 00051 00052 // The yacc-generated code expects to use the symbol 'YYSTYPE' to 00053 // refer to the above class. 00054 #define YYSTYPE DCTokenType 00055 00056 #endif