ct_common
1.0.1
Common library for combinatorial testing
|
00001 /* -*- C++ -*- vim: set syntax=cpp: 00002 * 00003 * (C) 2005-2009 Frank-Rene Schaefer 00004 * ABSOLUTELY NO WARRANTY */ 00005 #ifndef __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION____CT____LEXER 00006 #define __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION____CT____LEXER 00007 /* Additionally to the 'local' include guard, there is an include indicator 00008 * 00009 * __INCLUDE_INDICATOR_QUEX__CONFIGURATION 00010 * 00011 * If it is defined, this means, that another lexical analyzer configuration 00012 * has been included before this. That in turn means, that multiple lexical 00013 * analyzers are used. The configuration settings of the previous analyzer 00014 * need to be undefined. And, this happens in "configuration/undefine". 00015 * 00016 * NOTE: We do undefine without making sure that there is an older definition 00017 * from a configuration file. This allows users to define some 00018 * configuration options on the command line without being immediately 00019 * deleted by "configuration/undefine". */ 00020 #ifdef __QUEX_INCLUDE_INDICATOR__ANALYZER__CONFIGURATION 00021 # include <quex/code_base/analyzer/configuration/undefine> 00022 #else 00023 # define __QUEX_INCLUDE_INDICATOR__ANALYZER__CONFIGURATION 00024 #endif 00025 00026 #define QUEX_SETTING_VERSION "0.62.6" 00027 #define QUEX_SETTING_BUILD_DATE "Fri Jul 11 22:13:26 2014" 00028 #define QUEX_SETTING_ANALYZER_VERSION "0.0.0-pre-release" 00029 00030 #ifndef __QUEX_OPTION_PLAIN_C 00031 /* #define __QUEX_OPTION_PLAIN_C */ 00032 #endif 00033 00034 /* NOTE: The check for the 'C++/C' version and the Assert derivation 00035 * are not to be located in 'quex/code_base/configuration/validation' 00036 * or 'quex/code_base/configuration/derived' -- errors would be hard to find .*/ 00037 #if ! defined(__QUEX_OPTION_PLAIN_C) && ! defined(__cplusplus) 00038 # error "__QUEX_OPTION_PLAIN_C must be defined if no C++ compiler is used! Call quex with option '--language C'." 00039 #endif 00040 00041 #if defined(__QUEX_INCLUDE_INDICATOR__ASSERTS) 00042 # error "Asserts have been adapted before the inclusion of the configuration file." 00043 #endif 00044 # 00045 #if defined(QUEX_OPTION_ASSERTS_DISABLED) || defined(NDEBUG) 00046 # ifdef QUEX_OPTION_ASSERTS 00047 # undef QUEX_OPTION_ASSERTS 00048 # endif 00049 #else 00050 # ifndef QUEX_OPTION_ASSERTS 00051 # define QUEX_OPTION_ASSERTS 00052 # endif 00053 #endif 00054 00055 #ifndef QUEX_OPTION_COMPUTED_GOTOS 00056 /* #define QUEX_OPTION_COMPUTED_GOTOS */ 00057 #endif 00058 00059 #define __QUEX_SETTING_MAX_MODE_CLASS_N (1) 00060 #ifndef __QUEX_SETTING_INITIAL_LEXER_MODE_ID 00061 # define __QUEX_SETTING_INITIAL_LEXER_MODE_ID (QUEX_NAME(ModeID_NORMAL)) 00062 #endif 00063 /* NOTE: QUEX_TYPE_TOKEN_ID is later on defined inside the token class header. */ 00064 #define __QUEX_SETTING_TOKEN_ID_TERMINATION ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_TERMINATION) 00065 #define __QUEX_SETTING_TOKEN_ID_UNINITIALIZED ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_UNINITIALIZED) 00066 #define __QUEX_SETTING_TOKEN_ID_INDENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_INDENT) 00067 #define __QUEX_SETTING_TOKEN_ID_DEDENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_DEDENT) 00068 #define __QUEX_SETTING_TOKEN_ID_NODENT ((QUEX_TYPE_TOKEN_ID)QUEX_TKN_NODENT) 00069 #define __QUEX_SETTING_TOKEN_ID_REPETITION_TEST(TokenID) (false) 00070 00071 #ifndef __QUEX_OPTION_LITTLE_ENDIAN 00072 #define __QUEX_OPTION_LITTLE_ENDIAN 00073 #endif 00074 #ifndef __QUEX_OPTION_BIG_ENDIAN 00075 /* #define __QUEX_OPTION_BIG_ENDIAN */ 00076 #endif 00077 #ifndef __QUEX_OPTION_SYSTEM_ENDIAN 00078 #define __QUEX_OPTION_SYSTEM_ENDIAN 00079 #endif 00080 00081 #if (! defined(QUEX_OPTION_TOKEN_POLICY_QUEUE)) && (! defined(QUEX_OPTION_TOKEN_POLICY_QUEUE)) 00082 #ifndef QUEX_OPTION_TOKEN_POLICY_QUEUE 00083 #define QUEX_OPTION_TOKEN_POLICY_QUEUE 00084 #endif 00085 #ifndef QUEX_OPTION_TOKEN_POLICY_SINGLE 00086 /* #define QUEX_OPTION_TOKEN_POLICY_SINGLE */ 00087 #endif 00088 #endif 00089 00090 #ifndef QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY 00091 /* #define QUEX_OPTION_USER_MANAGED_TOKEN_MEMORY */ 00092 #endif 00093 00094 #if defined (QUEX_OPTION_TOKEN_POLICY_QUEUE) 00095 # ifndef QUEX_SETTING_TOKEN_QUEUE_SIZE 00096 # define QUEX_SETTING_TOKEN_QUEUE_SIZE ((size_t)64) 00097 # endif 00098 # ifndef QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER 00099 # define QUEX_SETTING_TOKEN_QUEUE_SAFETY_BORDER ((size_t)16) 00100 # endif 00101 #endif 00102 00103 #ifndef QUEX_OPTION_TOKEN_REPETITION_SUPPORT 00104 /* #define QUEX_OPTION_TOKEN_REPETITION_SUPPORT */ 00105 #endif 00106 00107 /* OPTIONS: ____________________________________________________________________ 00108 * 00109 * Activate/Deactivate Options via comment/uncomment. Options without a 00110 * double underline '__' at the beginning can be turned off in the created 00111 * engine. Options that do start with '__' configure the machine for the 00112 * specified behavior. Such options are better not touched. 00113 * 00114 * -- Line Number / Column Number Counting: 00115 * Turning counting off may result in engine speed-up. */ 00116 #ifndef QUEX_OPTION_LINE_NUMBER_COUNTING 00117 #define QUEX_OPTION_LINE_NUMBER_COUNTING 00118 #endif 00119 #ifndef QUEX_OPTION_COLUMN_NUMBER_COUNTING 00120 #define QUEX_OPTION_COLUMN_NUMBER_COUNTING 00121 #endif 00122 00123 #ifndef QUEX_OPTION_POST_CATEGORIZER 00124 /* #define QUEX_OPTION_POST_CATEGORIZER */ 00125 #endif 00126 00127 /* Mode Transitions: 00128 * If the engine was created without the flag '--no-mode-transition-check' 00129 * then code for mode transition control is inserted. It can be deactivated 00130 * by commenting the following option out. */ 00131 #ifndef QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK 00132 #define QUEX_OPTION_RUNTIME_MODE_TRANSITION_CHECK 00133 #endif 00134 00135 #ifndef QUEX_SETTING_MODE_STACK_SIZE 00136 # define QUEX_SETTING_MODE_STACK_SIZE (size_t)8 00137 #endif 00138 00139 /* Verbosity (uncomment the following, if you want it verbose.) */ 00140 /* #define QUEX_OPTION_ASSERTS_WARNING_MESSAGE_DISABLED */ 00141 00142 /* Include Stack Support */ 00143 #ifndef QUEX_OPTION_INCLUDE_STACK 00144 #define QUEX_OPTION_INCLUDE_STACK 00145 #endif 00146 00147 /* BLC -- Buffer Limit Code: 00148 * 00149 * This code is used as a delimiter for buffer borders. When the analyzer 00150 * hits a character with such a code, it knows that a border or the 00151 * end of file has been reached. 00152 * 00153 * IT IS NOT SUPPOSED TO APPEAR IN THE NORMAL CHARACTER STREAM. */ 00154 #ifndef QUEX_SETTING_BUFFER_LIMIT_CODE 00155 # define QUEX_SETTING_BUFFER_LIMIT_CODE ((QUEX_TYPE_CHARACTER)0x0) 00156 #endif 00157 00158 /* PTC -- Path Termination code: 00159 * 00160 * Only required for path compression (see option '--path-compression' and 00161 * '--path-compression-uniform' for quex on the command line). PTC must be 00162 * different from the BLC so that the pathwalker does not get confuses if 00163 * the input pointer stands on a buffer border and at the same time the 00164 * path iterator stands at the end of the path. 00165 * 00166 * IT IS NOT SUPPOSED TO APPEAR IN THE NORMAL CHARACTER STREAM. */ 00167 #ifndef QUEX_SETTING_PATH_TERMINATION_CODE 00168 # define QUEX_SETTING_PATH_TERMINATION_CODE ((QUEX_TYPE_CHARACTER)0x1) 00169 #endif 00170 00171 /* NOTE: A cast to 'size_t' would it make impossible to use the macro in 00172 * pre-processor comparisons. */ 00173 #ifndef QUEX_OPTION_BUFFER_BASED_ANALYZIS 00174 /* #define QUEX_OPTION_BUFFER_BASED_ANALYZIS */ 00175 #endif 00176 #ifndef QUEX_SETTING_BUFFER_SIZE 00177 /* This setting must be defined as plain number, since there might 00178 * be some pre-processor comparison operations depending on it. */ 00179 # define QUEX_SETTING_BUFFER_SIZE 65536 00180 #endif 00181 00182 #ifndef QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE 00183 # define QUEX_SETTING_BUFFER_FILLER_SEEK_TEMP_BUFFER_SIZE (512) 00184 #endif 00185 #ifndef QUEX_SETTING_ICU_PIVOT_BUFFER_SIZE 00186 # define QUEX_SETTING_ICU_PIVOT_BUFFER_SIZE (64) 00187 #endif 00188 00189 #ifndef QUEX_OPTION_STRING_ACCUMULATOR 00190 #define QUEX_OPTION_STRING_ACCUMULATOR 00191 #endif 00192 /* Initial size of the character accumulator. */ 00193 #ifndef QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE 00194 # define QUEX_SETTING_ACCUMULATOR_INITIAL_SIZE (256) 00195 #endif 00196 /* Granularity, if new memory has to be allocated. The new 00197 * memory will be by this factor greater than the previous. 00198 * Example: At start, memory contains 256 characters; then 00199 * new allocation becomes necessary; if factor = 0.5, then 00200 * the new memory will contain (256 + 128) = 384 characters. The 00201 * next time, the new memory of size (384 + 192) = 576 characters. */ 00202 #ifndef QUEX_SETTING_ACCUMULATOR_GRANULARITY_FACTOR 00203 # define QUEX_SETTING_ACCUMULATOR_GRANULARITY_FACTOR (0.8) 00204 #endif 00205 00206 /* If one mode requires indentation support, then the lexical analyser 00207 * class must be setup for indentation counting. The following flag is 00208 * defined or undefined by the lexical analyser generator quex. */ 00209 /* #define QUEX_OPTION_INDENTATION_TRIGGER */ 00210 #if defined(QUEX_OPTION_INDENTATION_TRIGGER) 00211 # ifndef QUEX_SETTING_INDENTATION_STACK_SIZE 00212 # define QUEX_SETTING_INDENTATION_STACK_SIZE (64) 00213 # endif 00214 # ifndef QUEX_TYPE_INDENTATION 00215 # define QUEX_TYPE_INDENTATION size_t 00216 # endif 00217 #endif 00218 00219 /* Quex can determine whether certain handlers are not used at all. 00220 * If so, computation time can be spared and quex comments the following 00221 * options out. */ 00222 /* #define __QUEX_OPTION_ON_ENTRY_HANDLER_PRESENT */ 00223 /* #define __QUEX_OPTION_ON_EXIT_HANDLER_PRESENT */ 00224 /* #define QUEX_OPTION_CONVERTER_ICONV */ 00225 /* #define QUEX_OPTION_CONVERTER_ICU */ 00226 #if defined(QUEX_OPTION_CONVERTER_ICONV) || defined(QUEX_OPTION_CONVERTER_ICU) 00227 # ifndef QUEX_SETTING_TRANSLATION_BUFFER_SIZE 00228 # define QUEX_SETTING_TRANSLATION_BUFFER_SIZE ((size_t)65536) 00229 # endif 00230 #else 00231 # ifndef QUEX_SETTING_TRANSLATION_BUFFER_SIZE 00232 # define QUEX_SETTING_TRANSLATION_BUFFER_SIZE ((size_t)0) 00233 # endif 00234 #endif 00235 /* The call the the 'new' function for the converter, i.e. the function that 00236 * allocates the converter and initializes it. If it is 0x0, this means that 00237 * the converter pointer is set to 0x0. */ 00238 #ifndef QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW 00239 /* # define QUEX_SETTING_BUFFER_FILLERS_CONVERTER_NEW */ 00240 #endif 00241 00242 /* Begin of line pre-condition requires an extra flag in the buffer 00243 * structure. Only out-comment this in case of tough memory restrictions, 00244 * if no begin of line pre-condition is required. */ 00245 /* #define __QUEX_OPTION_SUPPORT_BEGIN_OF_LINE_PRE_CONDITION */ 00246 00247 /* Following switch is also set, if a user defined converter is defined. */ 00248 #ifndef __QUEX_OPTION_CONVERTER 00249 /* #define __QUEX_OPTION_CONVERTER */ 00250 #endif 00251 #ifndef __QUEX_OPTION_CONVERTER_HELPER 00252 /* #define __QUEX_OPTION_CONVERTER_HELPER */ 00253 #endif 00254 00255 /* Type Definitions 00256 * 00257 * CHARACTER TYPE: Type that represents the number of bytes used in the engine to store 00258 * a character. This is independent of the coding (ASCII, WinArabic, ...) 00259 * 00260 * Both character types are clearly related, because they are supposed to relate to the 00261 * same type of objects in memory. The following example shows, that 'uint8_t' and 'char' 00262 * belong together, the lexeme type cannot be 'uint8_t' because the std-string functions 00263 * accept 'char*' and not 'uint8_t' (which is most propperly 'unsigned char'). 00264 * 00265 * NOTE: If in parallel another engine is built with other bytes per character settings, 00266 * then the engines will also include their own header with their own definition 00267 * of QUEX_TYPE_CHARACTER. Thus there is no danger at all. 00268 * Templatifying the lexer would be possible, but the author has in mind to bring out 00269 * a 'pure C' version of the quex generated engine. Thus templating would make this 00270 * goal harder achievable. */ 00271 #ifndef QUEX_TYPE_CHARACTER 00272 # define QUEX_TYPE_CHARACTER uint8_t 00273 # define QUEX_TYPE_CHARACTER_BACKUP uint8_t 00274 #endif 00275 #ifndef QUEX_SETTING_CHARACTER_SIZE 00276 /* Size of a QUEX_TYPE_CHARACTER in bytes. A numeric value is required here! 00277 * '-1' stands for 'Cannot be determined at code generation time'. In this case, 00278 * it must be relied upon 'sizeof(QUEX_TYPE_CHARACTER)'. */ 00279 # define QUEX_SETTING_CHARACTER_SIZE 1 00280 #endif 00281 #ifndef QUEX_SETTING_CHARACTER_CODEC 00282 # define QUEX_SETTING_CHARACTER_CODEC unicode 00283 #endif 00284 /* The following flag indicates that the engine is running on a specific 00285 * codec. Thus no converter is necessary. Use the flag to detect misuse. */ 00286 /* #define __QUEX_OPTION_ENGINE_RUNNING_ON_CODEC */ 00287 00288 #ifndef QUEX_TYPE_ACCEPTANCE_ID 00289 # define QUEX_TYPE_ACCEPTANCE_ID int 00290 #endif 00291 00292 /* QUEX_TYPE_X --> Type of X in global namespace 00293 * QUEX_TYPE0_X --> Type of X in local namespace (namespace omitted) */ 00294 #if defined(__QUEX_OPTION_PLAIN_C) 00295 # define QUEX_FUNCTION_PREFIX ct_lexer_ 00296 # define QUEX_FUNCTION_DEF_PREFIX ct_lexer_ 00297 /* In 'C' there are no namespaces, so namespaces are coded directly 00298 * into the type name. Both, global and local names are equal. */ 00299 # define QUEX_TYPE0_ANALYZER struct ct_lexer_tag 00300 # define QUEX_TYPE_ANALYZER struct ct_lexer_tag 00301 # define QUEX_NAME_COMPLETE_ANALYZER ct_lexer 00302 # define QUEX_TYPE_DERIVED_ANALYZER struct ct_lexer_tag 00303 00304 # define QUEX_TYPE0_TOKEN struct ct_lexer_Token_tag 00305 # define QUEX_TYPE_TOKEN struct ct_lexer_Token_tag 00306 # define QUEX_NAME_COMPLETE_TOKEN ct_lexer_Token 00307 00308 # define QUEX_NAMESPACE_MAIN ct_lexer 00309 # define QUEX_NAMESPACE_MAIN_OPEN 00310 # define QUEX_NAMESPACE_MAIN_CLOSE 00311 00312 # define QUEX_NAMESPACE_TOKEN 00313 # define QUEX_NAMESPACE_TOKEN_OPEN 00314 # define QUEX_NAMESPACE_TOKEN_CLOSE 00315 00316 # define QUEX_NAMESPACE_LEXEME_NULL_OPEN 00317 # define QUEX_NAMESPACE_LEXEME_NULL_CLOSE 00318 # define QUEX_LEXEME_NULL_IN_ITS_NAMESPACE ct_LexemeNullObject 00319 # define QUEX_LEXEME_NULL ct_LexemeNullObject 00320 00321 # define QUEX_NAME(NAME) ct_lexer_ ## NAME 00322 # define QUEX_NAME_TOKEN(NAME) ct_lexer_Token_ ## NAME 00323 # define QUEX_MEMBER(NAME) void /* Undefined, not required */ 00324 /* When creating a 'shared token class', macros are temporarily redefined. 00325 * This happens to generate converters in the token's namespace. After 00326 * that, the original macros need to be restored. Thus: Backup! */ 00327 # define QUEX_NAMESPACE_MAIN_OPEN_BACKUP 00328 # define QUEX_NAMESPACE_MAIN_CLOSE_BACKUP 00329 # define QUEX_FUNCTION_PREFIX_BACKUP ct_lexer_ 00330 # define QUEX_FUNCTION_DEF_PREFIX_BACKUP ct_lexer_ 00331 00332 #else 00333 # define QUEX_FUNCTION_DEF_PREFIX /* Supposed we are IN the namespace for definition. */ 00334 # define QUEX_FUNCTION_PREFIX ::ct:: 00335 /* Add namespaces for the global names of the classes of analyzer 00336 * and token. */ 00337 # define QUEX_TYPE0_ANALYZER lexer 00338 # define QUEX_TYPE_ANALYZER ::ct::lexer 00339 # define QUEX_NAME_COMPLETE_ANALYZER ::ct::lexer 00340 # define QUEX_TYPE_DERIVED_ANALYZER lexer 00341 00342 # define QUEX_TYPE0_TOKEN lexer_Token 00343 # define QUEX_TYPE_TOKEN ::ct::lexer_Token 00344 # define QUEX_NAME_COMPLETE_TOKEN ::ct::lexer_Token 00345 00346 # define QUEX_NAMESPACE_MAIN ::ct 00347 # define QUEX_NAMESPACE_MAIN_OPEN namespace ct {\ 00348 00349 # define QUEX_NAMESPACE_MAIN_CLOSE } /* Closing Namespace 'ct' */\ 00350 00351 00352 # define QUEX_NAMESPACE_TOKEN ::ct 00353 # define QUEX_NAMESPACE_TOKEN_OPEN namespace ct {\ 00354 00355 # define QUEX_NAMESPACE_TOKEN_CLOSE } /* Closing Namespace 'ct' */\ 00356 00357 00358 # define QUEX_NAMESPACE_LEXEME_NULL_OPEN namespace ct {\ 00359 00360 # define QUEX_NAMESPACE_LEXEME_NULL_CLOSE } /* Closing Namespace 'ct' */\ 00361 00362 # define QUEX_LEXEME_NULL_IN_ITS_NAMESPACE LexemeNullObject 00363 # define QUEX_LEXEME_NULL ::ct::LexemeNullObject 00364 00365 # define QUEX_NAME(NAME) lexer_ ## NAME 00366 # define QUEX_NAME_TOKEN(NAME) lexer_Token_ ## NAME 00367 # define QUEX_MEMBER(NAME) lexer::NAME 00368 /* When creating a 'shared token class', macros are temporarily redefined. 00369 * This happens to generate converters in the token's namespace. After 00370 * that, the original macros need to be restored. Thus: Backup! */ 00371 # define QUEX_NAMESPACE_MAIN_OPEN_BACKUP namespace ct {\ 00372 00373 # define QUEX_NAMESPACE_MAIN_CLOSE_BACKUP } /* Closing Namespace 'ct' */\ 00374 00375 # define QUEX_FUNCTION_PREFIX_BACKUP 00376 # define QUEX_FUNCTION_DEF_PREFIX_BACKUP ::ct:: 00377 #endif 00378 00379 #ifndef QUEX_TYPE_TOKEN_ID 00380 # define QUEX_TYPE_TOKEN_ID uint32_t 00381 #endif 00382 #ifndef QUEX_TYPE_TOKEN_LINE_N 00383 # define QUEX_TYPE_TOKEN_LINE_N size_t 00384 #endif 00385 #ifndef QUEX_TYPE_TOKEN_COLUMN_N 00386 # define QUEX_TYPE_TOKEN_COLUMN_N size_t 00387 #endif 00388 00389 #include <quex/code_base/analyzer/configuration/derived> 00390 00391 #endif /* __QUEX_INCLUDE_GUARD__ANALYZER__CONFIGURATION____CT____LEXER */