Panda3D
 All Classes Functions Variables Enumerations
parserDefs.h
00001 // Filename: parserDefs.h
00002 // Created by:  drose (17Jan99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef PARSER_H
00016 #define PARSER_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "eggObject.h"
00021 
00022 #include "pointerTo.h"
00023 #include "pointerToArray.h"
00024 #include "pta_double.h"
00025 
00026 #include <string>
00027 
00028 class EggGroupNode;
00029 class LightMutex;
00030 
00031 extern LightMutex egg_lock;
00032 
00033 void egg_init_parser(istream &in, const string &filename,
00034                      EggObject *tos, EggGroupNode *egg_top_node);
00035 
00036 void egg_cleanup_parser();
00037 
00038 // This structure holds the return value for each token.
00039 // Traditionally, this is a union, and is declared with the %union
00040 // declaration in the parser.y file, but unions are pretty worthless
00041 // in C++ (you can't include an object that has member functions in a
00042 // union), so we'll use a class instead.  That means we need to
00043 // declare it externally, here.
00044 
00045 class EXPCL_PANDAEGG EggTokenType {
00046 public:
00047   double _number;
00048   unsigned long _ulong;
00049   string _string;
00050   PT(EggObject) _egg;
00051   PTA_double _number_list;
00052 };
00053 
00054 // The yacc-generated code expects to use the symbol 'YYSTYPE' to
00055 // refer to the above class.
00056 #define YYSTYPE EggTokenType
00057 
00058 #endif
 All Classes Functions Variables Enumerations