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  char *str; /* STRING */
41  Common::Rect *rect; /* RECT */
42  } u;
43 } Symbol;
44 
45 // Symbols
46 
47 void setSymbol(Symbol *, int);
48 
53 
56 
57 class SymbolMaps {
58 private:
59  StringQueue stringToDefine;
60  RectQueue rectToDefine;
61 
62  static void freeSymbolMap(SymbolMap &symbols);
63  static void freeSymbolList(SymbolList &symbols);
64  static void freeStringMap(StringMap &strings);
65 public:
66  SymbolMap settings;
67  SymbolMap variables;
68  SymbolMap cursors;
69  SymbolMap locations;
70  SymbolMap rects;
71  SymbolList constants;
72  SymbolList names;
73 
74  NameList variableList;
75  NameList locationList;
76 
77  StringMap strings;
78 
79  SymbolMaps() { }
80  ~SymbolMaps();
81 
82  Symbol *constant(int t, int d, const char *s);
83  Symbol *lookupVariable(Common::String *n);
84  Symbol *lookupLocation(Common::String *n);
85  Symbol *lookupRect(Common::String *n);
86  Symbol *lookupName(const char *n);
87  void installAll(const char *n);
88  void defineSymbol(const char *, Common::Rect *);
89  char *string(const char *in);
90 };
91 
92 } // End of namespace Private
93 
94 #endif
Definition: str.h:59
Definition: symbol.h:57
Definition: rect.h:524
Definition: symbol.h:35
Definition: decompiler.h:30