Home | History | Annotate | Download | only in h
      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 /* MR21 Use #ifndef */
    170 
    171 #ifndef LineInfoFormatStr
    172 #define LineInfoFormatStr "#line %d \"%s\"\n"
    173 #endif
    174 
    175 #ifdef MPW                      /* Macintosh Programmer's Workshop */
    176 #define ErrHdr "File \"%s\"; Line %d #"
    177 #else
    178 #ifdef _MSC_VER                 /* MR14 Microsoft Visual C++ environment */
    179 #define ErrHdr "%s(%d) :"
    180 #else
    181 #define ErrHdr "%s, line %d:"   /* default */
    182 #endif
    183 #endif
    184 
    185 /* must assume old K&R cpp here, can't use #if defined(..)... */
    186 
    187 #ifdef MPW
    188 #define TopDirectory  ":"
    189 #define DirectorySymbol  ":"
    190 #define OutputDirectoryOption "Directory where all output files should go (default=\":\")"
    191 #else
    192 #ifdef PC
    193 #define TopDirectory  "."
    194 #define DirectorySymbol  "\\"
    195 #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
    196 #else
    197 #ifdef __VMS
    198 #define TopDirectory  "[000000]"
    199 #define DirectorySymbol       "]"
    200 #define OutputDirectoryOption "Directory where all output files should go (default=\"[]\")"
    201 #else
    202 #define TopDirectory  "."
    203 #define DirectorySymbol  "/"
    204 #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
    205 #endif
    206 #endif
    207 #endif
    208 
    209 #ifdef MPW
    210 
    211 /* Make sure we have prototypes for all functions under MPW */
    212 
    213 #include "pccts_string.h"
    214 #include "pccts_stdlib.h"
    215 
    216 /* MR6 2-Jun-97  Fixes false dependency caused by VC++ #include scanner  */
    217 /* MR6       Reported by Brad Schick (schick (at) interaccess.com)  */
    218 #define  MPW_CursorCtl_Header <CursorCtl.h>
    219 #include MPW_CursorCtl_Header
    220 #ifdef __cplusplus
    221 extern "C" {
    222 #endif
    223 extern void fsetfileinfo (const char *filename, unsigned long newcreator, unsigned long newtype);
    224 #ifdef __cplusplus
    225 }
    226 #endif
    227 
    228 /* File creators for various popular development environments */
    229 
    230 #define MAC_FILE_CREATOR 'MPS '   /* MPW Text files */
    231 #if 0
    232 #define MAC_FILE_CREATOR 'KAHL'   /* THINK C/Symantec C++ Text files */
    233 #endif
    234 #if 0
    235 #define MAC_FILE_CREATOR 'CWIE'   /* Metrowerks C/C++ Text files */
    236 #endif
    237 
    238 #endif
    239 
    240 #ifdef MPW
    241 #define DAWDLE  SpinCursor(1)
    242 #else
    243 #define DAWDLE
    244 #endif
    245 
    246 #ifdef MPW
    247 #define SPECIAL_INITS
    248 #define SPECIAL_FOPEN
    249 #endif
    250 
    251 #ifdef MPW
    252 #ifdef __cplusplus
    253 inline
    254 #else
    255 static
    256 #endif
    257 void special_inits()
    258 {
    259   InitCursorCtl((acurHandle) 0);
    260 }
    261 #endif
    262 
    263 #ifdef MPW
    264 #ifdef __cplusplus
    265 inline
    266 #else
    267 static
    268 #endif
    269 void special_fopen_actions(char * s)
    270 {
    271   fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT');
    272 }
    273 #endif
    274 
    275 /* Define usable bits for set.c stuff */
    276 #define BytesPerWord  sizeof(unsigned)
    277 #define  WORDSIZE    (sizeof(unsigned)*8)
    278 #define LogWordSize     (WORDSIZE==16?4:5)
    279 
    280 #ifndef TRUE
    281 #define TRUE 1
    282 #endif
    283 #ifndef FALSE
    284 #define FALSE 0
    285 #endif
    286 
    287 #if defined(VAXC) || defined(__VMS)
    288 #include <ssdef.h>
    289 #define PCCTS_EXIT_SUCCESS 1
    290 #define PCCTS_EXIT_FAILURE SS$_ABORT
    291 #define zzDIE    return SS$_ABORT;
    292 #define zzDONE  return 1;
    293 
    294 #else /* !VAXC and !__VMS */
    295 
    296 #define PCCTS_EXIT_SUCCESS 0
    297 #define PCCTS_EXIT_FAILURE 1
    298 #define zzDIE    return 1;
    299 #define zzDONE  return 0;
    300 
    301 #endif
    302 
    303 #ifdef USER_ZZMODE_STACK
    304 # ifndef ZZSTACK_MAX_MODE
    305 #  define  ZZSTACK_MAX_MODE 32
    306 # endif
    307 # define  ZZMAXSTK (ZZSTACK_MAX_MODE * 2)
    308 #endif
    309 
    310 #ifndef DllExportPCCTS
    311 #define DllExportPCCTS
    312 #endif
    313 
    314 #ifdef PC
    315 #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
    316 #define PCCTS_CASE_INSENSITIVE_FILE_NAME
    317 #endif
    318 #endif
    319 
    320 #ifdef PC32
    321 #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
    322 #define PCCTS_CASE_INSENSITIVE_FILE_NAME
    323 #endif
    324 #endif
    325 
    326 #ifdef __VMS
    327 #ifndef PCCTS_CASE_INSENSITIVE_FILE_NAME
    328 #define PCCTS_CASE_INSENSITIVE_FILE_NAME
    329 #endif
    330 #endif
    331 
    332 #ifdef __USE_PROTOS
    333 #ifndef PCCTS_USE_STDARG
    334 #define PCCTS_USE_STDARG
    335 #endif
    336 #endif
    337 
    338 #ifdef __STDC__
    339 #ifndef PCCTS_USE_STDARG
    340 #define PCCTS_USE_STDARG
    341 #endif
    342 #endif
    343 
    344 #ifdef __cplusplus
    345 #ifndef PCCTS_USE_STDARG
    346 #define PCCTS_USE_STDARG
    347 #endif
    348 #endif
    349 
    350 #endif
    351