Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

config.hpp

Go to the documentation of this file.
00001 #ifndef INC_config_hpp__
00002 #define INC_config_hpp__
00003 
00004 /* ANTLR Translator Generator
00005  * Project led by Terence Parr at http://www.jGuru.com
00006  * Software rights: http://www.antlr.org/license.html
00007  *
00008  * $Id: config.hpp,v 1.1 2004/10/08 16:27:34 dfisher Exp $
00009  */
00010 
00011 /*
00012  * Just a simple configuration file to differentiate between the
00013  * various compilers used and reconfigure stuff for any oddities of the
00014  * compiler in question.
00015  *
00016  * These are the defaults. Per compiler these are amended.
00017  */
00018 #define ANTLR_USE_NAMESPACE(_x_) _x_::
00019 #define ANTLR_USING_NAMESPACE(_x_) using namespace _x_;
00020 #define ANTLR_CXX_SUPPORTS_NAMESPACE 1
00021 #define ANTLR_C_USING(_x_)
00022 #define ANTLR_API
00023 #ifndef CUSTOM_API
00024 # define CUSTOM_API
00025 #endif
00026 #define ANTLR_IOS_BASE ios_base
00027 
00030 #define ANTLR_CCTYPE_NEEDS_STD
00031 
00033 #define ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
00034 
00035 #define ANTLR_ATOI_IN_STD
00036 
00037 /******************************************************************************/
00038 /*{{{ Microsoft Visual C++ */
00039 // NOTE: If you provide patches for a specific MSVC version guard them for
00040 // the specific version!!!!
00041 // _MSC_VER == 1100 for Microsoft Visual C++ 5.0
00042 // _MSC_VER == 1200 for Microsoft Visual C++ 6.0
00043 // _MSC_VER == 1300 for Microsoft Visual C++ 7.0
00044 #if defined(_MSC_VER) && !defined(__ICL)
00045 
00046 // This warning really gets on my nerves.
00047 // It's the one about symbol longer than 256 chars, and it happens
00048 // all the time with STL.
00049 # pragma warning( disable : 4786 4231 )
00050 
00051 # ifdef ANTLR_CXX_USE_STLPORT
00052 #       undef ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
00053 # endif
00054 
00055 # if ( _MSC_VER < 1300 ) && ( defined(ANTLR_EXPORTS) || defined(ANTLR_IMPORTS) )
00056 #       error "DLL Build not supported on these MSVC versions."
00057 // see comment in lib/cpp/src/dll.cpp
00058 # endif
00059 
00060 // For the DLL support originally contributed by Stephen Naughton
00061 // If you are building statically leave ANTLR_EXPORTS/ANTLR_IMPORTS undefined
00062 // If you are building the DLL define ANTLR_EXPORTS
00063 // If you are compiling code to be used with the DLL define ANTLR_IMPORTS
00064 # ifdef ANTLR_EXPORTS
00065 #       undef ANTLR_API
00066 #       define ANTLR_API __declspec(dllexport)
00067 # endif
00068 
00069 # ifdef ANTLR_IMPORTS
00070 #       undef ANTLR_API
00071 #       define ANTLR_API __declspec(dllimport)
00072 # endif
00073 
00074 // VC6
00075 # if ( _MSC_VER == 1200 )
00076 #       undef ANTLR_ATOI_IN_STD
00077 # endif
00078 
00079 // These should be verified for newer MSVC's
00080 // Not allowed to put 'static const int XXX=20;' in a class definition
00081 # define NO_STATIC_CONSTS
00082 // Using vector<XXX> requires operator<(X,X) to be defined
00083 # define NEEDS_OPERATOR_LESS_THAN
00084 // No strcasecmp in the C library (so use stricmp instead)
00085 // - Anyone know which is in which standard?
00086 # define NO_STRCASECMP
00087 # undef ANTLR_CCTYPE_NEEDS_STD
00088 
00089 // needed for CharScannerLiteralsLess
00090 # define NO_TEMPLATE_PARTS
00091 
00092 #endif  // End of Microsoft Visual C++
00093 
00094 /*}}}*/
00095 /******************************************************************************/
00096 
00097 // RK: belongs to what compiler?
00098 #if defined(__ICL)
00099 # define NO_STRCASECMP
00100 #endif
00101 
00102 /*****************************************************************************/
00103 /*{{{ SunPro Compiler (Using OBJECTSPACE STL)
00104  *****************************************************************************/
00105 #ifdef __SUNPRO_CC
00106 
00107 # if (__SUNPRO_CC >= 0x500)
00108 
00109 #       define NEEDS_OPERATOR_LESS_THAN
00110 #       define NO_TEMPLATE_PARTS
00111 
00112 # else
00113 
00114 #       undef namespace
00115 #       define namespace
00116 
00117 #       if (__SUNPRO_CC == 0x420)
00118 
00119 /* This code is specif to SunWspro Compiler 4.2, and will compile with
00120  the objectspace 2.1 toolkit for Solaris2.6 */
00121 #        define HAS_NOT_CASSERT_H
00122 #        define HAS_NOT_CSTRING_H
00123 #        define HAS_NOT_CCTYPE_H
00124 #        define HAS_NOT_CSTDIO_H
00125 #        define HAS_OSTREAM_H
00126 
00127 /* #define OS_SOLARIS_2_6
00128  #define OS_NO_WSTRING
00129  #define OS_NO_ALLOCATORS
00130  #define OS_MULTI_THREADED
00131  #define OS_SOLARIS_NATIVE
00132  #define OS_REALTIME
00133  #define __OSVERSION__=5
00134  #define SVR4
00135  */
00136 
00137 // ObjectSpace + some specific templates constructions with stl.
00138 /* #define OS_NO_ALLOCATOR */
00139 
00140 // This great compiler does not have the namespace feature.
00141 #        undef  ANTLR_USE_NAMESPACE
00142 #        define ANTLR_USE_NAMESPACE(_x_)
00143 #        undef ANTLR_USING_NAMESPACE
00144 #        define ANTLR_USING_NAMESPACE(_x_)
00145 #        undef ANTLR_CXX_SUPPORTS_NAMESPACE
00146 #       endif           // End __SUNPRO_CC == 0x420
00147 
00148 #       undef explicit
00149 #       define explicit
00150 
00151 #       define exception os_exception
00152 #       define bad_exception os_bad_exception
00153 
00154 // Not allowed to put 'static const int XXX=20;' in a class definition
00155 #       define NO_STATIC_CONSTS
00156 // Using vector<XXX> requires operator<(X,X) to be defined
00157 #       define NEEDS_OPERATOR_LESS_THAN
00158 
00159 # endif
00160 
00161 # undef ANTLR_CCTYPE_NEEDS_STD
00162 
00163 #endif  // end __SUNPRO_CC
00164 /*}}}*/
00165 /*****************************************************************************/
00166 /*{{{ Inprise C++ Builder 3.0
00167  *****************************************************************************/
00168 #ifdef __BCPLUSPLUS__
00169 # define NO_TEMPLATE_PARTS
00170 # define NO_STRCASECMP
00171 # undef ANTLR_CCTYPE_NEEDS_STD
00172 #endif  // End of C++ Builder 3.0
00173 /*}}}*/
00174 /*****************************************************************************/
00175 /*{{{ IBM VisualAge C++ ( which includes the Dinkumware C++ Library )
00176  *****************************************************************************/
00177 #ifdef __IBMCPP__
00178 
00179 // No strcasecmp in the C library (so use stricmp instead)
00180 // - Anyone know which is in which standard?
00181 # define NO_STRCASECMP
00182 # undef ANTLR_CCTYPE_NEEDS_STD
00183 
00184 #endif  // end IBM VisualAge C++
00185 /*}}}*/
00186 /*****************************************************************************/
00187 /*{{{ Metrowerks Codewarrior
00188  *****************************************************************************/
00189 #ifdef __MWERKS__
00190 # if (__MWERKS__ <= 0x2201)
00191 #       define NO_TEMPLATE_PARTS
00192 # endif
00193 
00194 // CW 6.0 and 7.0 still do not have it.
00195 # define ANTLR_REALLY_NO_STRCASECMP
00196 
00197 # undef ANTLR_C_USING
00198 # define ANTLR_C_USING(_x_)   using std:: ## _x_;
00199 
00200 # define ANTLR_CCTYPE_NEEDS_STD
00201 # undef ANTLR_CXX_SUPPORTS_UNCAUGHT_EXCEPTION
00202 
00203 #endif  // End of Metrowerks Codewarrior
00204 /*}}}*/
00205 /*****************************************************************************/
00206 /*{{{ SGI Irix 6.5.10 MIPSPro compiler
00207  *****************************************************************************/
00208 // (contributed by Anna Winkler)
00209 // Note: you can't compile ANTLR with the MIPSPro compiler on
00210 // anything < 6.5.10 because SGI just fixed a big bug dealing with
00211 // namespaces in that release.
00212 #ifdef __sgi
00213 # define HAS_NOT_CCTYPE_H
00214 # define HAS_NOT_CSTRING_H
00215 # define HAS_NOT_CSTDIO_H
00216 # undef ANTLR_CCTYPE_NEEDS_STD
00217 #endif // End IRIX MIPSPro
00218 /*}}}*/
00219 /*****************************************************************************/
00220 /*{{{ G++ in various incarnations
00221  *****************************************************************************/
00222 // With the gcc-2.95 and 3.0 being in the near future we should start handling
00223 // incompatabilities between the various libstdc++'s.
00224 #if defined(__GNUC__) || defined(__GNUG__)
00225 // gcc 2 branch..
00226 # if (__GNUC__ == 2 )
00227 #       if (__GNUC_MINOR__ <= 8 )
00228 #        undef ANTLR_USE_NAMESPACE
00229 #        define ANTLR_USE_NAMESPACE(_x_)
00230 #        undef ANTLR_USING_NAMESPACE
00231 #        define ANTLR_USING_NAMESPACE(_x_)
00232 #        undef ANTLR_CXX_SUPPORTS_NAMESPACE
00233 #       endif
00234 #       if (__GNUC_MINOR__ > 8 && __GNUC_MINOR__ <= 95 )
00235 #         undef ANTLR_IOS_BASE
00236 #         define ANTLR_IOS_BASE ios
00237 #         undef ANTLR_CCTYPE_NEEDS_STD
00238 // compiling with -ansi ?
00239 #         ifdef __STRICT_ANSI__
00240 #               undef ANTLR_REALLY_NO_STRCASECMP
00241 #               define ANTLR_REALLY_NO_STRCASECMP
00242 #         endif
00243 #       else
00244 // experimental .96 .97 branches..
00245 #        undef ANTLR_CCTYPE_NEEDS_STD
00246 #       endif
00247 # endif
00248 #endif // ! __GNUC__
00249 /*}}}*/
00250 /*****************************************************************************/
00251 /*{{{ Digital CXX (Tru64)
00252  *****************************************************************************/
00253 #ifdef __DECCXX
00254 #define __USE_STD_IOSTREAM
00255 #endif
00256 /*}}}*/
00257 /*****************************************************************************/
00258 
00259 // Redefine these for backwards compatability..
00260 #undef ANTLR_BEGIN_NAMESPACE
00261 #undef ANTLR_END_NAMESPACE
00262 
00263 #if ANTLR_CXX_SUPPORTS_NAMESPACE == 1
00264 # define ANTLR_BEGIN_NAMESPACE(_x_) namespace _x_ {
00265 # define ANTLR_END_NAMESPACE }
00266 #else
00267 # define ANTLR_BEGIN_NAMESPACE(_x_)
00268 # define ANTLR_END_NAMESPACE
00269 #endif
00270 
00271 #endif //INC_config_hpp__

Generated on Wed Nov 3 12:58:52 2004 for Lemur Toolkit by doxygen1.2.18