3eb9473e |
1 | #ifndef PCCTS_CONFIG_H\r |
2 | #define PCCTS_CONFIG_H\r |
3 | /*\r |
4 | * pcctscfg.h (formerly config.h) (for ANTLR, DLG, and SORCERER)\r |
5 | *\r |
6 | * This is a simple configuration file that doesn't have config stuff\r |
7 | * in it, but it's a start.\r |
8 | *\r |
9 | * SOFTWARE RIGHTS\r |
10 | *\r |
11 | * We reserve no LEGAL rights to the Purdue Compiler Construction Tool\r |
12 | * Set (PCCTS) -- PCCTS is in the public domain. An individual or\r |
13 | * company may do whatever they wish with source code distributed with\r |
14 | * PCCTS or the code generated by PCCTS, including the incorporation of\r |
15 | * PCCTS, or its output, into commerical software.\r |
16 | *\r |
17 | * We encourage users to develop software with PCCTS. However, we do ask\r |
18 | * that credit is given to us for developing PCCTS. By "credit",\r |
19 | * we mean that if you incorporate our source code into one of your\r |
20 | * programs (commercial product, research project, or otherwise) that you\r |
21 | * acknowledge this fact somewhere in the documentation, research report,\r |
22 | * etc... If you like PCCTS and have developed a nice tool with the\r |
23 | * output, please mention that you developed it using PCCTS. In\r |
24 | * addition, we ask that this header remain intact in our source code.\r |
25 | * As long as these guidelines are kept, we expect to continue enhancing\r |
26 | * this system and expect to make other tools available as they are\r |
27 | * completed.\r |
28 | *\r |
29 | * Used by PCCTS 1.33 (SORCERER 1.00B11 and up)\r |
30 | * Terence Parr\r |
31 | * Parr Research Corporation\r |
32 | * with Purdue University and AHPCRC, University of Minnesota\r |
33 | * 1989-1998\r |
34 | */\r |
35 | \r |
36 | /* This file knows about the following ``environments''\r |
37 | UNIX (default)\r |
38 | DOS (use #define PC)\r |
39 | MAC (use #define MPW; has a few things for THINK C, Metrowerks)\r |
40 | MS/C++ (MR14 Microsoft Visual C++ environment uses symbol _MSC_VER)\r |
41 | \r |
42 | */\r |
43 | \r |
44 | /* should test __STDC__ for 1, but some compilers don't set value, just def */\r |
45 | \r |
46 | #ifndef __USE_PROTOS\r |
47 | #ifdef __STDC__\r |
48 | #define __USE_PROTOS\r |
49 | #endif\r |
50 | #ifdef __cplusplus\r |
51 | #define __USE_PROTOS\r |
52 | #endif\r |
53 | #endif\r |
54 | \r |
55 | #ifdef PCCTS_USE_NAMESPACE_STD\r |
56 | #define PCCTS_NAMESPACE_STD namespace std {}; using namespace std;\r |
57 | #else\r |
58 | #define PCCTS_NAMESPACE_STD\r |
59 | #endif\r |
60 | \r |
61 | #include "pccts_stdio.h"\r |
62 | #include "pccts_stdlib.h"\r |
63 | \r |
64 | /* largest file name size */\r |
65 | \r |
66 | #ifdef _MAX_PATH\r |
67 | #define MaxFileName _MAX_PATH /* MR9 RJV: MAX_PATH defined in stdlib.h (MSVC++ 5.0) */\r |
68 | #else\r |
69 | #define MaxFileName 300\r |
70 | #endif\r |
71 | \r |
72 | /*\r |
73 | * Define PC32 if in a 32-bit PC environment (e.g. extended DOS or Win32).\r |
74 | * The macros tested here are defined by Watcom, Microsoft, Borland,\r |
75 | * and djgpp, respectively, when they are used as 32-bit compilers.\r |
76 | * Users of these compilers *must* be sure to define PC in their\r |
77 | * makefiles for this to work correctly.\r |
78 | */\r |
79 | #ifdef PC\r |
80 | # if (defined(__WATCOMC__) || defined(_WIN32) || defined(__WIN32__) || \\r |
81 | defined(__GNUC__) || defined(__GNUG__))\r |
82 | # ifndef PC32\r |
83 | # define PC32\r |
84 | # endif\r |
85 | # endif\r |
86 | #endif\r |
87 | \r |
88 | /* MR1 10-Apr-97 Default for PC is short file names */\r |
89 | /* MR1 Default for non-PC is long file names */\r |
90 | /* MR1 Can override via command line option LONGFILENAMES */\r |
91 | \r |
92 | #ifndef LONGFILENAMES\r |
93 | #ifndef PC\r |
94 | #define LONGFILENAMES\r |
95 | #endif\r |
96 | #endif\r |
97 | \r |
98 | #ifndef LONGFILENAMES\r |
99 | #define ATOKEN_H "AToken.h"\r |
100 | #define ATOKPTR_H "ATokPtr.h"\r |
101 | #define ATOKPTR_C "ATokPtr.cpp"\r |
102 | #define ATOKENBUFFER_H "ATokBuf.h"\r |
103 | #define ATOKENBUFFER_C "ATokBuf.cpp"\r |
104 | #define ATOKENSTREAM_H "ATokStr.h"\r |
105 | #define APARSER_H "AParser.h"\r |
106 | #define APARSER_C "AParser.cpp"\r |
107 | #define ASTBASE_H "ASTBase.h"\r |
108 | #define ASTBASE_C "ASTBase.cpp"\r |
109 | #define PCCTSAST_C "PCCTSAST.cpp"\r |
110 | #define LIST_C "List.cpp"\r |
111 | #define DLEXERBASE_H "DLexBase.h"\r |
112 | #define DLEXERBASE_C "DLexBase.cpp"\r |
113 | #define DLEXER_C "DLexer.cpp"\r |
114 | #define STREESUPPORT_C "STreeSup.C"\r |
115 | #else\r |
116 | #define ATOKEN_H "AToken.h"\r |
117 | #define ATOKPTR_H "ATokPtr.h"\r |
118 | #define ATOKPTR_C "ATokPtr.cpp"\r |
119 | #define ATOKENBUFFER_H "ATokenBuffer.h"\r |
120 | #define ATOKENBUFFER_C "ATokenBuffer.cpp"\r |
121 | #define ATOKENSTREAM_H "ATokenStream.h"\r |
122 | #define APARSER_H "AParser.h"\r |
123 | #define APARSER_C "AParser.cpp"\r |
124 | #define ASTBASE_H "ASTBase.h"\r |
125 | #define ASTBASE_C "ASTBase.cpp"\r |
126 | #define PCCTSAST_C "PCCTSAST.cpp"\r |
127 | #define LIST_C "List.cpp"\r |
128 | #define DLEXERBASE_H "DLexerBase.h"\r |
129 | #define DLEXERBASE_C "DLexerBase.cpp"\r |
130 | #define DLEXER_C "DLexer.cpp"\r |
131 | #define STREESUPPORT_C "STreeSupport.cpp"\r |
132 | #endif\r |
133 | \r |
134 | /* SORCERER Stuff */\r |
135 | \r |
136 | /* MR8 6-Aug-97 Change from ifdef PC to ifndef LONGFILENAMES */\r |
137 | \r |
138 | #ifndef LONGFILENAMES\r |
139 | #define STPARSER_H "STreePar.h"\r |
140 | #define STPARSER_C "STreePar.C"\r |
141 | #else\r |
142 | #define STPARSER_H "STreeParser.h"\r |
143 | #define STPARSER_C "STreeParser.cpp"\r |
144 | #endif\r |
145 | \r |
146 | #ifdef MPW\r |
147 | #define CPP_FILE_SUFFIX ".cp"\r |
148 | #define CPP_FILE_SUFFIX_NO_DOT "cp"\r |
149 | #define OBJ_FILE_SUFFIX ".o"\r |
150 | #else\r |
151 | #ifdef PC\r |
152 | #define CPP_FILE_SUFFIX ".cpp"\r |
153 | #define CPP_FILE_SUFFIX_NO_DOT "cpp"\r |
154 | #define OBJ_FILE_SUFFIX ".obj"\r |
155 | #else\r |
156 | #ifdef __VMS\r |
157 | #define CPP_FILE_SUFFIX ".cpp"\r |
158 | #define CPP_FILE_SUFFIX_NO_DOT "cpp"\r |
159 | #define OBJ_FILE_SUFFIX ".obj"\r |
160 | #else\r |
161 | #define CPP_FILE_SUFFIX ".cpp"\r |
162 | #define CPP_FILE_SUFFIX_NO_DOT "cpp"\r |
163 | #define OBJ_FILE_SUFFIX ".o"\r |
164 | #endif\r |
165 | #endif\r |
166 | #endif\r |
167 | \r |
168 | /* User may redefine how line information looks */ /* make it #line MR7 */\r |
169 | /* MR21 Use #ifndef */\r |
170 | \r |
171 | #ifndef LineInfoFormatStr\r |
172 | #define LineInfoFormatStr "#line %d \"%s\"\n"\r |
173 | #endif\r |
174 | \r |
175 | #ifdef MPW /* Macintosh Programmer's Workshop */\r |
176 | #define ErrHdr "File \"%s\"; Line %d #"\r |
177 | #else\r |
178 | #ifdef _MSC_VER /* MR14 Microsoft Visual C++ environment */\r |
179 | #define ErrHdr "%s(%d) :"\r |
180 | #else\r |
181 | #define ErrHdr "%s, line %d:" /* default */\r |
182 | #endif\r |
183 | #endif\r |
184 | \r |
185 | /* must assume old K&R cpp here, can't use #if defined(..)... */\r |
186 | \r |
187 | #ifdef MPW\r |
188 | #define TopDirectory ":"\r |
189 | #define DirectorySymbol ":"\r |
190 | #define OutputDirectoryOption "Directory where all output files should go (default=\":\")"\r |
191 | #else\r |
192 | #ifdef PC\r |
193 | #define TopDirectory "."\r |
194 | #define DirectorySymbol "\\"\r |
195 | #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"\r |
196 | #else\r |
197 | #ifdef __VMS\r |
198 | #define TopDirectory "[000000]"\r |
199 | #define DirectorySymbol "]"\r |
200 | #define OutputDirectoryOption "Directory where all output files should go (default=\"[]\")"\r |
201 | #else\r |
202 | #define TopDirectory "."\r |
203 | #define DirectorySymbol "/"\r |
204 | #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"\r |
205 | #endif\r |
206 | #endif\r |
207 | #endif\r |
208 | \r |
209 | #ifdef MPW\r |
210 | \r |
211 | /* Make sure we have prototypes for all functions under MPW */\r |
212 | \r |
213 | #include "pccts_string.h"\r |
214 | #include "pccts_stdlib.h"\r |
215 | \r |
216 | /* MR6 2-Jun-97 Fixes false dependency caused by VC++ #include scanner */\r |
217 | /* MR6 Reported by Brad Schick (schick@interaccess.com) */\r |
218 | #define MPW_CursorCtl_Header <CursorCtl.h>\r |
219 | #include MPW_CursorCtl_Header\r |
220 | #ifdef __cplusplus\r |
221 | extern "C" {\r |
222 | #endif\r |
223 | extern void fsetfileinfo (const char *filename, unsigned long newcreator, unsigned long newtype);\r |
224 | #ifdef __cplusplus\r |
225 | }\r |
226 | #endif\r |
227 | \r |
228 | /* File creators for various popular development environments */\r |
229 | \r |
230 | #define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */\r |
231 | #if 0\r |
232 | #define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */\r |
233 | #endif\r |
234 | #if 0\r |
235 | #define MAC_FILE_CREATOR 'CWIE' /* Metrowerks C/C++ Text files */\r |
236 | #endif\r |
237 | \r |
238 | #endif\r |
239 | \r |
240 | #ifdef MPW\r |
241 | #define DAWDLE SpinCursor(1)\r |
242 | #else\r |
243 | #define DAWDLE\r |
244 | #endif\r |
245 | \r |
246 | #ifdef MPW\r |
247 | #define SPECIAL_INITS\r |
248 | #define SPECIAL_FOPEN\r |
249 | #endif\r |
250 | \r |
251 | #ifdef MPW\r |
252 | #ifdef __cplusplus\r |
253 | inline\r |
254 | #else\r |
255 | static\r |
256 | #endif\r |
257 | void special_inits()\r |
258 | {\r |
259 | InitCursorCtl((acurHandle) 0);\r |
260 | }\r |
261 | #endif\r |
262 | \r |
263 | #ifdef MPW\r |
264 | #ifdef __cplusplus\r |
265 | inline\r |
266 | #else\r |
267 | static\r |
268 | #endif\r |
269 | void special_fopen_actions(char * s)\r |
270 | {\r |
271 | fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT');\r |
272 | }\r |
273 | #endif\r |
274 | \r |
275 | /* Define usable bits for set.c stuff */\r |
276 | #define BytesPerWord sizeof(unsigned)\r |
277 | #define WORDSIZE (sizeof(unsigned)*8)\r |
278 | #define LogWordSize (WORDSIZE==16?4:5)\r |
279 | \r |
280 | #ifndef TRUE\r |
281 | #define TRUE 1\r |
282 | #endif\r |
283 | #ifndef FALSE\r |
284 | #define FALSE 0\r |
285 | #endif\r |
286 | \r |
287 | #if defined(VAXC) || defined(__VMS)\r |
288 | #include <ssdef.h>\r |
289 | #define PCCTS_EXIT_SUCCESS 1\r |
290 | #define PCCTS_EXIT_FAILURE SS$_ABORT\r |
291 | #define zzDIE return SS$_ABORT;\r |
292 | #define zzDONE return 1;\r |
293 | \r |
294 | #else /* !VAXC and !__VMS */\r |
295 | \r |
296 | #define PCCTS_EXIT_SUCCESS 0\r |
297 | #define PCCTS_EXIT_FAILURE 1\r |
298 | #define zzDIE return 1;\r |
299 | #define zzDONE return 0;\r |
300 | \r |
301 | #endif\r |
302 | \r |
303 | #ifdef USER_ZZMODE_STACK\r |
304 | # ifndef ZZSTACK_MAX_MODE\r |
305 | # define ZZSTACK_MAX_MODE 32\r |
306 | # endif\r |
307 | # define ZZMAXSTK (ZZSTACK_MAX_MODE * 2)\r |
308 | #endif\r |
309 | \r |
310 | #ifndef DllExportPCCTS\r |
311 | #define DllExportPCCTS\r |
312 | #endif\r |
313 | \r |
314 | #ifdef PC\r |
315 | #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
316 | #define PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
317 | #endif\r |
318 | #endif\r |
319 | \r |
320 | #ifdef PC32\r |
321 | #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
322 | #define PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
323 | #endif\r |
324 | #endif\r |
325 | \r |
326 | #ifdef __VMS\r |
327 | #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
328 | #define PCCTS_CASE_INSENSITIVE_FILE_NAME\r |
329 | #endif\r |
330 | #endif\r |
331 | \r |
332 | #ifdef __USE_PROTOS\r |
333 | #ifndef PCCTS_USE_STDARG\r |
334 | #define PCCTS_USE_STDARG\r |
335 | #endif\r |
336 | #endif\r |
337 | \r |
338 | #ifdef __STDC__\r |
339 | #ifndef PCCTS_USE_STDARG\r |
340 | #define PCCTS_USE_STDARG\r |
341 | #endif\r |
342 | #endif\r |
343 | \r |
344 | #ifdef __cplusplus\r |
345 | #ifndef PCCTS_USE_STDARG\r |
346 | #define PCCTS_USE_STDARG\r |
347 | #endif\r |
348 | #endif\r |
349 | \r |
350 | #endif\r |