4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
8 #define yy_create_buffer configYY_create_buffer
9 #define yy_delete_buffer configYY_delete_buffer
10 #define yy_flex_debug configYY_flex_debug
11 #define yy_init_buffer configYY_init_buffer
12 #define yy_flush_buffer configYY_flush_buffer
13 #define yy_load_buffer_state configYY_load_buffer_state
14 #define yy_switch_to_buffer configYY_switch_to_buffer
15 #define yyin configYYin
16 #define yyleng configYYleng
17 #define yylex configYYlex
18 #define yylineno configYYlineno
19 #define yyout configYYout
20 #define yyrestart configYYrestart
21 #define yytext configYYtext
22 #define yywrap configYYwrap
23 #define yyalloc configYYalloc
24 #define yyrealloc configYYrealloc
25 #define yyfree configYYfree
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 typedef uint64_t flex_uint64_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
78 /* Limits of integral types. */
80 #define INT8_MIN (-128)
83 #define INT16_MIN (-32767-1)
86 #define INT32_MIN (-2147483647-1)
89 #define INT8_MAX (127)
92 #define INT16_MAX (32767)
95 #define INT32_MAX (2147483647)
98 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
104 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE configYYrestart(configYYin )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
163 #define YY_BUF_SIZE 16384
166 /* The state buf must be large enough to hold one state per character in the main buffer.
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
180 extern yy_size_t configYYleng;
182 extern FILE *configYYin, *configYYout;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 #define YY_LESS_LINENO(n)
190 /* Return all but the first "n" matched characters back to the input stream. */
194 /* Undo effects of setting up configYYtext. */ \
195 int yyless_macro_arg = (n); \
196 YY_LESS_LINENO(yyless_macro_arg);\
197 *yy_cp = (yy_hold_char); \
198 YY_RESTORE_YY_MORE_OFFSET \
199 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
200 YY_DO_BEFORE_ACTION; /* set up configYYtext again */ \
204 #define unput(c) yyunput( c, (yytext_ptr) )
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
215 /* Size of input buffer in bytes, not including room for EOB
218 yy_size_t yy_buf_size;
220 /* Number of characters read into yy_ch_buf, not including EOB
223 yy_size_t yy_n_chars;
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
229 int yy_is_our_buffer;
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
236 int yy_is_interactive;
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
247 /* Whether to try to fill the input buffer when we reach the
252 int yy_buffer_status;
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
262 * When we actually see the EOF, we change the status to "new"
263 * (via configYYrestart()), so that the user can continue scanning by
264 * just pointing configYYin at a new input file.
266 #define YY_BUFFER_EOF_PENDING 2
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
280 * Returns the top of the stack, or NULL.
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
291 /* yy_hold_char holds the character lost when configYYtext is formed. */
292 static char yy_hold_char;
293 static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
294 yy_size_t configYYleng;
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
301 /* Flag which is used to allow configYYwrap()'s to do buffer switches
302 * instead of setting up a fresh configYYin. A bit of a hack ...
304 static int yy_did_buffer_switch_on_eof;
306 void configYYrestart (FILE *input_file );
307 void configYY_switch_to_buffer (YY_BUFFER_STATE new_buffer );
308 YY_BUFFER_STATE configYY_create_buffer (FILE *file,int size );
309 void configYY_delete_buffer (YY_BUFFER_STATE b );
310 void configYY_flush_buffer (YY_BUFFER_STATE b );
311 void configYYpush_buffer_state (YY_BUFFER_STATE new_buffer );
312 void configYYpop_buffer_state (void );
314 static void configYYensure_buffer_stack (void );
315 static void configYY_load_buffer_state (void );
316 static void configYY_init_buffer (YY_BUFFER_STATE b,FILE *file );
318 #define YY_FLUSH_BUFFER configYY_flush_buffer(YY_CURRENT_BUFFER )
320 YY_BUFFER_STATE configYY_scan_buffer (char *base,yy_size_t size );
321 YY_BUFFER_STATE configYY_scan_string (yyconst char *yy_str );
322 YY_BUFFER_STATE configYY_scan_bytes (yyconst char *bytes,yy_size_t len );
324 void *configYYalloc (yy_size_t );
325 void *configYYrealloc (void *,yy_size_t );
326 void configYYfree (void * );
328 #define yy_new_buffer configYY_create_buffer
330 #define yy_set_interactive(is_interactive) \
332 if ( ! YY_CURRENT_BUFFER ){ \
333 configYYensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
337 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
340 #define yy_set_bol(at_bol) \
342 if ( ! YY_CURRENT_BUFFER ){\
343 configYYensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
347 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
352 /* Begin user sect3 */
354 #define configYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
357 typedef unsigned char YY_CHAR;
359 FILE *configYYin = (FILE *) 0, *configYYout = (FILE *) 0;
361 typedef int yy_state_type;
363 extern int configYYlineno;
365 int configYYlineno = 1;
367 extern char *configYYtext;
368 #define yytext_ptr configYYtext
370 static yy_state_type yy_get_previous_state (void );
371 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
372 static int yy_get_next_buffer (void );
373 static void yy_fatal_error (yyconst char msg[] );
375 /* Done after the current pattern has been matched and before the
376 * corresponding action - sets up configYYtext.
378 #define YY_DO_BEFORE_ACTION \
379 (yytext_ptr) = yy_bp; \
380 configYYleng = (yy_size_t) (yy_cp - yy_bp); \
381 (yy_hold_char) = *yy_cp; \
383 (yy_c_buf_p) = yy_cp;
385 #define YY_NUM_RULES 24
386 #define YY_END_OF_BUFFER 25
387 /* This struct is not used in this scanner,
388 but its presence is necessary. */
391 flex_int32_t yy_verify;
394 static yyconst flex_int16_t yy_accept[100] =
396 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
397 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
398 25, 22, 23, 22, 22, 2, 8, 22, 8, 19,
399 22, 9, 13, 12, 2, 12, 12, 17, 18, 11,
400 10, 18, 18, 16, 14, 14, 16, 16, 7, 22,
401 7, 7, 0, 21, 0, 8, 0, 0, 0, 8,
402 3, 0, 20, 12, 12, 17, 18, 11, 18, 15,
403 7, 0, 7, 0, 0, 4, 12, 18, 7, 7,
404 1, 0, 1, 1, 1, 0, 0, 0, 0, 0,
405 6, 0, 0, 0, 0, 0, 0, 5, 0
409 static yyconst flex_int32_t yy_ec[256] =
411 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
412 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
413 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
414 1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
415 1, 1, 7, 1, 1, 1, 1, 8, 9, 9,
416 9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
417 10, 1, 1, 11, 12, 13, 14, 15, 16, 13,
418 13, 17, 18, 13, 13, 19, 13, 20, 13, 21,
419 13, 13, 13, 22, 23, 13, 13, 13, 13, 13,
420 1, 24, 1, 1, 25, 1, 13, 13, 13, 26,
422 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
423 13, 13, 13, 13, 13, 13, 13, 13, 13, 27,
424 13, 13, 1, 1, 1, 1, 1, 1, 1, 1,
425 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
436 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
437 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
441 static yyconst flex_int32_t yy_meta[29] =
443 1, 2, 3, 4, 3, 5, 6, 7, 7, 6,
444 1, 8, 8, 8, 8, 8, 8, 8, 8, 8,
445 8, 8, 8, 1, 7, 8, 8, 1
448 static yyconst flex_int16_t yy_base[112] =
450 0, 1, 29, 0, 55, 56, 82, 108, 135, 162,
451 190, 0, 217, 244, 58, 65, 66, 68, 271, 298,
452 145, 408, 408, 3, 117, 408, 0, 125, 6, 408,
453 7, 408, 408, 0, 0, 15, 115, 0, 0, 133,
454 408, 18, 107, 408, 408, 408, 62, 106, 0, 0,
455 70, 104, 73, 408, 122, 0, 109, 93, 118, 95,
456 408, 105, 408, 0, 118, 0, 0, 123, 116, 408,
457 0, 117, 113, 94, 105, 408, 92, 91, 408, 90,
458 408, 82, 0, 0, 0, 75, 66, 62, 102, 13,
459 408, 41, 48, 5, 9, 89, 113, 408, 408, 326,
461 334, 342, 350, 358, 360, 367, 375, 4, 383, 391,
465 static yyconst flex_int16_t yy_def[112] =
467 100, 100, 99, 3, 100, 100, 100, 100, 101, 101,
468 99, 11, 102, 102, 103, 103, 100, 100, 104, 104,
469 99, 99, 99, 99, 99, 99, 105, 99, 106, 99,
470 99, 99, 99, 107, 107, 107, 107, 108, 109, 99,
471 99, 109, 109, 99, 99, 99, 99, 99, 110, 111,
472 110, 110, 99, 99, 99, 105, 99, 99, 99, 106,
473 99, 99, 99, 107, 107, 108, 109, 99, 109, 99,
474 110, 111, 110, 99, 99, 99, 107, 109, 99, 110,
475 99, 99, 107, 109, 110, 99, 99, 99, 99, 99,
476 99, 99, 99, 99, 99, 99, 99, 99, 0, 99,
478 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
482 static yyconst flex_int16_t yy_nxt[437] =
484 99, 99, 23, 23, 53, 54, 53, 58, 62, 63,
485 62, 66, 59, 99, 90, 61, 53, 54, 53, 53,
486 54, 53, 91, 24, 24, 96, 95, 25, 25, 22,
487 22, 23, 22, 22, 26, 22, 27, 27, 22, 28,
488 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
489 29, 29, 24, 29, 29, 29, 25, 30, 30, 94,
490 45, 93, 46, 53, 54, 53, 70, 45, 23, 46,
491 23, 53, 54, 53, 53, 54, 53, 89, 31, 31,
492 88, 47, 25, 25, 32, 48, 33, 26, 47, 24,
493 97, 24, 48, 25, 58, 25, 58, 87, 98, 59,
495 86, 59, 61, 90, 61, 24, 62, 63, 62, 25,
496 32, 91, 33, 26, 97, 85, 84, 83, 82, 81,
497 80, 79, 98, 78, 68, 77, 92, 76, 75, 74,
498 73, 24, 55, 69, 68, 25, 22, 32, 22, 33,
499 35, 65, 57, 55, 99, 99, 99, 99, 99, 99,
500 99, 99, 99, 99, 99, 99, 99, 99, 36, 99,
501 99, 99, 37, 22, 32, 22, 33, 35, 99, 99,
502 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
503 99, 99, 99, 99, 99, 36, 99, 99, 99, 37,
504 22, 22, 32, 22, 22, 26, 22, 22, 22, 22,
506 22, 38, 38, 38, 38, 38, 38, 38, 38, 38,
507 38, 38, 38, 24, 22, 38, 38, 25, 40, 41,
508 22, 33, 26, 99, 99, 99, 99, 99, 99, 99,
509 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
510 42, 99, 99, 99, 43, 40, 41, 22, 33, 26,
511 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
512 99, 99, 99, 99, 99, 99, 99, 42, 99, 99,
513 99, 43, 22, 23, 22, 50, 99, 99, 99, 99,
514 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
515 99, 99, 99, 99, 51, 99, 99, 99, 52, 22,
517 23, 22, 50, 99, 99, 99, 99, 99, 99, 99,
518 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
519 99, 51, 99, 99, 99, 52, 22, 22, 22, 22,
520 22, 22, 22, 22, 34, 34, 34, 34, 34, 34,
521 34, 34, 39, 39, 39, 39, 39, 39, 39, 39,
522 44, 44, 44, 44, 44, 44, 44, 44, 49, 49,
523 49, 49, 49, 49, 49, 49, 56, 56, 60, 99,
524 99, 99, 60, 60, 60, 64, 99, 99, 99, 64,
525 64, 64, 64, 67, 99, 99, 99, 99, 67, 67,
526 67, 71, 99, 99, 99, 71, 71, 71, 71, 72,
528 72, 99, 72, 72, 72, 72, 72, 21, 99, 99,
529 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
530 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
531 99, 99, 99, 99, 99, 99
534 static yyconst flex_int16_t yy_chk[437] =
536 0, 0, 1, 2, 24, 24, 24, 29, 31, 31,
537 31, 108, 29, 0, 90, 29, 36, 36, 36, 42,
538 42, 42, 90, 1, 2, 95, 94, 1, 2, 3,
539 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
540 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
541 3, 3, 3, 3, 3, 3, 3, 5, 6, 93,
542 15, 92, 15, 47, 47, 47, 47, 16, 17, 16,
543 18, 51, 51, 51, 53, 53, 53, 88, 5, 6,
544 87, 15, 5, 6, 7, 15, 7, 7, 16, 17,
545 96, 18, 16, 17, 58, 18, 60, 86, 96, 58,
547 82, 60, 58, 89, 60, 7, 62, 62, 62, 7,
548 8, 89, 8, 8, 97, 80, 78, 77, 75, 74,
549 73, 72, 97, 69, 68, 65, 89, 59, 57, 55,
550 52, 8, 48, 43, 40, 8, 9, 9, 9, 9,
551 9, 37, 28, 25, 21, 0, 0, 0, 0, 0,
552 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,
553 0, 0, 9, 10, 10, 10, 10, 10, 0, 0,
554 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
555 0, 0, 0, 0, 0, 10, 0, 0, 0, 10,
556 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
558 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
559 11, 11, 11, 11, 11, 11, 11, 11, 13, 13,
560 13, 13, 13, 0, 0, 0, 0, 0, 0, 0,
561 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
562 13, 0, 0, 0, 13, 14, 14, 14, 14, 14,
563 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
564 0, 0, 0, 0, 0, 0, 0, 14, 0, 0,
565 0, 14, 19, 19, 19, 19, 0, 0, 0, 0,
566 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
567 0, 0, 0, 0, 19, 0, 0, 0, 19, 20,
569 20, 20, 20, 0, 0, 0, 0, 0, 0, 0,
570 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
571 0, 20, 0, 0, 0, 20, 100, 100, 100, 100,
572 100, 100, 100, 100, 101, 101, 101, 101, 101, 101,
573 101, 101, 102, 102, 102, 102, 102, 102, 102, 102,
574 103, 103, 103, 103, 103, 103, 103, 103, 104, 104,
575 104, 104, 104, 104, 104, 104, 105, 105, 106, 0,
576 0, 0, 106, 106, 106, 107, 0, 0, 0, 107,
577 107, 107, 107, 109, 0, 0, 0, 0, 109, 109,
578 109, 110, 0, 0, 0, 110, 110, 110, 110, 111,
580 111, 0, 111, 111, 111, 111, 111, 99, 99, 99,
581 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
582 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
583 99, 99, 99, 99, 99, 99
586 static yy_state_type yy_last_accepting_state;
587 static char *yy_last_accepting_cpos;
589 extern int configYY_flex_debug;
590 int configYY_flex_debug = 0;
592 /* The intent behind this definition is that it'll catch
593 * any uses of REJECT which flex missed.
595 #define REJECT reject_used_but_not_detected
596 #define yymore() yymore_used_but_not_detected
597 #define YY_MORE_ADJ 0
598 #define YY_RESTORE_YY_MORE_OFFSET
601 /******************************************************************************
603 * Copyright (C) 1997-2012 by Dimitri van Heesch.
605 * Permission to use, copy, modify, and distribute this software and its
606 * documentation under the terms of the GNU General Public License is hereby
607 * granted. No representations are made about the suitability of this software
608 * for any purpose. It is provided "as is" without express or implied warranty.
609 * See the GNU General Public License for more details.
624 #include <qfileinfo.h>
626 #include <qtextstream.h>
633 #include "portable.h"
636 #include "lang_cfg.h"
637 #include "configoptions.h"
639 #undef Config_getString
641 #undef Config_getList
642 #undef Config_getEnum
643 #undef Config_getBool
645 #define YY_NO_INPUT 1
647 // use in-class definitions
648 #define Config_getString(val) getString(__FILE__,__LINE__,val)
649 #define Config_getInt(val) getInt(__FILE__,__LINE__,val)
650 #define Config_getList(val) getList(__FILE__,__LINE__,val)
651 #define Config_getEnum(val) getEnum(__FILE__,__LINE__,val)
652 #define Config_getBool(val) getBool(__FILE__,__LINE__,val)
654 void config_err(const char *fmt, ...)
658 vfprintf(stderr, fmt, args);
661 void config_warn(const char *fmt, ...)
665 vfprintf(stderr, fmt, args);
669 static QCString configStringRecode(
671 const char *fromEncoding,
672 const char *toEncoding);
674 #define MAX_INCLUDE_DEPTH 10
675 #define YY_NEVER_INTERACTIVE 1
677 /* -----------------------------------------------------------------
679 QCString ConfigOption::convertToComment(const QCString &s)
682 if (s.isEmpty()) return result;
685 QCString tmp=s.stripWhiteSpace();
706 void ConfigOption::writeBoolValue(FTextStream &t,bool v)
709 if (v) t << "YES"; else t << "NO";
712 void ConfigOption::writeIntValue(FTextStream &t,int i)
717 void ConfigOption::writeStringValue(FTextStream &t,QCString &s)
720 bool needsEscaping=FALSE;
721 // convert the string back to it original encoding
722 QCString se = configStringRecode(s,"UTF-8",m_encoding);
723 const char *p=se.data();
727 while ((c=*p++)!=0 && !needsEscaping)
728 needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#');
735 if (*p==' ' && *(p+1)=='\0') break; // skip inserted space at the end
736 if (*p=='"') t << "\\"; // escape quotes
748 void ConfigOption::writeStringList(FTextStream &t,QStrList &l)
750 const char *p = l.first();
758 writeStringValue(t,s);
760 if (p) t << " \\" << endl;
764 /* -----------------------------------------------------------------
767 Config *Config::m_instance = 0;
769 void ConfigInt::convertStrToVal()
771 if (!m_valueString.isEmpty())
774 int val = m_valueString.toInt(&ok);
775 if (!ok || val<m_minVal || val>m_maxVal)
777 config_warn("warning: argument `%s' for option %s is not a valid number in the range [%d..%d]!\n"
778 "Using the default: %d!\n",m_valueString.data(),m_name.data(),m_minVal,m_maxVal,m_value);
784 void ConfigBool::convertStrToVal()
786 QCString val = m_valueString.stripWhiteSpace().lower();
789 if (val=="yes" || val=="true" || val=="1" || val=="all")
793 else if (val=="no" || val=="false" || val=="0" || val=="none")
799 config_warn("warning: argument `%s' for option %s is not a valid boolean value\n"
800 "Using the default: %s!\n",m_valueString.data(),m_name.data(),m_value?"YES":"NO");
805 QCString &Config::getString(const char *fileName,int num,const char *name) const
807 ConfigOption *opt = m_dict->find(name);
810 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
813 else if (opt->kind()!=ConfigOption::O_String)
815 config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
818 return *((ConfigString *)opt)->valueRef();
821 QStrList &Config::getList(const char *fileName,int num,const char *name) const
823 ConfigOption *opt = m_dict->find(name);
826 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
829 else if (opt->kind()!=ConfigOption::O_List)
831 config_err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
834 return *((ConfigList *)opt)->valueRef();
837 QCString &Config::getEnum(const char *fileName,int num,const char *name) const
839 ConfigOption *opt = m_dict->find(name);
842 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
845 else if (opt->kind()!=ConfigOption::O_Enum)
847 config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
850 return *((ConfigEnum *)opt)->valueRef();
853 int &Config::getInt(const char *fileName,int num,const char *name) const
855 ConfigOption *opt = m_dict->find(name);
858 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
861 else if (opt->kind()!=ConfigOption::O_Int)
863 config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
866 return *((ConfigInt *)opt)->valueRef();
869 bool &Config::getBool(const char *fileName,int num,const char *name) const
871 ConfigOption *opt = m_dict->find(name);
874 config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
877 else if (opt->kind()!=ConfigOption::O_Bool)
879 config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
882 return *((ConfigBool *)opt)->valueRef();
885 /* -----------------------------------------------------------------
888 void ConfigInt::writeXML(FTextStream& t)
890 t << " <option type='int' "
891 "id='" << convertToXML(name()) << "' "
892 "docs='\n" << convertToXML(docs()) << "' "
893 "minval='" << m_minVal << "' "
894 "maxval='" << m_maxVal << "' "
895 "defval='" << m_defValue << "'";
896 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
900 void ConfigBool::writeXML(FTextStream& t)
902 t << " <option type='bool' "
903 "id='" << convertToXML(name()) << "' "
904 "docs='\n" << convertToXML(docs()) << "' "
905 "defval='" << m_defValue << "'";
906 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
910 void ConfigString::writeXML(FTextStream& t)
913 switch (m_widgetType)
915 case String: format="string"; break;
916 case File: format="file"; break;
917 case Dir: format="dir"; break;
919 t << " <option type='string' "
920 "id='" << convertToXML(name()) << "' "
921 "format='" << format << "' "
922 "docs='\n" << convertToXML(docs()) << "' "
923 "defval='" << convertToXML(m_defValue) << "'";
924 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
928 void ConfigEnum::writeXML(FTextStream &t)
930 t << " <option type='enum' "
931 "id='" << convertToXML(name()) << "' "
932 "defval='" << convertToXML(m_defValue) << "' "
933 "docs='\n" << convertToXML(docs()) << "'";
934 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
937 char *enumVal = m_valueRange.first();
940 t << " <value name='" << convertToXML(enumVal) << "'/>" << endl;
941 enumVal = m_valueRange.next();
944 t << " </option>" << endl;
947 void ConfigList::writeXML(FTextStream &t)
950 switch (m_widgetType)
952 case String: format="string"; break;
953 case File: format="file"; break;
954 case Dir: format="dir"; break;
955 case FileAndDir: format="filedir"; break;
957 t << " <option type='list' "
958 "id='" << convertToXML(name()) << "' "
959 "format='" << format << "' "
960 "docs='\n" << convertToXML(docs()) << "'";
961 if (!m_dependency.isEmpty()) t << " depends='" << m_dependency << "'";
963 char *enumVal = m_value.first();
966 t << " <value name='" << convertToXML(enumVal) << "'/>" << endl;
967 enumVal = m_value.next();
970 t << " </option>" << endl;
973 void ConfigObsolete::writeXML(FTextStream &t)
975 t << " <option type='obsolete' "
976 "id='" << convertToXML(name()) << "'/>" << endl;
980 /* -----------------------------------------------------------------
985 struct ConfigFileState
989 YY_BUFFER_STATE oldState;
990 YY_BUFFER_STATE newState;
994 static const char *inputString;
995 static int inputPosition;
997 static QCString yyFileName;
998 static QCString tmpString;
999 static QCString *s=0;
1001 static QStrList *l=0;
1002 static int lastState;
1003 static QCString elemStr;
1004 static QCString includeName;
1005 static QStrList includePathList;
1006 static QStack<ConfigFileState> includeStack;
1007 static int includeDepth;
1009 static QCString tabSizeString;
1010 static QCString maxInitLinesString;
1011 static QCString colsInAlphaIndexString;
1012 static QCString enumValuesPerLineString;
1013 static QCString treeViewWidthString;
1014 static QCString maxDotGraphWidthString;
1015 static QCString maxDotGraphHeightString;
1016 static QCString encoding;
1018 static Config *config;
1020 /* -----------------------------------------------------------------
1023 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1025 static int yyread(char *buf,int max_size)
1028 if (includeStack.isEmpty())
1031 if (inputString==0) return c;
1032 while( c < max_size && inputString[inputPosition] )
1034 *buf = inputString[inputPosition++] ;
1041 //assert(includeStack.current()->newState==YY_CURRENT_BUFFER);
1042 return (int)fread(buf,1,max_size,includeStack.current()->filePtr);
1047 static QCString configStringRecode(
1048 const QCString &str,
1049 const char *fromEncoding,
1050 const char *toEncoding)
1052 QCString inputEncoding = fromEncoding;
1053 QCString outputEncoding = toEncoding;
1054 if (inputEncoding.isEmpty() || outputEncoding.isEmpty() || inputEncoding==outputEncoding) return str;
1055 int inputSize=str.length();
1056 int outputSize=inputSize*4+1;
1057 QCString output(outputSize);
1058 void *cd = portable_iconv_open(outputEncoding,inputEncoding);
1059 if (cd==(void *)(-1))
1061 fprintf(stderr,"error: unsupported character conversion: '%s'->'%s'\n",
1062 inputEncoding.data(),outputEncoding.data());
1065 size_t iLeft=(size_t)inputSize;
1066 size_t oLeft=(size_t)outputSize;
1067 char *inputPtr = str.data();
1068 char *outputPtr = output.data();
1069 if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
1071 outputSize-=(int)oLeft;
1072 output.resize(outputSize+1);
1073 output.at(outputSize)='\0';
1074 //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data());
1078 fprintf(stderr,"error: failed to translate characters from %s to %s: %s\n",
1079 inputEncoding.data(),outputEncoding.data(),strerror(errno));
1082 portable_iconv_close(cd);
1086 static void checkEncoding()
1088 ConfigString *option = (ConfigString*)config->get("DOXYFILE_ENCODING");
1089 encoding = *option->valueRef();
1092 static FILE *tryPath(const char *path,const char *fileName)
1094 QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
1095 QFileInfo fi(absName);
1096 if (fi.exists() && fi.isFile())
1098 FILE *f=portable_fopen(absName,"r");
1099 if (!f) config_err("error: could not open file %s for reading\n",absName.data());
1105 static void substEnvVarsInStrList(QStrList &sl);
1106 static void substEnvVarsInString(QCString &s);
1108 static bool isAbsolute(const char * fileName)
1111 if (isalpha (fileName [0]) && fileName[1] == ':')
1114 char const fst = fileName [0];
1125 static FILE *findFile(const char *fileName)
1127 if(isAbsolute(fileName))
1128 return tryPath(NULL, fileName);
1129 substEnvVarsInStrList(includePathList);
1130 char *s=includePathList.first();
1131 while (s) // try each of the include paths
1133 FILE *f = tryPath(s,fileName);
1135 s=includePathList.next();
1137 // try cwd if includePathList fails
1138 return tryPath(".",fileName);
1141 static void readIncludeFile(const char *incName)
1143 if (includeDepth==MAX_INCLUDE_DEPTH) {
1144 config_err("error: maximum include depth (%d) reached, %s is not included. Aborting...\n",
1145 MAX_INCLUDE_DEPTH,incName);
1149 QCString inc = incName;
1150 substEnvVarsInString(inc);
1151 inc = inc.stripWhiteSpace();
1152 uint incLen = inc.length();
1153 if (inc.at(0)=='"' && inc.at(incLen-1)=='"') // strip quotes
1155 inc=inc.mid(1,incLen-2);
1160 if ((f=findFile(inc))) // see if the include file can be found
1164 for (i=0;i<includeStack.count();i++) msg(" ");
1165 msg("@INCLUDE = %s: parsing...\n",inc.data());
1168 // store the state of the old file
1169 ConfigFileState *fs=new ConfigFileState;
1170 fs->oldState=YY_CURRENT_BUFFER;
1171 fs->lineNr=yyLineNr;
1172 fs->fileName=yyFileName;
1174 // push the state on the stack
1175 includeStack.push(fs);
1176 // set the scanner to the include file
1177 configYY_switch_to_buffer(configYY_create_buffer(f,YY_BUF_SIZE));
1178 fs->newState=YY_CURRENT_BUFFER;
1184 config_err("error: @INCLUDE = %s: not found!\n",inc.data());
1199 #line 1200 "<stdout>"
1203 #define SkipComment 2
1204 #define SkipInvalid 3
1207 #define GetStrList 6
1208 #define GetQuotedString 7
1212 #ifndef YY_NO_UNISTD_H
1213 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1214 * down here because we want the user's section 1 to have been scanned first.
1215 * The user has a chance to override it with an option.
1220 #ifndef YY_EXTRA_TYPE
1221 #define YY_EXTRA_TYPE void *
1224 static int yy_init_globals (void );
1226 /* Accessor methods to globals.
1227 These are made visible to non-reentrant scanners for convenience. */
1229 int configYYlex_destroy (void );
1231 int configYYget_debug (void );
1233 void configYYset_debug (int debug_flag );
1235 YY_EXTRA_TYPE configYYget_extra (void );
1237 void configYYset_extra (YY_EXTRA_TYPE user_defined );
1239 FILE *configYYget_in (void );
1241 void configYYset_in (FILE * in_str );
1243 FILE *configYYget_out (void );
1245 void configYYset_out (FILE * out_str );
1247 yy_size_t configYYget_leng (void );
1249 char *configYYget_text (void );
1251 int configYYget_lineno (void );
1253 void configYYset_lineno (int line_number );
1255 /* Macros after this point can all be overridden by user definitions in
1259 #ifndef YY_SKIP_YYWRAP
1261 extern "C" int configYYwrap (void );
1263 extern int configYYwrap (void );
1268 static void yy_flex_strncpy (char *,yyconst char *,int );
1271 #ifdef YY_NEED_STRLEN
1272 static int yy_flex_strlen (yyconst char * );
1278 static int yyinput (void );
1280 static int input (void );
1285 /* Amount of stuff to slurp up with each read. */
1286 #ifndef YY_READ_BUF_SIZE
1287 #define YY_READ_BUF_SIZE 8192
1290 /* Copy whatever the last rule matched to the standard output. */
1292 /* This used to be an fputs(), but since the string might contain NUL's,
1293 * we now use fwrite().
1295 #define ECHO fwrite( configYYtext, configYYleng, 1, configYYout )
1298 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1299 * is returned in "result".
1302 #define YY_INPUT(buf,result,max_size) \
1303 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1307 for ( n = 0; n < max_size && \
1308 (c = getc( configYYin )) != EOF && c != '\n'; ++n ) \
1309 buf[n] = (char) c; \
1311 buf[n++] = (char) c; \
1312 if ( c == EOF && ferror( configYYin ) ) \
1313 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1319 while ( (result = fread(buf, 1, max_size, configYYin))==0 && ferror(configYYin)) \
1321 if( errno != EINTR) \
1323 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1327 clearerr(configYYin); \
1334 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1335 * we don't want an extra ';' after the "return" because that will cause
1336 * some compilers to complain about unreachable statements.
1339 #define yyterminate() return YY_NULL
1342 /* Number of entries by which start-condition stack grows. */
1343 #ifndef YY_START_STACK_INCR
1344 #define YY_START_STACK_INCR 25
1347 /* Report a fatal error. */
1348 #ifndef YY_FATAL_ERROR
1349 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1352 /* end tables serialization structures and prototypes */
1354 /* Default declaration of generated scanner - a define so the user can
1355 * easily add parameters.
1358 #define YY_DECL_IS_OURS 1
1360 extern int configYYlex (void);
1362 #define YY_DECL int configYYlex (void)
1363 #endif /* !YY_DECL */
1365 /* Code executed at the beginning of each rule, after configYYtext and configYYleng
1368 #ifndef YY_USER_ACTION
1369 #define YY_USER_ACTION
1372 /* Code executed at the end of each rule. */
1374 #define YY_BREAK break;
1377 #define YY_RULE_SETUP \
1380 /** The main scanner function which does all the work.
1384 register yy_state_type yy_current_state;
1385 register char *yy_cp, *yy_bp;
1386 register int yy_act;
1388 #line 606 "config.l"
1391 #line 1392 "<stdout>"
1402 (yy_start) = 1; /* first start state */
1407 if ( ! configYYout )
1408 configYYout = stdout;
1410 if ( ! YY_CURRENT_BUFFER ) {
1411 configYYensure_buffer_stack ();
1412 YY_CURRENT_BUFFER_LVALUE =
1413 configYY_create_buffer(configYYin,YY_BUF_SIZE );
1416 configYY_load_buffer_state( );
1419 while ( 1 ) /* loops until end-of-file is reached */
1421 yy_cp = (yy_c_buf_p);
1423 /* Support of configYYtext. */
1424 *yy_cp = (yy_hold_char);
1426 /* yy_bp points to the position in yy_ch_buf of the start of
1431 yy_current_state = (yy_start);
1435 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1436 if ( yy_accept[yy_current_state] )
1438 (yy_last_accepting_state) = yy_current_state;
1439 (yy_last_accepting_cpos) = yy_cp;
1441 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1443 yy_current_state = (int) yy_def[yy_current_state];
1444 if ( yy_current_state >= 100 )
1445 yy_c = yy_meta[(unsigned int) yy_c];
1447 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1450 while ( yy_base[yy_current_state] != 408 );
1453 yy_act = yy_accept[yy_current_state];
1455 { /* have to back up */
1456 yy_cp = (yy_last_accepting_cpos);
1457 yy_current_state = (yy_last_accepting_state);
1458 yy_act = yy_accept[yy_current_state];
1461 YY_DO_BEFORE_ACTION;
1463 do_action: /* This label is used only to access EOF actions. */
1466 { /* beginning of action switch */
1467 case 0: /* must back up */
1468 /* undo the effects of YY_DO_BEFORE_ACTION */
1469 *yy_cp = (yy_hold_char);
1470 yy_cp = (yy_last_accepting_cpos);
1471 yy_current_state = (yy_last_accepting_state);
1472 goto yy_find_action;
1476 #line 608 "config.l"
1481 #line 609 "config.l"
1482 { BEGIN(SkipComment); }
1486 #line 610 "config.l"
1487 { QCString cmd=configYYtext;
1488 cmd=cmd.left(cmd.length()-1).stripWhiteSpace();
1489 ConfigOption *option = config->get(cmd);
1490 if (option==0) // oops not known
1492 config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1493 configYYtext,yyLineNr,yyFileName.data());
1498 option->setEncoding(encoding);
1499 switch(option->kind())
1501 case ConfigOption::O_Info:
1502 // shouldn't get here!
1505 case ConfigOption::O_List:
1506 l = ((ConfigList *)option)->valueRef();
1511 case ConfigOption::O_Enum:
1512 s = ((ConfigEnum *)option)->valueRef();
1516 case ConfigOption::O_String:
1517 s = ((ConfigString *)option)->valueRef();
1521 case ConfigOption::O_Int:
1522 s = ((ConfigInt *)option)->valueStringRef();
1526 case ConfigOption::O_Bool:
1527 s = ((ConfigBool *)option)->valueStringRef();
1531 case ConfigOption::O_Obsolete:
1532 config_err("warning: Tag `%s' at line %d of file %s has become obsolete.\n"
1533 "To avoid this warning please remove this line from your configuration "
1534 "file or upgrade it using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
1543 #line 663 "config.l"
1544 { QCString cmd=configYYtext;
1545 cmd=cmd.left(cmd.length()-2).stripWhiteSpace();
1546 ConfigOption *option = config->get(cmd);
1547 if (option==0) // oops not known
1549 config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1550 configYYtext,yyLineNr,yyFileName.data());
1555 switch(option->kind())
1557 case ConfigOption::O_Info:
1558 // shouldn't get here!
1561 case ConfigOption::O_List:
1562 l = ((ConfigList *)option)->valueRef();
1566 case ConfigOption::O_Enum:
1567 case ConfigOption::O_String:
1568 case ConfigOption::O_Int:
1569 case ConfigOption::O_Bool:
1570 config_err("warning: operator += not supported for `%s'. Ignoring line at line %d, file %s\n",
1571 configYYtext,yyLineNr,yyFileName.data());
1574 case ConfigOption::O_Obsolete:
1575 config_err("warning: Tag `%s' at line %d of file %s has become obsolete.\n"
1576 "To avoid this warning please update your configuration "
1577 "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
1586 #line 702 "config.l"
1587 { BEGIN(GetStrList); l=&includePathList; l->clear(); elemStr=""; }
1589 /* include a config file */
1592 #line 704 "config.l"
1597 #line 705 "config.l"
1599 readIncludeFile(configStringRecode(configYYtext,encoding,"UTF-8"));
1603 case YY_STATE_EOF(INITIAL):
1604 case YY_STATE_EOF(Start):
1605 case YY_STATE_EOF(SkipComment):
1606 case YY_STATE_EOF(SkipInvalid):
1607 case YY_STATE_EOF(GetString):
1608 case YY_STATE_EOF(GetBool):
1609 case YY_STATE_EOF(GetStrList):
1610 case YY_STATE_EOF(GetQuotedString):
1611 case YY_STATE_EOF(GetEnvVar):
1612 case YY_STATE_EOF(Include):
1613 #line 709 "config.l"
1615 //printf("End of include file\n");
1616 //printf("Include stack depth=%d\n",g_includeStack.count());
1617 if (includeStack.isEmpty())
1619 //printf("Terminating scanner!\n");
1624 ConfigFileState *fs=includeStack.pop();
1625 fclose(fs->filePtr);
1626 YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
1627 configYY_switch_to_buffer(fs->oldState );
1628 configYY_delete_buffer(oldBuf );
1629 yyLineNr=fs->lineNr;
1630 yyFileName=fs->fileName;
1638 #line 731 "config.l"
1639 { config_err("warning: ignoring unknown tag `%s' at line %d, file %s\n",configYYtext,yyLineNr,yyFileName.data()); }
1642 /* rule 9 can match eol */
1644 #line 732 "config.l"
1645 { yyLineNr++; BEGIN(Start); }
1648 /* rule 10 can match eol */
1650 #line 733 "config.l"
1653 if (!elemStr.isEmpty())
1655 //printf("elemStr1=`%s'\n",elemStr.data());
1663 #line 742 "config.l"
1665 if (!elemStr.isEmpty())
1667 //printf("elemStr2=`%s'\n",elemStr.data());
1675 #line 750 "config.l"
1676 { (*s)+=configStringRecode(configYYtext,encoding,"UTF-8");
1682 #line 753 "config.l"
1683 { lastState=YY_START;
1684 BEGIN(GetQuotedString);
1685 tmpString.resize(0);
1689 /* rule 14 can match eol */
1691 #line 757 "config.l"
1693 // we add a bogus space to signal that the string was quoted. This space will be stripped later on.
1695 //printf("Quoted String = `%s'\n",tmpString.data());
1696 if (lastState==GetString)
1698 (*s)+=configStringRecode(tmpString,encoding,"UTF-8");
1703 elemStr+=configStringRecode(tmpString,encoding,"UTF-8");
1705 if (*configYYtext=='\n')
1707 config_err("warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data());
1715 #line 777 "config.l"
1722 #line 780 "config.l"
1723 { tmpString+=*configYYtext; }
1727 #line 781 "config.l"
1729 QCString bs=configYYtext;
1731 if (bs=="YES" || bs=="1")
1733 else if (bs=="NO" || bs=="0")
1738 config_warn("warning: Invalid value `%s' for "
1739 "boolean tag in line %d, file %s; use YES or NO\n",
1740 bs.data(),yyLineNr,yyFileName.data());
1746 #line 796 "config.l"
1748 elemStr+=configStringRecode(configYYtext,encoding,"UTF-8");
1752 /* rule 19 can match eol */
1754 #line 799 "config.l"
1755 { yyLineNr++; BEGIN(Start); }
1758 /* rule 20 can match eol */
1760 #line 800 "config.l"
1761 { yyLineNr++; BEGIN(Start); }
1764 /* rule 21 can match eol */
1766 #line 801 "config.l"
1771 #line 802 "config.l"
1775 /* rule 23 can match eol */
1777 #line 803 "config.l"
1782 #line 805 "config.l"
1785 #line 1786 "<stdout>"
1787 case YY_END_OF_BUFFER:
1789 /* Amount of text matched not including the EOB char. */
1790 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1792 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1793 *yy_cp = (yy_hold_char);
1794 YY_RESTORE_YY_MORE_OFFSET
1796 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1798 /* We're scanning a new file or input source. It's
1799 * possible that this happened because the user
1800 * just pointed configYYin at a new source and called
1801 * configYYlex(). If so, then we have to assure
1802 * consistency between YY_CURRENT_BUFFER and our
1803 * globals. Here is the right place to do so, because
1804 * this is the first action (other than possibly a
1805 * back-up) that will match for the new input source.
1807 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1808 YY_CURRENT_BUFFER_LVALUE->yy_input_file = configYYin;
1809 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1812 /* Note that here we test for yy_c_buf_p "<=" to the position
1813 * of the first EOB in the buffer, since yy_c_buf_p will
1814 * already have been incremented past the NUL character
1815 * (since all states make transitions on EOB to the
1816 * end-of-buffer state). Contrast this with the test
1819 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1820 { /* This was really a NUL. */
1821 yy_state_type yy_next_state;
1823 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1825 yy_current_state = yy_get_previous_state( );
1827 /* Okay, we're now positioned to make the NUL
1828 * transition. We couldn't have
1829 * yy_get_previous_state() go ahead and do it
1830 * for us because it doesn't know how to deal
1831 * with the possibility of jamming (and we don't
1832 * want to build jamming into it because then it
1833 * will run more slowly).
1836 yy_next_state = yy_try_NUL_trans( yy_current_state );
1838 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1840 if ( yy_next_state )
1842 /* Consume the NUL. */
1843 yy_cp = ++(yy_c_buf_p);
1844 yy_current_state = yy_next_state;
1850 yy_cp = (yy_c_buf_p);
1851 goto yy_find_action;
1855 else switch ( yy_get_next_buffer( ) )
1857 case EOB_ACT_END_OF_FILE:
1859 (yy_did_buffer_switch_on_eof) = 0;
1861 if ( configYYwrap( ) )
1863 /* Note: because we've taken care in
1864 * yy_get_next_buffer() to have set up
1865 * configYYtext, we can now set up
1866 * yy_c_buf_p so that if some total
1867 * hoser (like flex itself) wants to
1868 * call the scanner after we return the
1869 * YY_NULL, it'll still work - another
1870 * YY_NULL will get returned.
1872 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1874 yy_act = YY_STATE_EOF(YY_START);
1880 if ( ! (yy_did_buffer_switch_on_eof) )
1886 case EOB_ACT_CONTINUE_SCAN:
1888 (yytext_ptr) + yy_amount_of_matched_text;
1890 yy_current_state = yy_get_previous_state( );
1892 yy_cp = (yy_c_buf_p);
1893 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1896 case EOB_ACT_LAST_MATCH:
1898 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1900 yy_current_state = yy_get_previous_state( );
1902 yy_cp = (yy_c_buf_p);
1903 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1904 goto yy_find_action;
1911 "fatal flex scanner internal error--no action found" );
1912 } /* end of action switch */
1913 } /* end of scanning one token */
1914 } /* end of configYYlex */
1916 /* yy_get_next_buffer - try to read in a new buffer
1918 * Returns a code representing an action:
1919 * EOB_ACT_LAST_MATCH -
1920 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1921 * EOB_ACT_END_OF_FILE - end of file
1923 static int yy_get_next_buffer (void)
1925 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1926 register char *source = (yytext_ptr);
1927 register int number_to_move, i;
1930 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1932 "fatal flex scanner internal error--end of buffer missed" );
1934 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1935 { /* Don't try to fill the buffer, so this is an EOF. */
1936 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1938 /* We matched a single character, the EOB, so
1939 * treat this as a final EOF.
1941 return EOB_ACT_END_OF_FILE;
1946 /* We matched some text prior to the EOB, first
1949 return EOB_ACT_LAST_MATCH;
1953 /* Try to read more data. */
1955 /* First move last chars to start of buffer. */
1956 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1958 for ( i = 0; i < number_to_move; ++i )
1959 *(dest++) = *(source++);
1961 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1962 /* don't do the read, it's not guaranteed to return an EOF,
1965 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1969 yy_size_t num_to_read =
1970 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1972 while ( num_to_read <= 0 )
1973 { /* Not enough room in the buffer - grow it. */
1975 /* just a shorter name for the current buffer */
1976 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1978 int yy_c_buf_p_offset =
1979 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1981 if ( b->yy_is_our_buffer )
1983 yy_size_t new_size = b->yy_buf_size * 2;
1985 if ( new_size <= 0 )
1986 b->yy_buf_size += b->yy_buf_size / 8;
1988 b->yy_buf_size *= 2;
1990 b->yy_ch_buf = (char *)
1991 /* Include room in for 2 EOB chars. */
1992 configYYrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1995 /* Can't grow it, we don't own it. */
1998 if ( ! b->yy_ch_buf )
2000 "fatal error - scanner input buffer overflow" );
2002 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2004 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2009 if ( num_to_read > YY_READ_BUF_SIZE )
2010 num_to_read = YY_READ_BUF_SIZE;
2012 /* Read in more data. */
2013 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2014 (yy_n_chars), num_to_read );
2016 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2019 if ( (yy_n_chars) == 0 )
2021 if ( number_to_move == YY_MORE_ADJ )
2023 ret_val = EOB_ACT_END_OF_FILE;
2024 configYYrestart(configYYin );
2029 ret_val = EOB_ACT_LAST_MATCH;
2030 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2031 YY_BUFFER_EOF_PENDING;
2036 ret_val = EOB_ACT_CONTINUE_SCAN;
2038 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2039 /* Extend the array by 50%, plus the number we really need. */
2040 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2041 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) configYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
2042 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2043 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2046 (yy_n_chars) += number_to_move;
2047 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2048 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2050 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2055 /* yy_get_previous_state - get the state just before the EOB char was reached */
2057 static yy_state_type yy_get_previous_state (void)
2059 register yy_state_type yy_current_state;
2060 register char *yy_cp;
2062 yy_current_state = (yy_start);
2064 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2066 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 28);
2067 if ( yy_accept[yy_current_state] )
2069 (yy_last_accepting_state) = yy_current_state;
2070 (yy_last_accepting_cpos) = yy_cp;
2072 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2074 yy_current_state = (int) yy_def[yy_current_state];
2075 if ( yy_current_state >= 100 )
2076 yy_c = yy_meta[(unsigned int) yy_c];
2078 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2081 return yy_current_state;
2084 /* yy_try_NUL_trans - try to make a transition on the NUL character
2087 * next_state = yy_try_NUL_trans( current_state );
2089 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2091 register int yy_is_jam;
2092 register char *yy_cp = (yy_c_buf_p);
2094 register YY_CHAR yy_c = 28;
2095 if ( yy_accept[yy_current_state] )
2097 (yy_last_accepting_state) = yy_current_state;
2098 (yy_last_accepting_cpos) = yy_cp;
2100 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2102 yy_current_state = (int) yy_def[yy_current_state];
2103 if ( yy_current_state >= 100 )
2104 yy_c = yy_meta[(unsigned int) yy_c];
2106 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2107 yy_is_jam = (yy_current_state == 99);
2109 return yy_is_jam ? 0 : yy_current_state;
2114 static int yyinput (void)
2116 static int input (void)
2122 *(yy_c_buf_p) = (yy_hold_char);
2124 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2126 /* yy_c_buf_p now points to the character we want to return.
2127 * If this occurs *before* the EOB characters, then it's a
2128 * valid NUL; if not, then we've hit the end of the buffer.
2130 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2131 /* This was really a NUL. */
2132 *(yy_c_buf_p) = '\0';
2135 { /* need more input */
2136 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
2139 switch ( yy_get_next_buffer( ) )
2141 case EOB_ACT_LAST_MATCH:
2142 /* This happens because yy_g_n_b()
2143 * sees that we've accumulated a
2144 * token and flags that we need to
2145 * try matching the token before
2146 * proceeding. But for input(),
2147 * there's no matching to consider.
2148 * So convert the EOB_ACT_LAST_MATCH
2149 * to EOB_ACT_END_OF_FILE.
2152 /* Reset buffer status. */
2153 configYYrestart(configYYin );
2157 case EOB_ACT_END_OF_FILE:
2159 if ( configYYwrap( ) )
2162 if ( ! (yy_did_buffer_switch_on_eof) )
2171 case EOB_ACT_CONTINUE_SCAN:
2172 (yy_c_buf_p) = (yytext_ptr) + offset;
2178 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
2179 *(yy_c_buf_p) = '\0'; /* preserve configYYtext */
2180 (yy_hold_char) = *++(yy_c_buf_p);
2184 #endif /* ifndef YY_NO_INPUT */
2186 /** Immediately switch to a different input stream.
2187 * @param input_file A readable stream.
2189 * @note This function does not reset the start condition to @c INITIAL .
2191 void configYYrestart (FILE * input_file )
2194 if ( ! YY_CURRENT_BUFFER ){
2195 configYYensure_buffer_stack ();
2196 YY_CURRENT_BUFFER_LVALUE =
2197 configYY_create_buffer(configYYin,YY_BUF_SIZE );
2200 configYY_init_buffer(YY_CURRENT_BUFFER,input_file );
2201 configYY_load_buffer_state( );
2204 /** Switch to a different input buffer.
2205 * @param new_buffer The new input buffer.
2208 void configYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
2211 /* TODO. We should be able to replace this entire function body
2213 * configYYpop_buffer_state();
2214 * configYYpush_buffer_state(new_buffer);
2216 configYYensure_buffer_stack ();
2217 if ( YY_CURRENT_BUFFER == new_buffer )
2220 if ( YY_CURRENT_BUFFER )
2222 /* Flush out information for old buffer. */
2223 *(yy_c_buf_p) = (yy_hold_char);
2224 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2225 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2228 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2229 configYY_load_buffer_state( );
2231 /* We don't actually know whether we did this switch during
2232 * EOF (configYYwrap()) processing, but the only time this flag
2233 * is looked at is after configYYwrap() is called, so it's safe
2234 * to go ahead and always set it.
2236 (yy_did_buffer_switch_on_eof) = 1;
2239 static void configYY_load_buffer_state (void)
2241 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2242 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2243 configYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2244 (yy_hold_char) = *(yy_c_buf_p);
2247 /** Allocate and initialize an input buffer state.
2248 * @param file A readable stream.
2249 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2251 * @return the allocated buffer state.
2253 YY_BUFFER_STATE configYY_create_buffer (FILE * file, int size )
2257 b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state ) );
2259 YY_FATAL_ERROR( "out of dynamic memory in configYY_create_buffer()" );
2261 b->yy_buf_size = size;
2263 /* yy_ch_buf has to be 2 characters longer than the size given because
2264 * we need to put in 2 end-of-buffer characters.
2266 b->yy_ch_buf = (char *) configYYalloc(b->yy_buf_size + 2 );
2267 if ( ! b->yy_ch_buf )
2268 YY_FATAL_ERROR( "out of dynamic memory in configYY_create_buffer()" );
2270 b->yy_is_our_buffer = 1;
2272 configYY_init_buffer(b,file );
2277 /** Destroy the buffer.
2278 * @param b a buffer created with configYY_create_buffer()
2281 void configYY_delete_buffer (YY_BUFFER_STATE b )
2287 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2288 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2290 if ( b->yy_is_our_buffer )
2291 configYYfree((void *) b->yy_ch_buf );
2293 configYYfree((void *) b );
2297 extern int isatty (int );
2298 #endif /* __cplusplus */
2300 /* Initializes or reinitializes a buffer.
2301 * This function is sometimes called more than once on the same buffer,
2302 * such as during a configYYrestart() or at EOF.
2304 static void configYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
2309 configYY_flush_buffer(b );
2311 b->yy_input_file = file;
2312 b->yy_fill_buffer = 1;
2314 /* If b is the current buffer, then configYY_init_buffer was _probably_
2315 * called from configYYrestart() or through yy_get_next_buffer.
2316 * In that case, we don't want to reset the lineno or column.
2318 if (b != YY_CURRENT_BUFFER){
2319 b->yy_bs_lineno = 1;
2320 b->yy_bs_column = 0;
2323 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2328 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2329 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2332 void configYY_flush_buffer (YY_BUFFER_STATE b )
2339 /* We always need two end-of-buffer characters. The first causes
2340 * a transition to the end-of-buffer state. The second causes
2341 * a jam in that state.
2343 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2344 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2346 b->yy_buf_pos = &b->yy_ch_buf[0];
2349 b->yy_buffer_status = YY_BUFFER_NEW;
2351 if ( b == YY_CURRENT_BUFFER )
2352 configYY_load_buffer_state( );
2355 /** Pushes the new state onto the stack. The new state becomes
2356 * the current state. This function will allocate the stack
2358 * @param new_buffer The new state.
2361 void configYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2363 if (new_buffer == NULL)
2366 configYYensure_buffer_stack();
2368 /* This block is copied from configYY_switch_to_buffer. */
2369 if ( YY_CURRENT_BUFFER )
2371 /* Flush out information for old buffer. */
2372 *(yy_c_buf_p) = (yy_hold_char);
2373 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2374 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2377 /* Only push if top exists. Otherwise, replace top. */
2378 if (YY_CURRENT_BUFFER)
2379 (yy_buffer_stack_top)++;
2380 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2382 /* copied from configYY_switch_to_buffer. */
2383 configYY_load_buffer_state( );
2384 (yy_did_buffer_switch_on_eof) = 1;
2387 /** Removes and deletes the top of the stack, if present.
2388 * The next element becomes the new top.
2391 void configYYpop_buffer_state (void)
2393 if (!YY_CURRENT_BUFFER)
2396 configYY_delete_buffer(YY_CURRENT_BUFFER );
2397 YY_CURRENT_BUFFER_LVALUE = NULL;
2398 if ((yy_buffer_stack_top) > 0)
2399 --(yy_buffer_stack_top);
2401 if (YY_CURRENT_BUFFER) {
2402 configYY_load_buffer_state( );
2403 (yy_did_buffer_switch_on_eof) = 1;
2407 /* Allocates the stack if it does not exist.
2408 * Guarantees space for at least one push.
2410 static void configYYensure_buffer_stack (void)
2412 yy_size_t num_to_alloc;
2414 if (!(yy_buffer_stack)) {
2416 /* First allocation is just for 2 elements, since we don't know if this
2417 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2418 * immediate realloc on the next call.
2421 (yy_buffer_stack) = (struct yy_buffer_state**)configYYalloc
2422 (num_to_alloc * sizeof(struct yy_buffer_state*)
2424 if ( ! (yy_buffer_stack) )
2425 YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2427 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2429 (yy_buffer_stack_max) = num_to_alloc;
2430 (yy_buffer_stack_top) = 0;
2434 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2436 /* Increase the buffer to prepare for a possible push. */
2437 int grow_size = 8 /* arbitrary grow size */;
2439 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2440 (yy_buffer_stack) = (struct yy_buffer_state**)configYYrealloc
2442 num_to_alloc * sizeof(struct yy_buffer_state*)
2444 if ( ! (yy_buffer_stack) )
2445 YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2447 /* zero only the new slots.*/
2448 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2449 (yy_buffer_stack_max) = num_to_alloc;
2453 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2454 * @param base the character buffer
2455 * @param size the size in bytes of the character buffer
2457 * @return the newly allocated buffer state object.
2459 YY_BUFFER_STATE configYY_scan_buffer (char * base, yy_size_t size )
2464 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2465 base[size-1] != YY_END_OF_BUFFER_CHAR )
2466 /* They forgot to leave room for the EOB's. */
2469 b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state ) );
2471 YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_buffer()" );
2473 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2474 b->yy_buf_pos = b->yy_ch_buf = base;
2475 b->yy_is_our_buffer = 0;
2476 b->yy_input_file = 0;
2477 b->yy_n_chars = b->yy_buf_size;
2478 b->yy_is_interactive = 0;
2480 b->yy_fill_buffer = 0;
2481 b->yy_buffer_status = YY_BUFFER_NEW;
2483 configYY_switch_to_buffer(b );
2488 /** Setup the input buffer state to scan a string. The next call to configYYlex() will
2489 * scan from a @e copy of @a str.
2490 * @param yystr a NUL-terminated string to scan
2492 * @return the newly allocated buffer state object.
2493 * @note If you want to scan bytes that may contain NUL values, then use
2494 * configYY_scan_bytes() instead.
2496 YY_BUFFER_STATE configYY_scan_string (yyconst char * yystr )
2499 return configYY_scan_bytes(yystr,strlen(yystr) );
2502 /** Setup the input buffer state to scan the given bytes. The next call to configYYlex() will
2503 * scan from a @e copy of @a bytes.
2504 * @param bytes the byte buffer to scan
2505 * @param len the number of bytes in the buffer pointed to by @a bytes.
2507 * @return the newly allocated buffer state object.
2509 YY_BUFFER_STATE configYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2515 /* Get memory for full buffer, including space for trailing EOB's. */
2516 n = _yybytes_len + 2;
2517 buf = (char *) configYYalloc(n );
2519 YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_bytes()" );
2521 for ( i = 0; i < _yybytes_len; ++i )
2522 buf[i] = yybytes[i];
2524 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2526 b = configYY_scan_buffer(buf,n );
2528 YY_FATAL_ERROR( "bad buffer in configYY_scan_bytes()" );
2530 /* It's okay to grow etc. this buffer, and we should throw it
2531 * away when we're done.
2533 b->yy_is_our_buffer = 1;
2538 #ifndef YY_EXIT_FAILURE
2539 #define YY_EXIT_FAILURE 2
2542 static void yy_fatal_error (yyconst char* msg )
2544 (void) fprintf( stderr, "%s\n", msg );
2545 exit( YY_EXIT_FAILURE );
2548 /* Redefine yyless() so it works in section 3 code. */
2554 /* Undo effects of setting up configYYtext. */ \
2555 int yyless_macro_arg = (n); \
2556 YY_LESS_LINENO(yyless_macro_arg);\
2557 configYYtext[configYYleng] = (yy_hold_char); \
2558 (yy_c_buf_p) = configYYtext + yyless_macro_arg; \
2559 (yy_hold_char) = *(yy_c_buf_p); \
2560 *(yy_c_buf_p) = '\0'; \
2561 configYYleng = yyless_macro_arg; \
2565 /* Accessor methods (get/set functions) to struct members. */
2567 /** Get the current line number.
2570 int configYYget_lineno (void)
2573 return configYYlineno;
2576 /** Get the input stream.
2579 FILE *configYYget_in (void)
2584 /** Get the output stream.
2587 FILE *configYYget_out (void)
2592 /** Get the length of the current token.
2595 yy_size_t configYYget_leng (void)
2597 return configYYleng;
2600 /** Get the current token.
2604 char *configYYget_text (void)
2606 return configYYtext;
2609 /** Set the current line number.
2610 * @param line_number
2613 void configYYset_lineno (int line_number )
2616 configYYlineno = line_number;
2619 /** Set the input stream. This does not discard the current
2621 * @param in_str A readable stream.
2623 * @see configYY_switch_to_buffer
2625 void configYYset_in (FILE * in_str )
2627 configYYin = in_str ;
2630 void configYYset_out (FILE * out_str )
2632 configYYout = out_str ;
2635 int configYYget_debug (void)
2637 return configYY_flex_debug;
2640 void configYYset_debug (int bdebug )
2642 configYY_flex_debug = bdebug ;
2645 static int yy_init_globals (void)
2647 /* Initialization is the same as for the non-reentrant scanner.
2648 * This function is called from configYYlex_destroy(), so don't allocate here.
2651 (yy_buffer_stack) = 0;
2652 (yy_buffer_stack_top) = 0;
2653 (yy_buffer_stack_max) = 0;
2654 (yy_c_buf_p) = (char *) 0;
2658 /* Defined in main.c */
2661 configYYout = stdout;
2663 configYYin = (FILE *) 0;
2664 configYYout = (FILE *) 0;
2667 /* For future reference: Set errno on error, since we are called by
2668 * configYYlex_init()
2673 /* configYYlex_destroy is for both reentrant and non-reentrant scanners. */
2674 int configYYlex_destroy (void)
2677 /* Pop the buffer stack, destroying each element. */
2678 while(YY_CURRENT_BUFFER){
2679 configYY_delete_buffer(YY_CURRENT_BUFFER );
2680 YY_CURRENT_BUFFER_LVALUE = NULL;
2681 configYYpop_buffer_state();
2684 /* Destroy the stack itself. */
2685 configYYfree((yy_buffer_stack) );
2686 (yy_buffer_stack) = NULL;
2688 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2689 * configYYlex() is called, initialization will occur. */
2696 * Internal utility routines.
2700 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2703 for ( i = 0; i < n; ++i )
2708 #ifdef YY_NEED_STRLEN
2709 static int yy_flex_strlen (yyconst char * s )
2712 for ( n = 0; s[n]; ++n )
2719 void *configYYalloc (yy_size_t size )
2721 return (void *) malloc( size );
2724 void *configYYrealloc (void * ptr, yy_size_t size )
2726 /* The cast to (char *) in the following accommodates both
2727 * implementations that use char* generic pointers, and those
2728 * that use void* generic pointers. It works with the latter
2729 * because both ANSI C and C++ allow castless assignment from
2730 * any pointer type to void*, and deal with argument conversions
2731 * as though doing an assignment.
2733 return (void *) realloc( (char *) ptr, size );
2736 void configYYfree (void * ptr )
2738 free( (char *) ptr ); /* see configYYrealloc() for (char *) cast */
2741 #define YYTABLES_NAME "yytables"
2743 #line 805 "config.l"
2747 /*@ ----------------------------------------------------------------------------
2750 void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
2752 t << "# Doxyfile " << versionString << endl << endl;
2755 t << "# This file describes the settings to be used by the documentation system\n";
2756 t << "# doxygen (www.doxygen.org) for a project.\n";
2758 t << "# All text after a hash (#) is considered a comment and will be ignored.\n";
2759 t << "# The format is:\n";
2760 t << "# TAG = value [value, ...]\n";
2761 t << "# For lists items can also be appended using:\n";
2762 t << "# TAG += value [value, ...]\n";
2763 t << "# Values that contain spaces should be placed between quotes (\" \").\n";
2765 ConfigOption *option = m_options->first();
2768 option->writeTemplate(t,sl,upd);
2769 option = m_options->next();
2773 void Config::writeXML(FTextStream &t)
2775 t << "<doxygenconfig>" << endl;
2777 ConfigOption *option = m_options->first();
2780 if (option->kind()==ConfigOption::O_Info)
2782 if (!first) t << " </group>" << endl;
2783 t << " <group name='" << option->name() << "' "
2784 "docs='" << option->docs() << "'>" << endl;
2789 option->writeXML(t);
2791 option = m_options->next();
2793 option = m_obsolete->first();
2796 option->writeXML(t);
2797 option = m_obsolete->next();
2799 if (!first) t << " </group>" << endl;
2800 t << "</doxygenconfig>" << endl;
2803 void Config::convertStrToVal()
2805 ConfigOption *option = m_options->first();
2808 option->convertStrToVal();
2809 option = m_options->next();
2813 static void substEnvVarsInString(QCString &s)
2815 static QRegExp re("\\$\\([a-z_A-Z0-9.-]+\\)");
2816 static QRegExp re2("\\$\\([a-z_A-Z0-9.-]+\\([a-z_A-Z0-9.-]+\\)\\)"); // For e.g. PROGRAMFILES(X86)
2817 if (s.isEmpty()) return;
2820 //printf("substEnvVarInString(%s) start\n",s.data());
2821 while ((i=re.match(s,p,&l))!=-1 || (i=re2.match(s,p,&l))!=-1)
2823 //printf("Found environment var s.mid(%d,%d)=`%s'\n",i+2,l-3,s.mid(i+2,l-3).data());
2824 QCString env=portable_getenv(s.mid(i+2,l-3));
2825 substEnvVarsInString(env); // recursively expand variables if needed.
2826 s = s.left(i)+env+s.right(s.length()-i-l);
2827 p=i+env.length(); // next time start at the end of the expanded string
2829 s=s.stripWhiteSpace(); // to strip the bogus space that was added when an argument
2831 //printf("substEnvVarInString(%s) end\n",s.data());
2834 static void substEnvVarsInStrList(QStrList &sl)
2836 char *s = sl.first();
2840 // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE.
2841 bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1);
2842 // here we strip the quote again
2843 substEnvVarsInString(result);
2845 //printf("Result %s was quoted=%d\n",result.data(),wasQuoted);
2847 if (!wasQuoted) /* as a result of the expansion, a single string
2848 may have expanded into a list, which we'll
2849 add to sl. If the original string already
2850 contained multiple elements no further
2851 splitting is done to allow quoted items with spaces! */
2853 int l=result.length();
2856 // search for a "word"
2860 // skip until start of new word
2861 while (i<l && ((c=result.at(i))==' ' || c=='\t')) i++;
2862 p=i; // p marks the start index of the word
2863 // skip until end of a word
2864 while (i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"')) i++;
2865 if (i<l) // not at the end of the string
2867 if (c=='"') // word within quotes
2873 if (c=='"') // end quote
2875 // replace the string in the list and go to the next item.
2876 sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
2877 sl.next(); // current item is now the old item
2881 else if (c=='\\') // skip escaped stuff
2887 else if (c==' ' || c=='\t') // separator
2889 // replace the string in the list and go to the next item.
2890 sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item.
2891 sl.next(); // current item is now the old item
2896 if (p!=l) // add the leftover as a string
2898 // replace the string in the list and go to the next item.
2899 sl.insert(sl.at(),result.right(l-p)); // insert new item before current item.
2900 sl.next(); // current item is now the old item
2903 else // just goto the next element in the list
2905 sl.insert(sl.at(),result);
2908 // remove the old unexpanded string from the list
2910 sl.remove(); // current item index changes if the last element is removed.
2911 if (sl.at()==i) // not last item
2913 else // just removed last item
2918 void ConfigString::substEnvVars()
2920 substEnvVarsInString(m_value);
2923 void ConfigList::substEnvVars()
2925 substEnvVarsInStrList(m_value);
2928 void ConfigBool::substEnvVars()
2930 substEnvVarsInString(m_valueString);
2933 void ConfigInt::substEnvVars()
2935 substEnvVarsInString(m_valueString);
2938 void ConfigEnum::substEnvVars()
2940 substEnvVarsInString(m_value);
2943 void Config::substituteEnvironmentVars()
2945 ConfigOption *option = m_options->first();
2948 option->substEnvVars();
2949 option = m_options->next();
2953 static void cleanUpPaths(QStrList &str)
2955 char *sfp = str.first();
2958 register char *p = sfp;
2964 if (c=='\\') *p='/';
2968 QCString path = sfp;
2969 if ((path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) ||
2970 path.at(path.length()-1)!='/'
2974 if (fi.exists() && fi.isDir())
2978 if (str.at()==i) // did not remove last item
2979 str.insert(i,fi.absFilePath().utf8()+"/");
2981 str.append(fi.absFilePath().utf8()+"/");
2988 void Config::check()
2990 //if (!projectName.isEmpty())
2992 // projectName[0]=toupper(projectName[0]);
2995 QCString &warnFormat = Config_getString("WARN_FORMAT");
2996 if (warnFormat.stripWhiteSpace().isEmpty())
2998 warnFormat="$file:$line $text";
3002 if (warnFormat.find("$file")==-1)
3004 config_err("warning: warning format does not contain a $file tag!\n");
3006 if (warnFormat.find("$line")==-1)
3008 config_err("warning: warning format does not contain a $line tag!\n");
3010 if (warnFormat.find("$text")==-1)
3012 config_err("warning: warning format foes not contain a $text tag!\n");
3016 QCString &manExtension = Config_getString("MAN_EXTENSION");
3018 // set default man page extension if non is given by the user
3019 if (manExtension.isEmpty())
3024 QCString &paperType = Config_getEnum("PAPER_TYPE");
3025 paperType=paperType.lower().stripWhiteSpace();
3026 if (paperType.isEmpty())
3030 if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" &&
3031 paperType!="legal" && paperType!="executive")
3033 config_err("error: Unknown page type specified");
3036 QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE");
3037 outputLanguage=outputLanguage.stripWhiteSpace();
3038 if (outputLanguage.isEmpty())
3040 outputLanguage = "English";
3043 QCString &htmlFileExtension=Config_getString("HTML_FILE_EXTENSION");
3044 htmlFileExtension=htmlFileExtension.stripWhiteSpace();
3045 if (htmlFileExtension.isEmpty())
3047 htmlFileExtension = ".html";
3050 // expand the relative stripFromPath values
3051 QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH");
3052 char *sfp = stripFromPath.first();
3053 if (sfp==0) // by default use the current path
3055 stripFromPath.append(QDir::currentDirPath().utf8()+"/");
3059 cleanUpPaths(stripFromPath);
3062 // expand the relative stripFromPath values
3063 QStrList &stripFromIncPath = Config_getList("STRIP_FROM_INC_PATH");
3064 cleanUpPaths(stripFromIncPath);
3066 // Test to see if HTML header is valid
3067 QCString &headerFile = Config_getString("HTML_HEADER");
3068 if (!headerFile.isEmpty())
3070 QFileInfo fi(headerFile);
3073 config_err("error: tag HTML_HEADER: header file `%s' "
3074 "does not exist\n",headerFile.data());
3078 // Test to see if HTML footer is valid
3079 QCString &footerFile = Config_getString("HTML_FOOTER");
3080 if (!footerFile.isEmpty())
3082 QFileInfo fi(footerFile);
3085 config_err("error: tag HTML_FOOTER: footer file `%s' "
3086 "does not exist\n",footerFile.data());
3090 // Test to see if LaTeX header is valid
3091 QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
3092 if (!latexHeaderFile.isEmpty())
3094 QFileInfo fi(latexHeaderFile);
3097 config_err("error: tag LATEX_HEADER: header file `%s' "
3098 "does not exist\n",latexHeaderFile.data());
3102 // check include path
3103 QStrList &includePath = Config_getList("INCLUDE_PATH");
3104 char *s=includePath.first();
3108 if (!fi.exists()) config_err("warning: tag INCLUDE_PATH: include path `%s' "
3109 "does not exist\n",s);
3110 s=includePath.next();
3114 QStrList &aliasList = Config_getList("ALIASES");
3115 s=aliasList.first();
3118 QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument
3119 QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]*}[ \t]*="); // alias with argument
3121 alias=alias.stripWhiteSpace();
3122 if (alias.find(re1)!=0 && alias.find(re2)!=0)
3124 config_err("Illegal alias format `%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
3130 // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled
3131 if (Config_getBool("GENERATE_TREEVIEW") && Config_getBool("GENERATE_HTMLHELP"))
3133 config_err("When enabling GENERATE_HTMLHELP the tree view (GENERATE_TREEVIEW) should be disabled. I'll do it for you.\n");
3134 Config_getBool("GENERATE_TREEVIEW")=FALSE;
3136 if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTMLHELP"))
3138 config_err("When enabling GENERATE_HTMLHELP the search engine (SEARCHENGINE) should be disabled. I'll do it for you.\n");
3139 Config_getBool("SEARCHENGINE")=FALSE;
3142 // check if SEPARATE_MEMBER_PAGES and INLINE_GROUPED_CLASSES are both enabled
3143 if (Config_getBool("SEPARATE_MEMBER_PAGES") && Config_getBool("INLINE_GROUPED_CLASSES"))
3145 config_err("When enabling INLINE_GROUPED_CLASSES the SEPARATE_MEMBER_PAGES option should be disabled. I'll do it for you.\n");
3146 Config_getBool("SEPARATE_MEMBER_PAGES")=FALSE;
3149 // check dot image format
3150 QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT");
3151 dotImageFormat=dotImageFormat.stripWhiteSpace();
3152 if (dotImageFormat.isEmpty())
3154 dotImageFormat = "png";
3156 //else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
3158 // config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
3159 // dotImageFormat = "png";
3164 QCString &dotPath = Config_getString("DOT_PATH");
3165 if (!dotPath.isEmpty())
3167 QFileInfo fi(dotPath);
3168 if (fi.exists() && fi.isFile()) // user specified path + exec
3170 dotPath=fi.dirPath(TRUE).utf8()+"/";
3174 QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
3175 if (!dp.exists() || !dp.isFile())
3177 config_err("warning: the dot tool could not be found at %s\n",dotPath.data());
3182 dotPath=dp.dirPath(TRUE).utf8()+"/";
3185 #if defined(_WIN32) // convert slashes
3186 uint i=0,l=dotPath.length();
3187 for (i=0;i<l;i++) if (dotPath.at(i)=='/') dotPath.at(i)='\\';
3190 else // make sure the string is empty but not null!
3195 // check mscgen path
3196 QCString &mscgenPath = Config_getString("MSCGEN_PATH");
3197 if (!mscgenPath.isEmpty())
3199 QFileInfo dp(mscgenPath+"/mscgen"+portable_commandExtension());
3200 if (!dp.exists() || !dp.isFile())
3202 config_err("warning: the mscgen tool could not be found at %s\n",mscgenPath.data());
3207 mscgenPath=dp.dirPath(TRUE).utf8()+"/";
3208 #if defined(_WIN32) // convert slashes
3209 uint i=0,l=mscgenPath.length();
3210 for (i=0;i<l;i++) if (mscgenPath.at(i)=='/') mscgenPath.at(i)='\\';
3214 else // make sure the string is empty but not null!
3221 QStrList &inputSources=Config_getList("INPUT");
3222 if (inputSources.count()==0)
3224 // use current dir as the default
3225 inputSources.append(QDir::currentDirPath().utf8());
3229 s=inputSources.first();
3235 config_err("warning: tag INPUT: input source `%s' does not exist\n",s);
3237 s=inputSources.next();
3241 // add default pattern if needed
3242 QStrList &filePatternList = Config_getList("FILE_PATTERNS");
3243 if (filePatternList.isEmpty())
3245 filePatternList.append("*.c");
3246 filePatternList.append("*.cc");
3247 filePatternList.append("*.cxx");
3248 filePatternList.append("*.cpp");
3249 filePatternList.append("*.c++");
3250 filePatternList.append("*.d");
3251 filePatternList.append("*.java");
3252 filePatternList.append("*.ii");
3253 filePatternList.append("*.ixx");
3254 filePatternList.append("*.ipp");
3255 filePatternList.append("*.i++");
3256 filePatternList.append("*.inl");
3257 filePatternList.append("*.h");
3258 filePatternList.append("*.hh");
3259 filePatternList.append("*.hxx");
3260 filePatternList.append("*.hpp");
3261 filePatternList.append("*.h++");
3262 filePatternList.append("*.idl");
3263 filePatternList.append("*.odl");
3264 filePatternList.append("*.cs");
3265 filePatternList.append("*.php");
3266 filePatternList.append("*.php3");
3267 filePatternList.append("*.inc");
3268 filePatternList.append("*.m");
3269 filePatternList.append("*.mm");
3270 filePatternList.append("*.dox");
3271 filePatternList.append("*.py");
3272 filePatternList.append("*.f90");
3273 filePatternList.append("*.f");
3274 filePatternList.append("*.for");
3275 filePatternList.append("*.vhd");
3276 filePatternList.append("*.vhdl");
3277 filePatternList.append("*.tcl");
3278 filePatternList.append("*.md");
3279 filePatternList.append("*.markdown");
3280 if (portable_fileSystemIsCaseSensitive())
3282 // unix => case sensitive match => also include useful uppercase versions
3283 filePatternList.append("*.C");
3284 filePatternList.append("*.CC");
3285 filePatternList.append("*.C++");
3286 filePatternList.append("*.II");
3287 filePatternList.append("*.I++");
3288 filePatternList.append("*.H");
3289 filePatternList.append("*.HH");
3290 filePatternList.append("*.H++");
3291 filePatternList.append("*.CS");
3292 filePatternList.append("*.PHP");
3293 filePatternList.append("*.PHP3");
3294 filePatternList.append("*.M");
3295 filePatternList.append("*.MM");
3296 filePatternList.append("*.PY");
3297 filePatternList.append("*.F90");
3298 filePatternList.append("*.F");
3299 filePatternList.append("*.VHD");
3300 filePatternList.append("*.VHDL");
3301 filePatternList.append("*.TCL");
3302 filePatternList.append("*.MD");
3303 filePatternList.append("*.MARKDOWN");
3307 // add default pattern if needed
3308 QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
3309 if (examplePatternList.isEmpty())
3311 examplePatternList.append("*");
3314 // if no output format is enabled, warn the user
3315 if (!Config_getBool("GENERATE_HTML") &&
3316 !Config_getBool("GENERATE_LATEX") &&
3317 !Config_getBool("GENERATE_MAN") &&
3318 !Config_getBool("GENERATE_RTF") &&
3319 !Config_getBool("GENERATE_XML") &&
3320 !Config_getBool("GENERATE_PERLMOD") &&
3321 !Config_getBool("GENERATE_RTF") &&
3322 !Config_getBool("GENERATE_AUTOGEN_DEF") &&
3323 Config_getString("GENERATE_TAGFILE").isEmpty()
3326 config_err("warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
3329 // check HTMLHELP creation requirements
3330 if (!Config_getBool("GENERATE_HTML") &&
3331 Config_getBool("GENERATE_HTMLHELP"))
3333 config_err("warning: GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
3336 // check QHP creation requirements
3337 if (Config_getBool("GENERATE_QHP"))
3339 if (Config_getString("QHP_NAMESPACE").isEmpty())
3341 config_err("error: GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n");
3342 Config_getString("QHP_NAMESPACE")="org.doxygen.doc";
3345 if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty())
3347 config_err("error: GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
3348 Config_getString("QHP_VIRTUAL_FOLDER")="doc";
3352 if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
3354 // don't show inline info for Java output, since Java has no inline
3356 Config_getBool("INLINE_INFO")=FALSE;
3359 int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH");
3365 int &hue = Config_getInt("HTML_COLORSTYLE_HUE");
3375 int &sat = Config_getInt("HTML_COLORSTYLE_SAT");
3384 int &gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
3395 // add default words if needed
3396 QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF");
3397 if (annotationFromBrief.isEmpty())
3399 annotationFromBrief.append("The $name class");
3400 annotationFromBrief.append("The $name widget");
3401 annotationFromBrief.append("The $name file");
3402 annotationFromBrief.append("is");
3403 annotationFromBrief.append("provides");
3404 annotationFromBrief.append("specifies");
3405 annotationFromBrief.append("contains");
3406 annotationFromBrief.append("represents");
3407 annotationFromBrief.append("a");
3408 annotationFromBrief.append("an");
3409 annotationFromBrief.append("the");
3412 // some default settings for vhdl
3413 if (Config_getBool("OPTIMIZE_OUTPUT_VHDL") &&
3414 (Config_getBool("INLINE_INHERITED_MEMB") ||
3415 Config_getBool("INHERIT_DOCS") ||
3416 !Config_getBool("HIDE_SCOPE_NAMES") ||
3417 !Config_getBool("EXTRACT_PRIVATE") ||
3418 !Config_getBool("EXTRACT_PACKAGE")
3422 bool b1 = Config_getBool("INLINE_INHERITED_MEMB");
3423 bool b2 = Config_getBool("INHERIT_DOCS");
3424 bool b3 = Config_getBool("HIDE_SCOPE_NAMES");
3425 bool b4 = Config_getBool("EXTRACT_PRIVATE");
3426 bool b5 = Config_getBool("SKIP_FUNCTION_MACROS");
3427 bool b6 = Config_getBool("EXTRACT_PACKAGE");
3428 const char *s1,*s2,*s3,*s4,*s5,*s6;
3429 if (b1) s1=" INLINE_INHERITED_MEMB = NO (was YES)\n"; else s1="";
3430 if (b2) s2=" INHERIT_DOCS = NO (was YES)\n"; else s2="";
3431 if (!b3) s3=" HIDE_SCOPE_NAMES = YES (was NO)\n"; else s3="";
3432 if (!b4) s4=" EXTRACT_PRIVATE = YES (was NO)\n"; else s4="";
3433 if (b5) s5=" ENABLE_PREPROCESSING = NO (was YES)\n"; else s5="";
3434 if (!b6) s6=" EXTRACT_PACKAGE = YES (was NO)\n"; else s6="";
3437 config_err("warning: enabling OPTIMIZE_OUTPUT_VHDL assumes the following settings:\n"
3438 "%s%s%s%s%s%s",s1,s2,s3,s4,s5,s6
3441 Config_getBool("INLINE_INHERITED_MEMB") = FALSE;
3442 Config_getBool("INHERIT_DOCS") = FALSE;
3443 Config_getBool("HIDE_SCOPE_NAMES") = TRUE;
3444 Config_getBool("EXTRACT_PRIVATE") = TRUE;
3445 Config_getBool("ENABLE_PREPROCESSING") = FALSE;
3446 Config_getBool("EXTRACT_PACKAGE") = TRUE;
3453 ConfigOption *option = m_options->first();
3457 option = m_options->next();
3461 void Config::create()
3463 if (m_initialized) return;
3464 m_initialized = TRUE;
3465 addConfigOptions(this);
3468 static QCString configFileToString(const char *name)
3470 if (name==0 || name[0]==0) return 0;
3473 bool fileOpened=FALSE;
3474 if (name[0]=='-' && name[1]==0) // read from stdin
3476 fileOpened=f.open(IO_ReadOnly,stdin);
3479 const int bSize=4096;
3480 QCString contents(bSize);
3483 while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize)
3486 contents.resize(totalSize+bSize);
3489 contents.resize(totalSize);
3490 contents.at(totalSize-2)='\n'; // to help the scanner
3491 contents.at(totalSize-1)='\0';
3495 else // read from file
3498 if (!fi.exists() || !fi.isFile())
3500 config_err("error: file `%s' not found\n",name);
3504 fileOpened=f.open(IO_ReadOnly);
3508 QCString contents(fsize+2);
3509 f.readBlock(contents.data(),fsize);
3511 if (fsize==0 || contents[fsize-1]=='\n')
3512 contents[fsize]='\0';
3514 contents[fsize]='\n'; // to help the scanner
3515 contents[fsize+1]='\0';
3521 config_err("error: cannot open file `%s' for reading\n",name);
3526 bool Config::parseString(const char *fn,const char *str)
3528 config = Config::instance();
3533 includeStack.setAutoDelete(TRUE);
3534 includeStack.clear();
3536 configYYrestart( configYYin );
3543 bool Config::parse(const char *fn)
3546 return parseString(fn,configFileToString(fn));
3549 extern "C" { // some bogus code to keep the compiler happy
3550 //int configYYwrap() { return 1 ; }