1 /* $Header: d:/cvsroot/tads/tads3/tcglob.h,v 1.4 1999/07/11 00:46:58 MJRoberts Exp $ */
2 
3 /*
4  *   Copyright (c) 1998, 2002 Michael J. Roberts.  All Rights Reserved.
5  *
6  *   Please see the accompanying license file, LICENSE.TXT, for information
7  *   on using and copying this software.
8  */
9 /*
10 Name
11   tcglob.h - TADS 3 Compiler globals
12 Function
13   The TADS 3 Compiler uses a number of static variables that are
14   shared by several subsystems.  We define these variables as
15   global variables for quick access, and to minimize the number
16   of parameters that are passed around among subsystems.
17 
18 Notes
19 
20 Modified
21   05/01/99 MJRoberts  - creation
22 */
23 
24 #ifndef TCGLOB_H
25 #define TCGLOB_H
26 
27 /*
28  *   If we're not explicitly defining the storage for the globals, define
29  *   them as external - this lets everyone pick up external declarations
30  *   for all of the globals simply by including this file.
31  */
32 #ifndef TC_GLOB_DECLARE
33 #define TC_GLOB_DECLARE extern
34 #endif
35 
36 /* host system interface */
37 TC_GLOB_DECLARE class CTcHostIfc *G_hostifc;
38 
39 /* main compiler driver */
40 TC_GLOB_DECLARE class CTcMain *G_tcmain;
41 
42 /* the parser */
43 TC_GLOB_DECLARE class CTcParser *G_prs;
44 
45 /* parse tree node list memory manager */
46 TC_GLOB_DECLARE class CTcPrsMem *G_prsmem;
47 
48 /* the tokenizer */
49 TC_GLOB_DECLARE class CTcTokenizer *G_tok;
50 
51 /*
52  *   Current code stream - this points to the currently active code stream
53  *   object.  The active code stream can vary according to what kind of
54  *   code we're generating.
55  */
56 TC_GLOB_DECLARE class CTcCodeStream *G_cs;
57 
58 /* primary generated code stream - for all normal code */
59 TC_GLOB_DECLARE class CTcCodeStream *G_cs_main;
60 
61 /* static initializer code stream */
62 TC_GLOB_DECLARE class CTcCodeStream *G_cs_static;
63 
64 /* generated data (constant) stream */
65 TC_GLOB_DECLARE class CTcDataStream *G_ds;
66 
67 /* TADS-Object metaclass data stream */
68 TC_GLOB_DECLARE class CTcDataStream *G_os;
69 
70 /* Dictionary metaclass data stream */
71 TC_GLOB_DECLARE class CTcDataStream *G_dict_stream;
72 
73 /* GrammarProduction metaclass data stream */
74 TC_GLOB_DECLARE class CTcDataStream *G_gramprod_stream;
75 
76 /* BigNumber metaclass data stream */
77 TC_GLOB_DECLARE class CTcDataStream *G_bignum_stream;
78 
79 /* IntrinsicClass metaclass data stream */
80 TC_GLOB_DECLARE class CTcDataStream *G_int_class_stream;
81 
82 /* intrinsic class modifier metaclass data stream */
83 TC_GLOB_DECLARE class CTcDataStream *G_icmod_stream;
84 
85 /* static initializer obj.prop ID stream */
86 TC_GLOB_DECLARE class CTcDataStream *G_static_init_id_stream;
87 
88 /* target-specific code generator class */
89 TC_GLOB_DECLARE class CTcGenTarg *G_cg;
90 
91 /*
92  *   object ID fixup list head, and flag indicating whether to keep object
93  *   fixups
94  */
95 TC_GLOB_DECLARE struct CTcIdFixup *G_objfixup;
96 TC_GLOB_DECLARE int G_keep_objfixups;
97 
98 /*
99  *   property ID fixup list head, and flag indicating whether to keep
100  *   property ID fixups
101  */
102 TC_GLOB_DECLARE struct CTcIdFixup *G_propfixup;
103 TC_GLOB_DECLARE int G_keep_propfixups;
104 
105 /*
106  *   enumerator ID fixup list head, and flag indicating whether to keep
107  *   enumerator fixups
108  */
109 TC_GLOB_DECLARE struct CTcIdFixup *G_enumfixup;
110 TC_GLOB_DECLARE int G_keep_enumfixups;
111 
112 
113 /*
114  *   Debug mode - if this is true, we're compiling for debugging, so we
115  *   must generate additional symbolic information for the debugger.
116  */
117 TC_GLOB_DECLARE int G_debug;
118 
119 /* disassembly output stream, if disassembly display is desired */
120 TC_GLOB_DECLARE class CTcUnasOut *G_disasm_out;
121 
122 #endif /* VMGLOB_H */
123 
124