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