-
Notifications
You must be signed in to change notification settings - Fork 17
/
tcglob.h
175 lines (134 loc) · 4.8 KB
/
tcglob.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/* $Header: d:/cvsroot/tads/tads3/tcglob.h,v 1.4 1999/07/11 00:46:58 MJRoberts Exp $ */
/*
* Copyright (c) 1998, 2002 Michael J. Roberts. All Rights Reserved.
*
* Please see the accompanying license file, LICENSE.TXT, for information
* on using and copying this software.
*/
/*
Name
tcglob.h - TADS 3 Compiler globals
Function
The TADS 3 Compiler uses a number of static variables that are
shared by several subsystems. We define these variables as
global variables for quick access, and to minimize the number
of parameters that are passed around among subsystems.
Notes
Modified
05/01/99 MJRoberts - creation
*/
#ifndef TCGLOB_H
#define TCGLOB_H
/*
* If we're not explicitly defining the storage for the globals, define
* them as external - this lets everyone pick up external declarations
* for all of the globals simply by including this file.
*/
#ifndef TC_GLOB_DECLARE
#define TC_GLOB_DECLARE extern
#endif
/* host system interface */
TC_GLOB_DECLARE class CTcHostIfc *G_hostifc;
/* main compiler driver */
TC_GLOB_DECLARE class CTcMain *G_tcmain;
/* the parser */
TC_GLOB_DECLARE class CTcParser *G_prs;
/* parse tree node list memory manager */
TC_GLOB_DECLARE class CTcPrsMem *G_prsmem;
/* the tokenizer */
TC_GLOB_DECLARE class CTcTokenizer *G_tok;
/*
* Current code stream - this points to the currently active code stream
* object. The active code stream can vary according to what kind of
* code we're generating.
*/
TC_GLOB_DECLARE class CTcCodeStream *G_cs;
/* primary generated code stream - for all normal code */
TC_GLOB_DECLARE class CTcCodeStream *G_cs_main;
/* static initializer code stream */
TC_GLOB_DECLARE class CTcCodeStream *G_cs_static;
/* local variable name stream */
TC_GLOB_DECLARE class CTcDataStream *G_lcl_stream;
/* generated data (constant) stream */
TC_GLOB_DECLARE class CTcDataStream *G_ds;
/* TADS-Object metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_os;
/* Dictionary metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_dict_stream;
/* GrammarProduction metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_gramprod_stream;
/* BigNumber metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_bignum_stream;
/* RexPattern metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_rexpat_stream;
/* IntrinsicClass metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_int_class_stream;
/* intrinsic class modifier metaclass data stream */
TC_GLOB_DECLARE class CTcDataStream *G_icmod_stream;
/* static initializer obj.prop ID stream */
TC_GLOB_DECLARE class CTcDataStream *G_static_init_id_stream;
/* target-specific code generator class */
TC_GLOB_DECLARE class CTcGenTarg *G_cg;
/*
* Run-time metaclass table. When we're doing dynamic compilation, the
* interpreter will set this to its live metaclass table for the loaded
* program.
*/
TC_GLOB_DECLARE class CVmMetaTable *G_metaclass_tab;
/*
* object ID fixup list head, and flag indicating whether to keep object
* fixups
*/
TC_GLOB_DECLARE struct CTcIdFixup *G_objfixup;
TC_GLOB_DECLARE int G_keep_objfixups;
/*
* property ID fixup list head, and flag indicating whether to keep
* property ID fixups
*/
TC_GLOB_DECLARE struct CTcIdFixup *G_propfixup;
TC_GLOB_DECLARE int G_keep_propfixups;
/*
* enumerator ID fixup list head, and flag indicating whether to keep
* enumerator fixups
*/
TC_GLOB_DECLARE struct CTcIdFixup *G_enumfixup;
TC_GLOB_DECLARE int G_keep_enumfixups;
/*
* Debug mode - if this is true, we're compiling for debugging, so we
* must generate additional symbolic information for the debugger.
*/
TC_GLOB_DECLARE int G_debug;
/* disassembly output stream, if disassembly display is desired */
TC_GLOB_DECLARE class CTcUnasOut *G_disasm_out;
/*
* Image file sizes. For the normal compiler, these are fixed quantities
* based on the current VM version we're targeting. For the dynamic
* compiler, these are adjusted to match the data from the loaded image
* file; this is necessary to ensure that code we generate matches static
* code loaded from the image.
*/
struct tc_image_info
{
/* size of the method header */
int mhdr;
/* size of the exception table entry */
int exc_entry;
/* debugger table header size */
int dbg_hdr;
/* debugger line table entry size */
int dbg_line;
/* debugger frame record size */
int dbg_frame;
/* local symbol header size */
int lcl_hdr;
/* debug record format version ID */
int dbg_fmt_vsn;
};
TC_GLOB_DECLARE tc_image_info G_sizes;
/*
* Compiler interface to the live VM. In dynamic compilation mode, the VM
* supplies the compiler with this object to provide the compiler with
* access to VM resources.
*/
TC_GLOB_DECLARE class CTcVMIfc *G_vmifc;
#endif /* VMGLOB_H */