Panda3D
xFileParseData.h
1 // Filename: xFileParseData.h
2 // Created by: drose (07Oct04)
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 XFILEPARSEDATA_H
16 #define XFILEPARSEDATA_H
17 
18 #include "pandatoolbase.h"
19 #include "xFileDataObject.h"
20 #include "pointerTo.h"
21 #include "pta_int.h"
22 #include "pta_double.h"
23 #include "pvector.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : XFileParseData
27 // Description : This class is used to fill up the data into an
28 // XFileDataNodeTemplate object as the data values are
29 // parsed out of the X file. It only has a temporary
30 // lifespan; it will be converted into actual data by
31 // XFileDataNodeTemplate::finalize_parse_data().
32 ////////////////////////////////////////////////////////////////////
34 public:
36 
37  void yyerror(const string &message) const;
38 
39  enum ParseFlags {
40  PF_object = 0x001,
41  PF_reference = 0x002,
42  PF_double = 0x004,
43  PF_int = 0x008,
44  PF_string = 0x010,
45  PF_any_data = 0x01f,
46  };
47 
48  PT(XFileDataObject) _object;
49  PTA_double _double_list;
50  PTA_int _int_list;
51  string _string;
52  int _parse_flags;
53 
54  int _line_number;
55  int _col_number;
56  string _current_line;
57 };
58 
59 ////////////////////////////////////////////////////////////////////
60 // Class : XFileParseDataList
61 // Description : A container for a pvector of the above objects. We
62 // need this wrapper class to avoid circular #includes;
63 // this allows XFileNode to define a forward reference
64 // to this class (without having to include this file or
65 // know that it contains a template class).
66 ////////////////////////////////////////////////////////////////////
68 public:
70  List _list;
71 };
72 
73 #include "xFileParseData.I"
74 
75 #endif
76 
void yyerror(const string &message) const
Reports a parsing error message to the user, showing the line and column from which this object was o...
This class is used to fill up the data into an XFileDataNodeTemplate object as the data values are pa...
A container for a pvector of the above objects.
The abstract base class for a number of different types of data elements that may be stored in the X ...