File indexing completed on 2025-01-26 04:43:58
0001 #ifndef BTPARSE_CONFIG_H 0002 #define BTPARSE_CONFIG_H 0003 /* 0004 * config.h (for ANTLR, DLG, and SORCERER) 0005 * 0006 * This is a simple configuration file that doesn't have config stuff 0007 * in it, but it's a start. 0008 * 0009 * SOFTWARE RIGHTS 0010 * 0011 * We reserve no LEGAL rights to the Purdue Compiler Construction Tool 0012 * Set (PCCTS) -- PCCTS is in the public domain. An individual or 0013 * company may do whatever they wish with source code distributed with 0014 * PCCTS or the code generated by PCCTS, including the incorporation of 0015 * PCCTS, or its output, into commercial software. 0016 * 0017 * We encourage users to develop software with PCCTS. However, we do ask 0018 * that credit is given to us for developing PCCTS. By "credit", 0019 * we mean that if you incorporate our source code into one of your 0020 * programs (commercial product, research project, or otherwise) that you 0021 * acknowledge this fact somewhere in the documentation, research report, 0022 * etc... If you like PCCTS and have developed a nice tool with the 0023 * output, please mention that you developed it using PCCTS. In 0024 * addition, we ask that this header remain intact in our source code. 0025 * As long as these guidelines are kept, we expect to continue enhancing 0026 * this system and expect to make other tools available as they are 0027 * completed. 0028 * 0029 * Used by PCCTS 1.33 (SORCERER 1.00B11 and up) 0030 * Terence Parr 0031 * Parr Research Corporation 0032 * with Purdue University and AHPCRC, University of Minnesota 0033 * 1989-1995 0034 */ 0035 0036 #ifndef BTCONFIG_H 0037 #define BTCONFIG_H 0038 0039 /* This file knows about the following ``environments'' 0040 UNIX (default) 0041 DOS (use #define PC) 0042 MAC (use #define MPW; has a few things for THINK C, Metrowerks) 0043 */ 0044 0045 /* 0046 * Define PC32 if in a 32-bit PC environment (e.g. extended DOS or Win32). 0047 * The macros tested here are defined by Watcom, Microsoft, Borland, 0048 * and djgpp, respectively, when they are used as 32-bit compilers. 0049 * Users of these compilers *must* be sure to define PC in their 0050 * makefiles for this to work correctly. 0051 */ 0052 #ifdef PC 0053 # if (defined(__WATCOM__) || defined(_WIN32) || defined(__WIN32__) || \ 0054 defined(__GNUC__) || defined(__GNUG__)) 0055 # ifndef PC32 0056 # define PC32 0057 # endif 0058 # endif 0059 #endif 0060 0061 #ifdef PC 0062 #define ATOKEN_H "AToken.h" 0063 #define ATOKPTR_H "ATokPtr.h" 0064 #define ATOKPTR_C "ATokPtr.cpp" 0065 #define ATOKENBUFFER_H "ATokBuf.h" 0066 #define ATOKENBUFFER_C "ATokBuf.cpp" 0067 #define ATOKENSTREAM_H "ATokStr.h" 0068 #define APARSER_H "AParser.h" 0069 #define APARSER_C "AParser.cpp" 0070 #define ASTBASE_H "ASTBase.h" 0071 #define ASTBASE_C "ASTBase.cpp" 0072 #define PCCTSAST_C "PCCTSAST.cpp" 0073 #define LIST_C "List.cpp" 0074 #define DLEXERBASE_H "DLexBase.h" 0075 #define DLEXERBASE_C "DLexBase.cpp" 0076 #define DLEXER_C "DLexer.cpp" 0077 #define STREESUPPORT_C "STreeSup.C" 0078 #else 0079 #define ATOKEN_H "AToken.h" 0080 #define ATOKPTR_H "ATokPtr.h" 0081 #define ATOKPTR_C "ATokPtr.cpp" 0082 #define ATOKENBUFFER_H "ATokenBuffer.h" 0083 #define ATOKENBUFFER_C "ATokenBuffer.cpp" 0084 #define ATOKENSTREAM_H "ATokenStream.h" 0085 #define APARSER_H "AParser.h" 0086 #define APARSER_C "AParser.cpp" 0087 #define ASTBASE_H "ASTBase.h" 0088 #define ASTBASE_C "ASTBase.cpp" 0089 #define PCCTSAST_C "PCCTSAST.cpp" 0090 #define LIST_C "List.cpp" 0091 #define DLEXERBASE_H "DLexerBase.h" 0092 #define DLEXERBASE_C "DLexerBase.cpp" 0093 #define DLEXER_C "DLexer.cpp" 0094 #define STREESUPPORT_C "STreeSupport.cpp" 0095 #endif 0096 0097 /* SORCERER Stuff */ 0098 #ifdef PC 0099 #define STPARSER_H "STreePar.h" 0100 #define STPARSER_C "STreePar.C" 0101 #else 0102 #define STPARSER_H "STreeParser.h" 0103 #define STPARSER_C "STreeParser.cpp" 0104 #endif 0105 0106 #ifdef MPW 0107 #define CPP_FILE_SUFFIX ".cp" 0108 #define CPP_FILE_SUFFIX_NO_DOT "cp" 0109 #define OBJ_FILE_SUFFIX ".o" 0110 #else 0111 #ifdef PC 0112 #define CPP_FILE_SUFFIX ".cpp" 0113 #define CPP_FILE_SUFFIX_NO_DOT "cpp" 0114 #define OBJ_FILE_SUFFIX ".obj" 0115 #else 0116 #define CPP_FILE_SUFFIX ".cpp" 0117 #define CPP_FILE_SUFFIX_NO_DOT "cpp" 0118 #define OBJ_FILE_SUFFIX ".o" 0119 #endif 0120 #endif 0121 0122 /* User may redefine how line information looks */ 0123 #define LineInfoFormatStr "# %d \"%s\"\n" 0124 0125 #ifdef MPW /* Macintosh Programmer's Workshop */ 0126 #define ErrHdr "File \"%s\"; Line %d #" 0127 #else 0128 #define ErrHdr "%s, line %d:" 0129 #endif 0130 0131 0132 /* must assume old K&R cpp here, can't use #if defined(..)... */ 0133 0134 #ifdef MPW 0135 #define TopDirectory ":" 0136 #define DirectorySymbol ":" 0137 #define OutputDirectoryOption "Directory where all output files should go (default=\":\")" 0138 #else 0139 #ifdef PC 0140 #define TopDirectory "." 0141 #define DirectorySymbol "\\" 0142 #define OutputDirectoryOption "Directory where all output files should go (default=\".\")" 0143 #else 0144 #define TopDirectory "." 0145 #define DirectorySymbol "/" 0146 #define OutputDirectoryOption "Directory where all output files should go (default=\".\")" 0147 #endif 0148 #endif 0149 0150 #ifdef MPW 0151 0152 /* Make sure we have prototypes for all functions under MPW */ 0153 0154 #include <string.h> 0155 #include <stdlib.h> 0156 #include <CursorCtl.h> 0157 #ifdef __cplusplus 0158 extern "C" { 0159 #endif 0160 extern void fsetfileinfo (char *filename, unsigned long newcreator, unsigned long newtype); 0161 #ifdef __cplusplus 0162 } 0163 #endif 0164 0165 /* File creators for various popular development environments */ 0166 0167 #define MAC_FILE_CREATOR 'MPS ' /* MPW Text files */ 0168 #if 0 0169 #define MAC_FILE_CREATOR 'KAHL' /* THINK C/Symantec C++ Text files */ 0170 #endif 0171 #if 0 0172 #define MAC_FILE_CREATOR 'MMCC' /* Metrowerks C/C++ Text files */ 0173 #endif 0174 0175 #endif 0176 0177 #ifdef MPW 0178 #define DAWDLE SpinCursor(1) 0179 #else 0180 #define DAWDLE 0181 #endif 0182 0183 0184 /* 0185 * useless definitions of special_inits() and special_fopen_actions() 0186 * deleted -- GPW 1997/09/06 0187 */ 0188 0189 /* Define usable bits for set.c stuff */ 0190 #define BytesPerWord sizeof(unsigned) 0191 #define WORDSIZE (sizeof(unsigned)*8) 0192 #define LogWordSize (WORDSIZE==16?4:5) 0193 0194 #ifndef TRUE 0195 #define TRUE 1 0196 #endif 0197 #ifndef FALSE 0198 #define FALSE 0 0199 #endif 0200 0201 #ifdef VAXC 0202 #define PCCTS_EXIT_SUCCESS 1 0203 #define PCCTS_EXIT_FAILURE 0 0204 #define zzDIE return 0; 0205 #define zzDONE return 1; 0206 0207 #else /* !VAXC */ 0208 0209 #define PCCTS_EXIT_SUCCESS 0 0210 #define PCCTS_EXIT_FAILURE 1 0211 #define zzDIE return 1; 0212 #define zzDONE return 0; 0213 0214 #endif 0215 0216 #ifdef USER_ZZMODE_STACK 0217 # ifndef ZZSTACK_MAX_MODE 0218 # define ZZSTACK_MAX_MODE 32 0219 # endif 0220 # define ZZMAXSTK (ZZSTACK_MAX_MODE * 2) 0221 #endif 0222 0223 #endif 0224 0225 #endif