Panda3D
dcParserDefs.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 dcParserDefs.h
10  * @author drose
11  * @date 2000-10-05
12  */
13 
14 #ifndef DCPARSERDEFS_H
15 #define DCPARSERDEFS_H
16 
17 #include "dcbase.h"
18 #include "dcSubatomicType.h"
19 
20 class DCFile;
21 class DCClass;
22 class DCSwitch;
23 class DCField;
24 class DCAtomicField;
25 class DCParameter;
26 class DCKeyword;
27 class DCPacker;
28 
29 void dc_init_parser(std::istream &in, const std::string &filename, DCFile &file);
30 void dc_init_parser_parameter_value(std::istream &in, const std::string &filename,
31  DCPacker &packer);
32 void dc_init_parser_parameter_description(std::istream &in, const std::string &filename,
33  DCFile *file);
34 DCField *dc_get_parameter_description();
35 void dc_cleanup_parser();
36 int dcyyparse();
37 
38 extern DCFile *dc_file;
39 
40 // This structure holds the return value for each token. Traditionally, this
41 // is a union, and is declared with the %union declaration in the parser.y
42 // file, but unions are pretty worthless in C++ (you can't include an object
43 // that has member functions in a union), so we'll use a class instead. That
44 // means we need to declare it externally, here.
45 
46 class EXPCL_DIRECT_DCPARSER DCTokenType {
47 public:
48  union U {
49  int s_int;
50  unsigned int s_uint;
51  int64_t int64;
52  uint64_t uint64;
53  double real;
54  bool flag;
55  DCClass *dclass;
56  DCSwitch *dswitch;
57  DCField *field;
58  DCAtomicField *atomic;
59  DCSubatomicType subatomic;
60  DCParameter *parameter;
61  const DCKeyword *keyword;
62  } u;
63  std::string str;
64  vector_uchar bytes;
65 };
66 
67 // The yacc-generated code expects to use the symbol 'YYSTYPE' to refer to the
68 // above class.
69 #define YYSTYPE DCTokenType
70 
71 #endif
A single atomic field of a Distributed Class, as read from a .dc file.
Definition: dcAtomicField.h:30
Defines a particular DistributedClass as read from an input .dc file.
Definition: dcClass.h:44
A single field of a Distributed Class, either atomic or molecular.
Definition: dcField.h:37
Represents the complete list of Distributed Class descriptions as read from a .dc file.
Definition: dcFile.h:32
This represents a single keyword declaration in the dc file.
Definition: dcKeyword.h:28
This class can be used for packing a series of numeric and string data into a binary stream,...
Definition: dcPacker.h:34
Represents the type specification for a single parameter within a field specification.
Definition: dcParameter.h:35
This represents a switch statement, which can appear inside a class body and represents two or more a...
Definition: dcSwitch.h:30
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
DCSubatomicType
This defines the numeric type of each element of a DCAtomicField; that is, the particular values that...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.