Panda3D
 All Classes Functions Variables Enumerations
xParserDefs.h
1 // Filename: xParserDefs.h
2 // Created by: drose (03Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef XPARSERDEFS_H
16 #define XPARSERDEFS_H
17 
18 #include "pandatoolbase.h"
19 #include "windowsGuid.h"
20 #include "xFileDataDef.h"
21 #include "pta_int.h"
22 #include "pta_double.h"
23 
24 class XFile;
25 class XFileNode;
26 
27 void x_init_parser(istream &in, const string &filename, XFile &file);
28 void x_cleanup_parser();
29 int xyyparse();
30 
31 // This structure holds the return value for each token.
32 // Traditionally, this is a union, and is declared with the %union
33 // declaration in the parser.y file, but unions are pretty worthless
34 // in C++ (you can't include an object that has member functions in a
35 // union), so we'll use a class instead. That means we need to
36 // declare it externally, here.
37 
38 class XTokenType {
39 public:
40  union U {
41  int number;
42  XFileNode *node;
43  XFileDataDef::Type primitive_type;
44  } u;
45  string str;
46  WindowsGuid guid;
47  PTA_double double_list;
48  PTA_int int_list;
49 };
50 
51 // The yacc-generated code expects to use the symbol 'YYSTYPE' to
52 // refer to the above class.
53 #define YYSTYPE XTokenType
54 
55 #endif
This is an implementation of the Windows GUID object, used everywhere as a world-unique identifier fo...
Definition: windowsGuid.h:29
A single node of an X file.
Definition: xFileNode.h:42
This represents the complete contents of an X file (file.x) in memory.
Definition: xFile.h:35