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