ScummVM API documentation
symbol.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef PRIVATE_SYMBOL_H
23 #define PRIVATE_SYMBOL_H
24 
25 #include "common/str.h"
26 #include "common/hash-str.h"
27 #include "common/hash-ptr.h"
28 #include "common/queue.h"
29 #include "common/list.h"
30 #include "common/array.h"
31 #include "common/rect.h"
32 
33 namespace Private {
34 
35 typedef struct Symbol { /* symbol table entry */
36  Common::String *name;
37  short type; /* NAME, NUM, STRING or RECT */
38  union {
39  int val; /* NAME or NUM */
40  const char *str; /* STRING */
41  Common::Rect *rect; /* RECT */
42  } u;
43 } Symbol;
44 
45 // Symbols
46 
47 void setSymbol(Symbol *, int);
48 
52 
55 
56 class SymbolMaps {
57 private:
58  StringQueue stringToDefine;
59  RectQueue rectToDefine;
60 
61 public:
62  SymbolMap settings;
63  SymbolMap variables;
64  SymbolMap cursors;
65  SymbolMap locations;
66  SymbolMap rects;
67  ConstantList constants;
68 
69  NameList variableList;
70  NameList locationList;
71 
72  Symbol *constant(int t, int d, const char *s);
73  Symbol *lookupVariable(Common::String *n);
74  Symbol *lookupLocation(Common::String *n);
75  Symbol *lookupRect(Common::String *n);
76  Symbol *lookupName(const char *n);
77  void installAll(const char *n);
78  void defineSymbol(const char *, Common::Rect *);
79 };
80 
81 } // End of namespace Private
82 
83 #endif
Definition: str.h:59
Definition: symbol.h:56
Definition: rect.h:144
Definition: symbol.h:35
Definition: decompiler.h:30