Panda3D
Loading...
Searching...
No Matches
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
20class DCFile;
21class DCClass;
22class DCSwitch;
23class DCField;
24class DCAtomicField;
25class DCParameter;
26class DCKeyword;
27class DCPacker;
28
29void dc_init_parser(std::istream &in, const std::string &filename, DCFile &file);
30void dc_init_parser_parameter_value(std::istream &in, const std::string &filename,
31 DCPacker &packer);
32void dc_init_parser_parameter_description(std::istream &in, const std::string &filename,
33 DCFile *file);
34DCField *dc_get_parameter_description();
35void dc_cleanup_parser();
36int dcyyparse();
37
38extern 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
46class EXPCL_DIRECT_DCPARSER DCTokenType {
47public:
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.
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.