~ubuntu-branches/ubuntu/utopic/cccc/utopic

« back to all changes in this revision

Viewing changes to pccts/h/pcctscfg.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2003-08-23 04:34:05 UTC
  • Revision ID: james.westby@ubuntu.com-20030823043405-xnzd3mn3hwtvi6dr
Tags: upstream-3.pre81
ImportĀ upstreamĀ versionĀ 3.pre81

Show diffs side-by-side

added added

removed removed

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