Fix for UBSan build
[platform/upstream/doxygen.git] / src / config.cpp
1
2 #line 3 "<stdout>"
3
4 #define  YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
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
26
27 #define FLEX_SCANNER
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
32 #define FLEX_BETA
33 #endif
34
35 /* First, we deal with  platform-specific or compiler-specific issues. */
36
37 /* begin standard C headers. */
38 #include <stdio.h>
39 #include <string.h>
40 #include <errno.h>
41 #include <stdlib.h>
42
43 /* end standard C headers. */
44
45 /* flex integer type definitions */
46
47 #ifndef FLEXINT_H
48 #define FLEXINT_H
49
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55  * if you want the limit (max/min) macros for int types. 
56  */
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
59 #endif
60
61 #include <inttypes.h>
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;
69 #else
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;
76 #endif /* ! C99 */
77
78 /* Limits of integral types. */
79 #ifndef INT8_MIN
80 #define INT8_MIN               (-128)
81 #endif
82 #ifndef INT16_MIN
83 #define INT16_MIN              (-32767-1)
84 #endif
85 #ifndef INT32_MIN
86 #define INT32_MIN              (-2147483647-1)
87 #endif
88 #ifndef INT8_MAX
89 #define INT8_MAX               (127)
90 #endif
91 #ifndef INT16_MAX
92 #define INT16_MAX              (32767)
93 #endif
94 #ifndef INT32_MAX
95 #define INT32_MAX              (2147483647)
96 #endif
97 #ifndef UINT8_MAX
98 #define UINT8_MAX              (255U)
99 #endif
100 #ifndef UINT16_MAX
101 #define UINT16_MAX             (65535U)
102 #endif
103 #ifndef UINT32_MAX
104 #define UINT32_MAX             (4294967295U)
105 #endif
106
107 #endif /* ! FLEXINT_H */
108
109 #ifdef __cplusplus
110
111 /* The "const" storage-class-modifier is valid. */
112 #define YY_USE_CONST
113
114 #else   /* ! __cplusplus */
115
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
118
119 #define YY_USE_CONST
120
121 #endif  /* defined (__STDC__) */
122 #endif  /* ! __cplusplus */
123
124 #ifdef YY_USE_CONST
125 #define yyconst const
126 #else
127 #define yyconst
128 #endif
129
130 /* Returned upon end-of-file. */
131 #define YY_NULL 0
132
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
136  * double cast.
137  */
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
139
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.
143  */
144 #define BEGIN (yy_start) = 1 + 2 *
145
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
148  * compatibility.
149  */
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
152
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
155
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE configYYrestart(configYYin  )
158
159 #define YY_END_OF_BUFFER_CHAR 0
160
161 /* Size of default input buffer. */
162 #ifndef YY_BUF_SIZE
163 #define YY_BUF_SIZE 16384
164 #endif
165
166 /* The state buf must be large enough to hold one state per character in the main buffer.
167  */
168 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
169
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
173 #endif
174
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
178 #endif
179
180 extern yy_size_t configYYleng;
181
182 extern FILE *configYYin, *configYYout;
183
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
187
188     #define YY_LESS_LINENO(n)
189     
190 /* Return all but the first "n" matched characters back to the input stream. */
191 #define yyless(n) \
192         do \
193                 { \
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 */ \
201                 } \
202         while ( 0 )
203
204 #define unput(c) yyunput( c, (yytext_ptr)  )
205
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
209         {
210         FILE *yy_input_file;
211
212         char *yy_ch_buf;                /* input buffer */
213         char *yy_buf_pos;               /* current position in input buffer */
214
215         /* Size of input buffer in bytes, not including room for EOB
216          * characters.
217          */
218         yy_size_t yy_buf_size;
219
220         /* Number of characters read into yy_ch_buf, not including EOB
221          * characters.
222          */
223         yy_size_t yy_n_chars;
224
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
227          * delete it.
228          */
229         int yy_is_our_buffer;
230
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
234          * each newline.
235          */
236         int yy_is_interactive;
237
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
240          * not.
241          */
242         int yy_at_bol;
243
244     int yy_bs_lineno; /**< The line count. */
245     int yy_bs_column; /**< The column count. */
246     
247         /* Whether to try to fill the input buffer when we reach the
248          * end of it.
249          */
250         int yy_fill_buffer;
251
252         int yy_buffer_status;
253
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.
261          *
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.
265          */
266 #define YY_BUFFER_EOF_PENDING 2
267
268         };
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
270
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. */
275
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
278  * "scanner state".
279  *
280  * Returns the top of the stack, or NULL.
281  */
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
284                           : NULL)
285
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.
288  */
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
290
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;
295
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 */
300
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 ...
303  */
304 static int yy_did_buffer_switch_on_eof;
305
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 );
313
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  );
317
318 #define YY_FLUSH_BUFFER configYY_flush_buffer(YY_CURRENT_BUFFER )
319
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  );
323
324 void *configYYalloc (yy_size_t  );
325 void *configYYrealloc (void *,yy_size_t  );
326 void configYYfree (void *  );
327
328 #define yy_new_buffer configYY_create_buffer
329
330 #define yy_set_interactive(is_interactive) \
331         { \
332         if ( ! YY_CURRENT_BUFFER ){ \
333         configYYensure_buffer_stack (); \
334                 YY_CURRENT_BUFFER_LVALUE =    \
335             configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
336         } \
337         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
338         }
339
340 #define yy_set_bol(at_bol) \
341         { \
342         if ( ! YY_CURRENT_BUFFER ){\
343         configYYensure_buffer_stack (); \
344                 YY_CURRENT_BUFFER_LVALUE =    \
345             configYY_create_buffer(configYYin,YY_BUF_SIZE ); \
346         } \
347         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
348         }
349
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
351
352 /* Begin user sect3 */
353
354 #define configYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
356
357 typedef unsigned char YY_CHAR;
358
359 FILE *configYYin = (FILE *) 0, *configYYout = (FILE *) 0;
360
361 typedef int yy_state_type;
362
363 extern int configYYlineno;
364
365 int configYYlineno = 1;
366
367 extern char *configYYtext;
368 #define yytext_ptr configYYtext
369
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[]  );
374
375 /* Done after the current pattern has been matched and before the
376  * corresponding action - sets up configYYtext.
377  */
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; \
382         *yy_cp = '\0'; \
383         (yy_c_buf_p) = yy_cp;
384
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. */
389 struct yy_trans_info
390         {
391         flex_int32_t yy_verify;
392         flex_int32_t yy_nxt;
393         };
394 static yyconst flex_int16_t yy_accept[100] =
395     {   0,
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
406
407     } ;
408
409 static yyconst flex_int32_t yy_ec[256] =
410     {   0,
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,
421
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,
432
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,
438         1,    1,    1,    1,    1
439     } ;
440
441 static yyconst flex_int32_t yy_meta[29] =
442     {   0,
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
446     } ;
447
448 static yyconst flex_int16_t yy_base[112] =
449     {   0,
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,
460
461       334,  342,  350,  358,  360,  367,  375,    4,  383,  391,
462       399
463     } ;
464
465 static yyconst flex_int16_t yy_def[112] =
466     {   0,
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,
477
478        99,   99,   99,   99,   99,   99,   99,   99,   99,   99,
479        99
480     } ;
481
482 static yyconst flex_int16_t yy_nxt[437] =
483     {   0,
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,
494
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,
505
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,
516
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,
527
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
532     } ;
533
534 static yyconst flex_int16_t yy_chk[437] =
535     {   0,
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,
546
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,
557
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,
568
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,
579
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
584     } ;
585
586 static yy_state_type yy_last_accepting_state;
587 static char *yy_last_accepting_cpos;
588
589 extern int configYY_flex_debug;
590 int configYY_flex_debug = 0;
591
592 /* The intent behind this definition is that it'll catch
593  * any uses of REJECT which flex missed.
594  */
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
599 char *configYYtext;
600 #line 1 "config.l"
601 /******************************************************************************
602  *
603  * Copyright (C) 1997-2012 by Dimitri van Heesch.
604  *
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.
610  *
611  */
612 #line 14 "config.l"
613
614 /*
615  *      includes
616  */
617 #include <stdio.h>
618 #include <stdlib.h>
619 #include <assert.h>
620 #include <ctype.h>
621 #include <stdarg.h>
622 #include <errno.h>
623
624 #include <qfileinfo.h>
625 #include <qdir.h>
626 #include <qtextstream.h>
627 #include <qregexp.h>
628 #include <qstack.h>
629 #include <qglobal.h>
630   
631 #include "config.h"
632 #include "version.h"
633 #include "portable.h"
634 #include "util.h"
635
636 #include "lang_cfg.h"
637 #include "configoptions.h"
638
639 #undef Config_getString
640 #undef Config_getInt
641 #undef Config_getList
642 #undef Config_getEnum
643 #undef Config_getBool
644
645 #define YY_NO_INPUT 1
646
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)
653   
654 void config_err(const char *fmt, ...)
655 {
656   va_list args;
657   va_start(args, fmt);
658   vfprintf(stderr, fmt, args);
659   va_end(args); 
660 }
661 void config_warn(const char *fmt, ...)
662 {
663   va_list args;
664   va_start(args, fmt);
665   vfprintf(stderr, fmt, args);
666   va_end(args);
667 }
668
669 static QCString configStringRecode(
670     const QCString &str,
671     const char *fromEncoding,
672     const char *toEncoding);
673
674 #define MAX_INCLUDE_DEPTH 10
675 #define YY_NEVER_INTERACTIVE 1
676
677 /* -----------------------------------------------------------------
678  */
679 QCString ConfigOption::convertToComment(const QCString &s)
680 {
681   QCString result;
682   if (s.isEmpty()) return result;
683   else
684   {
685     QCString tmp=s.stripWhiteSpace();
686     char *p=tmp.data();
687     char c;
688     result+="#";
689     if (*p && *p!='\n')
690       result+=" ";
691     while ((c=*p++))
692     {
693       if (c=='\n')
694       {
695         result+="\n#";
696         if (*p && *p!='\n')
697           result+=" ";
698       }
699       else result+=c;
700     }
701     result+='\n';
702   }
703   return result;
704 }
705
706 void ConfigOption::writeBoolValue(FTextStream &t,bool v)
707 {
708   t << " ";
709   if (v) t << "YES"; else t << "NO";
710 }
711
712 void ConfigOption::writeIntValue(FTextStream &t,int i)
713 {
714   t << " " << i;
715 }
716
717 void ConfigOption::writeStringValue(FTextStream &t,QCString &s)
718 {
719   char c;
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();
724   if (p)
725   {
726     t << " ";
727     while ((c=*p++)!=0 && !needsEscaping) 
728       needsEscaping = (c==' ' || c=='\n' || c=='\t' || c=='"' || c=='#');
729     if (needsEscaping)
730     { 
731       t << "\"";
732       p=se.data();
733       while (*p)
734       {
735         if (*p==' ' && *(p+1)=='\0') break; // skip inserted space at the end
736         if (*p=='"') t << "\\"; // escape quotes
737         t << *p++;
738       }
739       t << "\"";
740     }
741     else
742     {
743       t << se;
744     }
745   }
746 }
747
748 void ConfigOption::writeStringList(FTextStream &t,QStrList &l)
749 {
750   const char *p = l.first();
751   bool first=TRUE;
752   while (p)
753   {
754     QCString s=p;
755     if (!first)
756       t << "                        ";
757     first=FALSE;
758     writeStringValue(t,s);
759     p = l.next();
760     if (p) t << " \\" << endl;
761   }
762 }
763
764 /* -----------------------------------------------------------------
765  */
766
767 Config *Config::m_instance = 0;
768
769 void ConfigInt::convertStrToVal() 
770 {
771   if (!m_valueString.isEmpty())
772   {
773     bool ok;
774     int val = m_valueString.toInt(&ok);
775     if (!ok || val<m_minVal || val>m_maxVal)
776     {
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);
779     }
780     m_value=val;
781   }
782 }
783
784 void ConfigBool::convertStrToVal()
785 {
786   QCString val = m_valueString.stripWhiteSpace().lower();
787   if (!val.isEmpty())
788   {
789     if (val=="yes" || val=="true" || val=="1" || val=="all") 
790     {
791       m_value=TRUE;
792     }
793     else if (val=="no" || val=="false" || val=="0" || val=="none")
794     {
795       m_value=FALSE;
796     }
797     else
798     {
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");
801     }
802   }
803 }
804
805 QCString &Config::getString(const char *fileName,int num,const char *name) const
806 {
807   ConfigOption *opt = m_dict->find(name);
808   if (opt==0) 
809   {
810     config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
811     exit(1);
812   }
813   else if (opt->kind()!=ConfigOption::O_String)
814   {
815     config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
816     exit(1);
817   }
818   return *((ConfigString *)opt)->valueRef();
819 }
820
821 QStrList &Config::getList(const char *fileName,int num,const char *name) const
822 {
823   ConfigOption *opt = m_dict->find(name);
824   if (opt==0) 
825   {
826     config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
827     exit(1);
828   }
829   else if (opt->kind()!=ConfigOption::O_List)
830   {
831     config_err("%d<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
832     exit(1);
833   }
834   return *((ConfigList *)opt)->valueRef();
835 }
836
837 QCString &Config::getEnum(const char *fileName,int num,const char *name) const
838 {
839   ConfigOption *opt = m_dict->find(name);
840   if (opt==0) 
841   {
842     config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
843     exit(1);
844   }
845   else if (opt->kind()!=ConfigOption::O_Enum)
846   {
847     config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
848     exit(1);
849   }
850   return *((ConfigEnum *)opt)->valueRef();
851 }
852
853 int &Config::getInt(const char *fileName,int num,const char *name) const
854 {
855   ConfigOption *opt = m_dict->find(name);
856   if (opt==0) 
857   {
858     config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
859     exit(1);
860   }
861   else if (opt->kind()!=ConfigOption::O_Int)
862   {
863     config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
864     exit(1);
865   }
866   return *((ConfigInt *)opt)->valueRef();
867 }
868
869 bool &Config::getBool(const char *fileName,int num,const char *name) const
870 {
871   ConfigOption *opt = m_dict->find(name);
872   if (opt==0) 
873   {
874     config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
875     exit(1);
876   }
877   else if (opt->kind()!=ConfigOption::O_Bool)
878   {
879     config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
880     exit(1);
881   }
882   return *((ConfigBool *)opt)->valueRef();
883 }
884
885 /* -----------------------------------------------------------------
886  */
887
888 void ConfigInt::writeXML(FTextStream& t)
889 {
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 << "'";
897   t << "/>" << endl;
898 }
899
900 void ConfigBool::writeXML(FTextStream& t)
901 {
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 << "'";
907   t << "/>" << endl;
908 }
909
910 void ConfigString::writeXML(FTextStream& t)
911 {
912   QString format;
913   switch (m_widgetType)
914   {
915     case String: format="string"; break;
916     case File:   format="file";   break;
917     case Dir:    format="dir";    break;
918   }
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 << "'";
925   t << "/>" << endl;
926 }
927
928 void ConfigEnum::writeXML(FTextStream &t)
929 {
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 << "'";
935   t << ">" << endl;
936
937   char *enumVal = m_valueRange.first();
938   while (enumVal)
939   {
940     t << "      <value name='" << convertToXML(enumVal) << "'/>" << endl;
941     enumVal = m_valueRange.next();
942   }
943
944   t << "    </option>" << endl;
945 }
946
947 void ConfigList::writeXML(FTextStream &t)
948 {
949   QString format;
950   switch (m_widgetType)
951   {
952     case String:     format="string";  break;
953     case File:       format="file";    break;
954     case Dir:        format="dir";     break;
955     case FileAndDir: format="filedir"; break;
956   }
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 << "'";
962   t << ">" << endl;
963   char *enumVal = m_value.first();
964   while (enumVal)
965   {
966     t << "      <value name='" << convertToXML(enumVal) << "'/>" << endl;
967     enumVal = m_value.next();
968   }
969
970   t << "    </option>" << endl;
971 }
972
973 void ConfigObsolete::writeXML(FTextStream &t)
974 {
975   t << "    <option type='obsolete' "
976        "id='" << convertToXML(name()) << "'/>" << endl;
977 }
978
979
980 /* -----------------------------------------------------------------
981  *
982  *      static variables
983  */
984
985 struct ConfigFileState
986 {
987   int lineNr;
988   FILE *filePtr;
989   YY_BUFFER_STATE oldState;
990   YY_BUFFER_STATE newState;
991   QCString fileName;
992 };  
993
994 static const char       *inputString;
995 static int               inputPosition;
996 static int               yyLineNr;
997 static QCString          yyFileName;
998 static QCString          tmpString;
999 static QCString         *s=0;
1000 static bool             *b=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;
1008
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;
1017
1018 static Config      *config;
1019
1020 /* -----------------------------------------------------------------
1021  */
1022 #undef  YY_INPUT
1023 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1024
1025 static int yyread(char *buf,int max_size)
1026 {
1027     // no file included
1028     if (includeStack.isEmpty()) 
1029     {
1030         int c=0;
1031         if (inputString==0) return c;
1032         while( c < max_size && inputString[inputPosition] )
1033         {
1034               *buf = inputString[inputPosition++] ;
1035               c++; buf++;
1036         }
1037         return c;
1038     } 
1039     else 
1040     {
1041         //assert(includeStack.current()->newState==YY_CURRENT_BUFFER);
1042         return (int)fread(buf,1,max_size,includeStack.current()->filePtr);
1043     }
1044 }
1045
1046
1047 static QCString configStringRecode(
1048     const QCString &str,
1049     const char *fromEncoding,
1050     const char *toEncoding)
1051 {
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)) 
1060   {
1061     fprintf(stderr,"error: unsupported character conversion: '%s'->'%s'\n",
1062         inputEncoding.data(),outputEncoding.data());
1063     exit(1);
1064   }
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))
1070   {
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());
1075   }
1076   else
1077   {
1078     fprintf(stderr,"error: failed to translate characters from %s to %s: %s\n",
1079         inputEncoding.data(),outputEncoding.data(),strerror(errno));
1080     exit(1);
1081   }
1082   portable_iconv_close(cd);
1083   return output;
1084 }
1085
1086 static void checkEncoding()
1087 {
1088   ConfigString *option = (ConfigString*)config->get("DOXYFILE_ENCODING");
1089   encoding = *option->valueRef();
1090 }
1091
1092 static FILE *tryPath(const char *path,const char *fileName)
1093 {
1094   QCString absName=(path ? (QCString)path+"/"+fileName : (QCString)fileName);
1095   QFileInfo fi(absName);
1096   if (fi.exists() && fi.isFile())
1097   {
1098     FILE *f=portable_fopen(absName,"r");
1099     if (!f) config_err("error: could not open file %s for reading\n",absName.data());
1100     return f;
1101   }
1102   return 0;
1103 }
1104
1105 static void substEnvVarsInStrList(QStrList &sl);
1106 static void substEnvVarsInString(QCString &s);
1107
1108 static bool isAbsolute(const char * fileName)
1109 {
1110 # ifdef _WIN32
1111   if (isalpha (fileName [0]) && fileName[1] == ':')
1112     fileName += 2;
1113 # endif
1114   char const fst = fileName [0];
1115   if (fst == '/')  {
1116     return true;
1117   }
1118 # ifdef _WIN32
1119   if (fst == '\\')
1120     return true;
1121 # endif
1122   return false;
1123 }
1124
1125 static FILE *findFile(const char *fileName)
1126 {
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
1132   {
1133     FILE *f = tryPath(s,fileName);
1134     if (f) return f;
1135     s=includePathList.next();
1136   } 
1137   // try cwd if includePathList fails
1138   return tryPath(".",fileName);
1139 }
1140
1141 static void readIncludeFile(const char *incName)
1142 {
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);
1146     exit(1);
1147   } 
1148
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
1154   {
1155     inc=inc.mid(1,incLen-2);
1156   }
1157
1158   FILE *f;
1159
1160   if ((f=findFile(inc))) // see if the include file can be found
1161   {
1162     // For debugging
1163 #if SHOW_INCLUDES
1164     for (i=0;i<includeStack.count();i++) msg("  ");
1165     msg("@INCLUDE = %s: parsing...\n",inc.data());
1166 #endif
1167
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;
1173     fs->filePtr=f;
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;
1179     yyFileName=inc;
1180     includeDepth++;
1181   } 
1182   else
1183   {
1184     config_err("error: @INCLUDE = %s: not found!\n",inc.data());
1185     exit(1);
1186   }
1187 }
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199 #line 1200 "<stdout>"
1200
1201 #define INITIAL 0
1202 #define Start 1
1203 #define SkipComment 2
1204 #define SkipInvalid 3
1205 #define GetString 4
1206 #define GetBool 5
1207 #define GetStrList 6
1208 #define GetQuotedString 7
1209 #define GetEnvVar 8
1210 #define Include 9
1211
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.
1216  */
1217 #include <unistd.h>
1218 #endif
1219
1220 #ifndef YY_EXTRA_TYPE
1221 #define YY_EXTRA_TYPE void *
1222 #endif
1223
1224 static int yy_init_globals (void );
1225
1226 /* Accessor methods to globals.
1227    These are made visible to non-reentrant scanners for convenience. */
1228
1229 int configYYlex_destroy (void );
1230
1231 int configYYget_debug (void );
1232
1233 void configYYset_debug (int debug_flag  );
1234
1235 YY_EXTRA_TYPE configYYget_extra (void );
1236
1237 void configYYset_extra (YY_EXTRA_TYPE user_defined  );
1238
1239 FILE *configYYget_in (void );
1240
1241 void configYYset_in  (FILE * in_str  );
1242
1243 FILE *configYYget_out (void );
1244
1245 void configYYset_out  (FILE * out_str  );
1246
1247 yy_size_t configYYget_leng (void );
1248
1249 char *configYYget_text (void );
1250
1251 int configYYget_lineno (void );
1252
1253 void configYYset_lineno (int line_number  );
1254
1255 /* Macros after this point can all be overridden by user definitions in
1256  * section 1.
1257  */
1258
1259 #ifndef YY_SKIP_YYWRAP
1260 #ifdef __cplusplus
1261 extern "C" int configYYwrap (void );
1262 #else
1263 extern int configYYwrap (void );
1264 #endif
1265 #endif
1266
1267 #ifndef yytext_ptr
1268 static void yy_flex_strncpy (char *,yyconst char *,int );
1269 #endif
1270
1271 #ifdef YY_NEED_STRLEN
1272 static int yy_flex_strlen (yyconst char * );
1273 #endif
1274
1275 #ifndef YY_NO_INPUT
1276
1277 #ifdef __cplusplus
1278 static int yyinput (void );
1279 #else
1280 static int input (void );
1281 #endif
1282
1283 #endif
1284
1285 /* Amount of stuff to slurp up with each read. */
1286 #ifndef YY_READ_BUF_SIZE
1287 #define YY_READ_BUF_SIZE 8192
1288 #endif
1289
1290 /* Copy whatever the last rule matched to the standard output. */
1291 #ifndef ECHO
1292 /* This used to be an fputs(), but since the string might contain NUL's,
1293  * we now use fwrite().
1294  */
1295 #define ECHO fwrite( configYYtext, configYYleng, 1, configYYout )
1296 #endif
1297
1298 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1299  * is returned in "result".
1300  */
1301 #ifndef YY_INPUT
1302 #define YY_INPUT(buf,result,max_size) \
1303         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1304                 { \
1305                 int c = '*'; \
1306                 yy_size_t n; \
1307                 for ( n = 0; n < max_size && \
1308                              (c = getc( configYYin )) != EOF && c != '\n'; ++n ) \
1309                         buf[n] = (char) c; \
1310                 if ( c == '\n' ) \
1311                         buf[n++] = (char) c; \
1312                 if ( c == EOF && ferror( configYYin ) ) \
1313                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1314                 result = n; \
1315                 } \
1316         else \
1317                 { \
1318                 errno=0; \
1319                 while ( (result = fread(buf, 1, max_size, configYYin))==0 && ferror(configYYin)) \
1320                         { \
1321                         if( errno != EINTR) \
1322                                 { \
1323                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1324                                 break; \
1325                                 } \
1326                         errno=0; \
1327                         clearerr(configYYin); \
1328                         } \
1329                 }\
1330 \
1331
1332 #endif
1333
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.
1337  */
1338 #ifndef yyterminate
1339 #define yyterminate() return YY_NULL
1340 #endif
1341
1342 /* Number of entries by which start-condition stack grows. */
1343 #ifndef YY_START_STACK_INCR
1344 #define YY_START_STACK_INCR 25
1345 #endif
1346
1347 /* Report a fatal error. */
1348 #ifndef YY_FATAL_ERROR
1349 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1350 #endif
1351
1352 /* end tables serialization structures and prototypes */
1353
1354 /* Default declaration of generated scanner - a define so the user can
1355  * easily add parameters.
1356  */
1357 #ifndef YY_DECL
1358 #define YY_DECL_IS_OURS 1
1359
1360 extern int configYYlex (void);
1361
1362 #define YY_DECL int configYYlex (void)
1363 #endif /* !YY_DECL */
1364
1365 /* Code executed at the beginning of each rule, after configYYtext and configYYleng
1366  * have been set up.
1367  */
1368 #ifndef YY_USER_ACTION
1369 #define YY_USER_ACTION
1370 #endif
1371
1372 /* Code executed at the end of each rule. */
1373 #ifndef YY_BREAK
1374 #define YY_BREAK break;
1375 #endif
1376
1377 #define YY_RULE_SETUP \
1378         YY_USER_ACTION
1379
1380 /** The main scanner function which does all the work.
1381  */
1382 YY_DECL
1383 {
1384         register yy_state_type yy_current_state;
1385         register char *yy_cp, *yy_bp;
1386         register int yy_act;
1387     
1388 #line 606 "config.l"
1389
1390
1391 #line 1392 "<stdout>"
1392
1393         if ( !(yy_init) )
1394                 {
1395                 (yy_init) = 1;
1396
1397 #ifdef YY_USER_INIT
1398                 YY_USER_INIT;
1399 #endif
1400
1401                 if ( ! (yy_start) )
1402                         (yy_start) = 1; /* first start state */
1403
1404                 if ( ! configYYin )
1405                         configYYin = stdin;
1406
1407                 if ( ! configYYout )
1408                         configYYout = stdout;
1409
1410                 if ( ! YY_CURRENT_BUFFER ) {
1411                         configYYensure_buffer_stack ();
1412                         YY_CURRENT_BUFFER_LVALUE =
1413                                 configYY_create_buffer(configYYin,YY_BUF_SIZE );
1414                 }
1415
1416                 configYY_load_buffer_state( );
1417                 }
1418
1419         while ( 1 )             /* loops until end-of-file is reached */
1420                 {
1421                 yy_cp = (yy_c_buf_p);
1422
1423                 /* Support of configYYtext. */
1424                 *yy_cp = (yy_hold_char);
1425
1426                 /* yy_bp points to the position in yy_ch_buf of the start of
1427                  * the current run.
1428                  */
1429                 yy_bp = yy_cp;
1430
1431                 yy_current_state = (yy_start);
1432 yy_match:
1433                 do
1434                         {
1435                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1436                         if ( yy_accept[yy_current_state] )
1437                                 {
1438                                 (yy_last_accepting_state) = yy_current_state;
1439                                 (yy_last_accepting_cpos) = yy_cp;
1440                                 }
1441                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1442                                 {
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];
1446                                 }
1447                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1448                         ++yy_cp;
1449                         }
1450                 while ( yy_base[yy_current_state] != 408 );
1451
1452 yy_find_action:
1453                 yy_act = yy_accept[yy_current_state];
1454                 if ( yy_act == 0 )
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];
1459                         }
1460
1461                 YY_DO_BEFORE_ACTION;
1462
1463 do_action:      /* This label is used only to access EOF actions. */
1464
1465                 switch ( yy_act )
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;
1473
1474 case 1:
1475 YY_RULE_SETUP
1476 #line 608 "config.l"
1477
1478         YY_BREAK
1479 case 2:
1480 YY_RULE_SETUP
1481 #line 609 "config.l"
1482 { BEGIN(SkipComment); }
1483         YY_BREAK
1484 case 3:
1485 YY_RULE_SETUP
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
1491                                            {
1492                                              config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1493                                                  configYYtext,yyLineNr,yyFileName.data()); 
1494                                              BEGIN(SkipInvalid);
1495                                            }
1496                                            else // known tag
1497                                            {
1498                                              option->setEncoding(encoding);
1499                                              switch(option->kind())
1500                                              {
1501                                                case ConfigOption::O_Info:
1502                                                  // shouldn't get here!
1503                                                  BEGIN(SkipInvalid);
1504                                                  break;
1505                                                case ConfigOption::O_List:
1506                                                  l = ((ConfigList *)option)->valueRef();
1507                                                  l->clear();
1508                                                  elemStr="";
1509                                                  BEGIN(GetStrList);
1510                                                  break;
1511                                                case ConfigOption::O_Enum:
1512                                                  s = ((ConfigEnum *)option)->valueRef();
1513                                                  s->resize(0);
1514                                                  BEGIN(GetString);
1515                                                  break;
1516                                                case ConfigOption::O_String:
1517                                                  s = ((ConfigString *)option)->valueRef();
1518                                                  s->resize(0);
1519                                                  BEGIN(GetString);
1520                                                  break;
1521                                                case ConfigOption::O_Int:
1522                                                  s = ((ConfigInt *)option)->valueStringRef();
1523                                                  s->resize(0);
1524                                                  BEGIN(GetString);
1525                                                  break;
1526                                                case ConfigOption::O_Bool:
1527                                                  s = ((ConfigBool *)option)->valueStringRef();
1528                                                  s->resize(0);
1529                                                  BEGIN(GetString);
1530                                                  break;
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()); 
1535                                                  BEGIN(SkipInvalid);
1536                                                  break;
1537                                              }
1538                                            }
1539                                         }
1540         YY_BREAK
1541 case 4:
1542 YY_RULE_SETUP
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
1548                                           {
1549                                             config_err("warning: ignoring unsupported tag `%s' at line %d, file %s\n",
1550                                                 configYYtext,yyLineNr,yyFileName.data()); 
1551                                             BEGIN(SkipInvalid);
1552                                           }
1553                                           else // known tag
1554                                           {
1555                                             switch(option->kind())
1556                                             {
1557                                               case ConfigOption::O_Info:
1558                                                 // shouldn't get here!
1559                                                 BEGIN(SkipInvalid);
1560                                                 break;
1561                                               case ConfigOption::O_List:
1562                                                 l = ((ConfigList *)option)->valueRef();
1563                                                 elemStr="";
1564                                                 BEGIN(GetStrList);
1565                                                 break;
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()); 
1572                                                 BEGIN(SkipInvalid);
1573                                                 break;
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()); 
1578                                                  BEGIN(SkipInvalid);
1579                                                  break;
1580                                              }
1581                                            }
1582                                         }
1583         YY_BREAK
1584 case 5:
1585 YY_RULE_SETUP
1586 #line 702 "config.l"
1587 { BEGIN(GetStrList); l=&includePathList; l->clear(); elemStr=""; }
1588         YY_BREAK
1589 /* include a config file */
1590 case 6:
1591 YY_RULE_SETUP
1592 #line 704 "config.l"
1593 { BEGIN(Include);}
1594         YY_BREAK
1595 case 7:
1596 YY_RULE_SETUP
1597 #line 705 "config.l"
1598
1599                                           readIncludeFile(configStringRecode(configYYtext,encoding,"UTF-8")); 
1600                                           BEGIN(Start);
1601                                         }
1602         YY_BREAK
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"
1614 {
1615                                           //printf("End of include file\n");
1616                                           //printf("Include stack depth=%d\n",g_includeStack.count());
1617                                           if (includeStack.isEmpty())
1618                                           {
1619                                             //printf("Terminating scanner!\n");
1620                                             yyterminate();
1621                                           }
1622                                           else
1623                                           {
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;
1631                                             delete fs; fs=0;
1632                                             includeDepth--;
1633                                           }
1634                                         }
1635         YY_BREAK
1636 case 8:
1637 YY_RULE_SETUP
1638 #line 731 "config.l"
1639 { config_err("warning: ignoring unknown tag `%s' at line %d, file %s\n",configYYtext,yyLineNr,yyFileName.data()); }
1640         YY_BREAK
1641 case 9:
1642 /* rule 9 can match eol */
1643 YY_RULE_SETUP
1644 #line 732 "config.l"
1645 { yyLineNr++; BEGIN(Start); }
1646         YY_BREAK
1647 case 10:
1648 /* rule 10 can match eol */
1649 YY_RULE_SETUP
1650 #line 733 "config.l"
1651
1652                                           yyLineNr++; 
1653                                           if (!elemStr.isEmpty())
1654                                           {
1655                                             //printf("elemStr1=`%s'\n",elemStr.data());
1656                                             l->append(elemStr);
1657                                           }
1658                                           BEGIN(Start); 
1659                                         }
1660         YY_BREAK
1661 case 11:
1662 YY_RULE_SETUP
1663 #line 742 "config.l"
1664 {
1665                                           if (!elemStr.isEmpty())
1666                                           {
1667                                             //printf("elemStr2=`%s'\n",elemStr.data());
1668                                             l->append(elemStr);
1669                                           }
1670                                           elemStr.resize(0);
1671                                         }
1672         YY_BREAK
1673 case 12:
1674 YY_RULE_SETUP
1675 #line 750 "config.l"
1676 { (*s)+=configStringRecode(configYYtext,encoding,"UTF-8"); 
1677                                           checkEncoding();
1678                                         }
1679         YY_BREAK
1680 case 13:
1681 YY_RULE_SETUP
1682 #line 753 "config.l"
1683 { lastState=YY_START;
1684                                           BEGIN(GetQuotedString); 
1685                                           tmpString.resize(0); 
1686                                         }
1687         YY_BREAK
1688 case 14:
1689 /* rule 14 can match eol */
1690 YY_RULE_SETUP
1691 #line 757 "config.l"
1692
1693                                           // we add a bogus space to signal that the string was quoted. This space will be stripped later on.
1694                                           tmpString+=" ";
1695                                           //printf("Quoted String = `%s'\n",tmpString.data());
1696                                           if (lastState==GetString)
1697                                           {
1698                                             (*s)+=configStringRecode(tmpString,encoding,"UTF-8");
1699                                             checkEncoding();
1700                                           }
1701                                           else
1702                                           {
1703                                             elemStr+=configStringRecode(tmpString,encoding,"UTF-8");
1704                                           }
1705                                           if (*configYYtext=='\n')
1706                                           {
1707                                             config_err("warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data());
1708                                             yyLineNr++;
1709                                           }
1710                                           BEGIN(lastState);
1711                                         }
1712         YY_BREAK
1713 case 15:
1714 YY_RULE_SETUP
1715 #line 777 "config.l"
1716 {
1717                                           tmpString+='"';
1718                                         }
1719         YY_BREAK
1720 case 16:
1721 YY_RULE_SETUP
1722 #line 780 "config.l"
1723 { tmpString+=*configYYtext; }
1724         YY_BREAK
1725 case 17:
1726 YY_RULE_SETUP
1727 #line 781 "config.l"
1728
1729                                           QCString bs=configYYtext; 
1730                                           bs=bs.upper();
1731                                           if (bs=="YES" || bs=="1")
1732                                             *b=TRUE;
1733                                           else if (bs=="NO" || bs=="0")
1734                                             *b=FALSE;
1735                                           else 
1736                                           {
1737                                             *b=FALSE; 
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());
1741                                           }
1742                                         }
1743         YY_BREAK
1744 case 18:
1745 YY_RULE_SETUP
1746 #line 796 "config.l"
1747 {
1748                                           elemStr+=configStringRecode(configYYtext,encoding,"UTF-8");
1749                                         }
1750         YY_BREAK
1751 case 19:
1752 /* rule 19 can match eol */
1753 YY_RULE_SETUP
1754 #line 799 "config.l"
1755 { yyLineNr++; BEGIN(Start); }
1756         YY_BREAK
1757 case 20:
1758 /* rule 20 can match eol */
1759 YY_RULE_SETUP
1760 #line 800 "config.l"
1761 { yyLineNr++; BEGIN(Start); }
1762         YY_BREAK
1763 case 21:
1764 /* rule 21 can match eol */
1765 YY_RULE_SETUP
1766 #line 801 "config.l"
1767 { yyLineNr++; }
1768         YY_BREAK
1769 case 22:
1770 YY_RULE_SETUP
1771 #line 802 "config.l"
1772
1773         YY_BREAK
1774 case 23:
1775 /* rule 23 can match eol */
1776 YY_RULE_SETUP
1777 #line 803 "config.l"
1778 { yyLineNr++ ; }
1779         YY_BREAK
1780 case 24:
1781 YY_RULE_SETUP
1782 #line 805 "config.l"
1783 ECHO;
1784         YY_BREAK
1785 #line 1786 "<stdout>"
1786
1787         case YY_END_OF_BUFFER:
1788                 {
1789                 /* Amount of text matched not including the EOB char. */
1790                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1791
1792                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1793                 *yy_cp = (yy_hold_char);
1794                 YY_RESTORE_YY_MORE_OFFSET
1795
1796                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1797                         {
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.
1806                          */
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;
1810                         }
1811
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
1817                  * in input().
1818                  */
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;
1822
1823                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1824
1825                         yy_current_state = yy_get_previous_state(  );
1826
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).
1834                          */
1835
1836                         yy_next_state = yy_try_NUL_trans( yy_current_state );
1837
1838                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1839
1840                         if ( yy_next_state )
1841                                 {
1842                                 /* Consume the NUL. */
1843                                 yy_cp = ++(yy_c_buf_p);
1844                                 yy_current_state = yy_next_state;
1845                                 goto yy_match;
1846                                 }
1847
1848                         else
1849                                 {
1850                                 yy_cp = (yy_c_buf_p);
1851                                 goto yy_find_action;
1852                                 }
1853                         }
1854
1855                 else switch ( yy_get_next_buffer(  ) )
1856                         {
1857                         case EOB_ACT_END_OF_FILE:
1858                                 {
1859                                 (yy_did_buffer_switch_on_eof) = 0;
1860
1861                                 if ( configYYwrap( ) )
1862                                         {
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.
1871                                          */
1872                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1873
1874                                         yy_act = YY_STATE_EOF(YY_START);
1875                                         goto do_action;
1876                                         }
1877
1878                                 else
1879                                         {
1880                                         if ( ! (yy_did_buffer_switch_on_eof) )
1881                                                 YY_NEW_FILE;
1882                                         }
1883                                 break;
1884                                 }
1885
1886                         case EOB_ACT_CONTINUE_SCAN:
1887                                 (yy_c_buf_p) =
1888                                         (yytext_ptr) + yy_amount_of_matched_text;
1889
1890                                 yy_current_state = yy_get_previous_state(  );
1891
1892                                 yy_cp = (yy_c_buf_p);
1893                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1894                                 goto yy_match;
1895
1896                         case EOB_ACT_LAST_MATCH:
1897                                 (yy_c_buf_p) =
1898                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1899
1900                                 yy_current_state = yy_get_previous_state(  );
1901
1902                                 yy_cp = (yy_c_buf_p);
1903                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1904                                 goto yy_find_action;
1905                         }
1906                 break;
1907                 }
1908
1909         default:
1910                 YY_FATAL_ERROR(
1911                         "fatal flex scanner internal error--no action found" );
1912         } /* end of action switch */
1913                 } /* end of scanning one token */
1914 } /* end of configYYlex */
1915
1916 /* yy_get_next_buffer - try to read in a new buffer
1917  *
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
1922  */
1923 static int yy_get_next_buffer (void)
1924 {
1925         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1926         register char *source = (yytext_ptr);
1927         register int number_to_move, i;
1928         int ret_val;
1929
1930         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1931                 YY_FATAL_ERROR(
1932                 "fatal flex scanner internal error--end of buffer missed" );
1933
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 )
1937                         {
1938                         /* We matched a single character, the EOB, so
1939                          * treat this as a final EOF.
1940                          */
1941                         return EOB_ACT_END_OF_FILE;
1942                         }
1943
1944                 else
1945                         {
1946                         /* We matched some text prior to the EOB, first
1947                          * process it.
1948                          */
1949                         return EOB_ACT_LAST_MATCH;
1950                         }
1951                 }
1952
1953         /* Try to read more data. */
1954
1955         /* First move last chars to start of buffer. */
1956         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1957
1958         for ( i = 0; i < number_to_move; ++i )
1959                 *(dest++) = *(source++);
1960
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,
1963                  * just force an EOF
1964                  */
1965                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1966
1967         else
1968                 {
1969                         yy_size_t num_to_read =
1970                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1971
1972                 while ( num_to_read <= 0 )
1973                         { /* Not enough room in the buffer - grow it. */
1974
1975                         /* just a shorter name for the current buffer */
1976                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1977
1978                         int yy_c_buf_p_offset =
1979                                 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1980
1981                         if ( b->yy_is_our_buffer )
1982                                 {
1983                                 yy_size_t new_size = b->yy_buf_size * 2;
1984
1985                                 if ( new_size <= 0 )
1986                                         b->yy_buf_size += b->yy_buf_size / 8;
1987                                 else
1988                                         b->yy_buf_size *= 2;
1989
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  );
1993                                 }
1994                         else
1995                                 /* Can't grow it, we don't own it. */
1996                                 b->yy_ch_buf = 0;
1997
1998                         if ( ! b->yy_ch_buf )
1999                                 YY_FATAL_ERROR(
2000                                 "fatal error - scanner input buffer overflow" );
2001
2002                         (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
2003
2004                         num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2005                                                 number_to_move - 1;
2006
2007                         }
2008
2009                 if ( num_to_read > YY_READ_BUF_SIZE )
2010                         num_to_read = YY_READ_BUF_SIZE;
2011
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 );
2015
2016                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2017                 }
2018
2019         if ( (yy_n_chars) == 0 )
2020                 {
2021                 if ( number_to_move == YY_MORE_ADJ )
2022                         {
2023                         ret_val = EOB_ACT_END_OF_FILE;
2024                         configYYrestart(configYYin  );
2025                         }
2026
2027                 else
2028                         {
2029                         ret_val = EOB_ACT_LAST_MATCH;
2030                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2031                                 YY_BUFFER_EOF_PENDING;
2032                         }
2033                 }
2034
2035         else
2036                 ret_val = EOB_ACT_CONTINUE_SCAN;
2037
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()" );
2044         }
2045
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;
2049
2050         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2051
2052         return ret_val;
2053 }
2054
2055 /* yy_get_previous_state - get the state just before the EOB char was reached */
2056
2057     static yy_state_type yy_get_previous_state (void)
2058 {
2059         register yy_state_type yy_current_state;
2060         register char *yy_cp;
2061     
2062         yy_current_state = (yy_start);
2063
2064         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2065                 {
2066                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 28);
2067                 if ( yy_accept[yy_current_state] )
2068                         {
2069                         (yy_last_accepting_state) = yy_current_state;
2070                         (yy_last_accepting_cpos) = yy_cp;
2071                         }
2072                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2073                         {
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];
2077                         }
2078                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2079                 }
2080
2081         return yy_current_state;
2082 }
2083
2084 /* yy_try_NUL_trans - try to make a transition on the NUL character
2085  *
2086  * synopsis
2087  *      next_state = yy_try_NUL_trans( current_state );
2088  */
2089     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2090 {
2091         register int yy_is_jam;
2092         register char *yy_cp = (yy_c_buf_p);
2093
2094         register YY_CHAR yy_c = 28;
2095         if ( yy_accept[yy_current_state] )
2096                 {
2097                 (yy_last_accepting_state) = yy_current_state;
2098                 (yy_last_accepting_cpos) = yy_cp;
2099                 }
2100         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2101                 {
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];
2105                 }
2106         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2107         yy_is_jam = (yy_current_state == 99);
2108
2109         return yy_is_jam ? 0 : yy_current_state;
2110 }
2111
2112 #ifndef YY_NO_INPUT
2113 #ifdef __cplusplus
2114     static int yyinput (void)
2115 #else
2116     static int input  (void)
2117 #endif
2118
2119 {
2120         int c;
2121     
2122         *(yy_c_buf_p) = (yy_hold_char);
2123
2124         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2125                 {
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.
2129                  */
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';
2133
2134                 else
2135                         { /* need more input */
2136                         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
2137                         ++(yy_c_buf_p);
2138
2139                         switch ( yy_get_next_buffer(  ) )
2140                                 {
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.
2150                                          */
2151
2152                                         /* Reset buffer status. */
2153                                         configYYrestart(configYYin );
2154
2155                                         /*FALLTHROUGH*/
2156
2157                                 case EOB_ACT_END_OF_FILE:
2158                                         {
2159                                         if ( configYYwrap( ) )
2160                                                 return 0;
2161
2162                                         if ( ! (yy_did_buffer_switch_on_eof) )
2163                                                 YY_NEW_FILE;
2164 #ifdef __cplusplus
2165                                         return yyinput();
2166 #else
2167                                         return input();
2168 #endif
2169                                         }
2170
2171                                 case EOB_ACT_CONTINUE_SCAN:
2172                                         (yy_c_buf_p) = (yytext_ptr) + offset;
2173                                         break;
2174                                 }
2175                         }
2176                 }
2177
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);
2181
2182         return c;
2183 }
2184 #endif  /* ifndef YY_NO_INPUT */
2185
2186 /** Immediately switch to a different input stream.
2187  * @param input_file A readable stream.
2188  * 
2189  * @note This function does not reset the start condition to @c INITIAL .
2190  */
2191     void configYYrestart  (FILE * input_file )
2192 {
2193     
2194         if ( ! YY_CURRENT_BUFFER ){
2195         configYYensure_buffer_stack ();
2196                 YY_CURRENT_BUFFER_LVALUE =
2197             configYY_create_buffer(configYYin,YY_BUF_SIZE );
2198         }
2199
2200         configYY_init_buffer(YY_CURRENT_BUFFER,input_file );
2201         configYY_load_buffer_state( );
2202 }
2203
2204 /** Switch to a different input buffer.
2205  * @param new_buffer The new input buffer.
2206  * 
2207  */
2208     void configYY_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2209 {
2210     
2211         /* TODO. We should be able to replace this entire function body
2212          * with
2213          *              configYYpop_buffer_state();
2214          *              configYYpush_buffer_state(new_buffer);
2215      */
2216         configYYensure_buffer_stack ();
2217         if ( YY_CURRENT_BUFFER == new_buffer )
2218                 return;
2219
2220         if ( YY_CURRENT_BUFFER )
2221                 {
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);
2226                 }
2227
2228         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2229         configYY_load_buffer_state( );
2230
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.
2235          */
2236         (yy_did_buffer_switch_on_eof) = 1;
2237 }
2238
2239 static void configYY_load_buffer_state  (void)
2240 {
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);
2245 }
2246
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.
2250  * 
2251  * @return the allocated buffer state.
2252  */
2253     YY_BUFFER_STATE configYY_create_buffer  (FILE * file, int  size )
2254 {
2255         YY_BUFFER_STATE b;
2256     
2257         b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state )  );
2258         if ( ! b )
2259                 YY_FATAL_ERROR( "out of dynamic memory in configYY_create_buffer()" );
2260
2261         b->yy_buf_size = size;
2262
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.
2265          */
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()" );
2269
2270         b->yy_is_our_buffer = 1;
2271
2272         configYY_init_buffer(b,file );
2273
2274         return b;
2275 }
2276
2277 /** Destroy the buffer.
2278  * @param b a buffer created with configYY_create_buffer()
2279  * 
2280  */
2281     void configYY_delete_buffer (YY_BUFFER_STATE  b )
2282 {
2283     
2284         if ( ! b )
2285                 return;
2286
2287         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2288                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2289
2290         if ( b->yy_is_our_buffer )
2291                 configYYfree((void *) b->yy_ch_buf  );
2292
2293         configYYfree((void *) b  );
2294 }
2295
2296 #ifndef __cplusplus
2297 extern int isatty (int );
2298 #endif /* __cplusplus */
2299     
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.
2303  */
2304     static void configYY_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2305
2306 {
2307         int oerrno = errno;
2308     
2309         configYY_flush_buffer(b );
2310
2311         b->yy_input_file = file;
2312         b->yy_fill_buffer = 1;
2313
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.
2317      */
2318     if (b != YY_CURRENT_BUFFER){
2319         b->yy_bs_lineno = 1;
2320         b->yy_bs_column = 0;
2321     }
2322
2323         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2324     
2325         errno = oerrno;
2326 }
2327
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.
2330  * 
2331  */
2332     void configYY_flush_buffer (YY_BUFFER_STATE  b )
2333 {
2334         if ( ! b )
2335                 return;
2336
2337         b->yy_n_chars = 0;
2338
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.
2342          */
2343         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2344         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2345
2346         b->yy_buf_pos = &b->yy_ch_buf[0];
2347
2348         b->yy_at_bol = 1;
2349         b->yy_buffer_status = YY_BUFFER_NEW;
2350
2351         if ( b == YY_CURRENT_BUFFER )
2352                 configYY_load_buffer_state( );
2353 }
2354
2355 /** Pushes the new state onto the stack. The new state becomes
2356  *  the current state. This function will allocate the stack
2357  *  if necessary.
2358  *  @param new_buffer The new state.
2359  *  
2360  */
2361 void configYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2362 {
2363         if (new_buffer == NULL)
2364                 return;
2365
2366         configYYensure_buffer_stack();
2367
2368         /* This block is copied from configYY_switch_to_buffer. */
2369         if ( YY_CURRENT_BUFFER )
2370                 {
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);
2375                 }
2376
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;
2381
2382         /* copied from configYY_switch_to_buffer. */
2383         configYY_load_buffer_state( );
2384         (yy_did_buffer_switch_on_eof) = 1;
2385 }
2386
2387 /** Removes and deletes the top of the stack, if present.
2388  *  The next element becomes the new top.
2389  *  
2390  */
2391 void configYYpop_buffer_state (void)
2392 {
2393         if (!YY_CURRENT_BUFFER)
2394                 return;
2395
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);
2400
2401         if (YY_CURRENT_BUFFER) {
2402                 configYY_load_buffer_state( );
2403                 (yy_did_buffer_switch_on_eof) = 1;
2404         }
2405 }
2406
2407 /* Allocates the stack if it does not exist.
2408  *  Guarantees space for at least one push.
2409  */
2410 static void configYYensure_buffer_stack (void)
2411 {
2412         yy_size_t num_to_alloc;
2413     
2414         if (!(yy_buffer_stack)) {
2415
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.
2419          */
2420                 num_to_alloc = 1;
2421                 (yy_buffer_stack) = (struct yy_buffer_state**)configYYalloc
2422                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
2423                                                                 );
2424                 if ( ! (yy_buffer_stack) )
2425                         YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2426                                                                   
2427                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2428                                 
2429                 (yy_buffer_stack_max) = num_to_alloc;
2430                 (yy_buffer_stack_top) = 0;
2431                 return;
2432         }
2433
2434         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2435
2436                 /* Increase the buffer to prepare for a possible push. */
2437                 int grow_size = 8 /* arbitrary grow size */;
2438
2439                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2440                 (yy_buffer_stack) = (struct yy_buffer_state**)configYYrealloc
2441                                                                 ((yy_buffer_stack),
2442                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
2443                                                                 );
2444                 if ( ! (yy_buffer_stack) )
2445                         YY_FATAL_ERROR( "out of dynamic memory in configYYensure_buffer_stack()" );
2446
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;
2450         }
2451 }
2452
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
2456  * 
2457  * @return the newly allocated buffer state object. 
2458  */
2459 YY_BUFFER_STATE configYY_scan_buffer  (char * base, yy_size_t  size )
2460 {
2461         YY_BUFFER_STATE b;
2462     
2463         if ( size < 2 ||
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. */
2467                 return 0;
2468
2469         b = (YY_BUFFER_STATE) configYYalloc(sizeof( struct yy_buffer_state )  );
2470         if ( ! b )
2471                 YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_buffer()" );
2472
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;
2479         b->yy_at_bol = 1;
2480         b->yy_fill_buffer = 0;
2481         b->yy_buffer_status = YY_BUFFER_NEW;
2482
2483         configYY_switch_to_buffer(b  );
2484
2485         return b;
2486 }
2487
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
2491  * 
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.
2495  */
2496 YY_BUFFER_STATE configYY_scan_string (yyconst char * yystr )
2497 {
2498     
2499         return configYY_scan_bytes(yystr,strlen(yystr) );
2500 }
2501
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.
2506  * 
2507  * @return the newly allocated buffer state object.
2508  */
2509 YY_BUFFER_STATE configYY_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
2510 {
2511         YY_BUFFER_STATE b;
2512         char *buf;
2513         yy_size_t n, i;
2514     
2515         /* Get memory for full buffer, including space for trailing EOB's. */
2516         n = _yybytes_len + 2;
2517         buf = (char *) configYYalloc(n  );
2518         if ( ! buf )
2519                 YY_FATAL_ERROR( "out of dynamic memory in configYY_scan_bytes()" );
2520
2521         for ( i = 0; i < _yybytes_len; ++i )
2522                 buf[i] = yybytes[i];
2523
2524         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2525
2526         b = configYY_scan_buffer(buf,n );
2527         if ( ! b )
2528                 YY_FATAL_ERROR( "bad buffer in configYY_scan_bytes()" );
2529
2530         /* It's okay to grow etc. this buffer, and we should throw it
2531          * away when we're done.
2532          */
2533         b->yy_is_our_buffer = 1;
2534
2535         return b;
2536 }
2537
2538 #ifndef YY_EXIT_FAILURE
2539 #define YY_EXIT_FAILURE 2
2540 #endif
2541
2542 static void yy_fatal_error (yyconst char* msg )
2543 {
2544         (void) fprintf( stderr, "%s\n", msg );
2545         exit( YY_EXIT_FAILURE );
2546 }
2547
2548 /* Redefine yyless() so it works in section 3 code. */
2549
2550 #undef yyless
2551 #define yyless(n) \
2552         do \
2553                 { \
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; \
2562                 } \
2563         while ( 0 )
2564
2565 /* Accessor  methods (get/set functions) to struct members. */
2566
2567 /** Get the current line number.
2568  * 
2569  */
2570 int configYYget_lineno  (void)
2571 {
2572         
2573     return configYYlineno;
2574 }
2575
2576 /** Get the input stream.
2577  * 
2578  */
2579 FILE *configYYget_in  (void)
2580 {
2581         return configYYin;
2582 }
2583
2584 /** Get the output stream.
2585  * 
2586  */
2587 FILE *configYYget_out  (void)
2588 {
2589         return configYYout;
2590 }
2591
2592 /** Get the length of the current token.
2593  * 
2594  */
2595 yy_size_t configYYget_leng  (void)
2596 {
2597         return configYYleng;
2598 }
2599
2600 /** Get the current token.
2601  * 
2602  */
2603
2604 char *configYYget_text  (void)
2605 {
2606         return configYYtext;
2607 }
2608
2609 /** Set the current line number.
2610  * @param line_number
2611  * 
2612  */
2613 void configYYset_lineno (int  line_number )
2614 {
2615     
2616     configYYlineno = line_number;
2617 }
2618
2619 /** Set the input stream. This does not discard the current
2620  * input buffer.
2621  * @param in_str A readable stream.
2622  * 
2623  * @see configYY_switch_to_buffer
2624  */
2625 void configYYset_in (FILE *  in_str )
2626 {
2627         configYYin = in_str ;
2628 }
2629
2630 void configYYset_out (FILE *  out_str )
2631 {
2632         configYYout = out_str ;
2633 }
2634
2635 int configYYget_debug  (void)
2636 {
2637         return configYY_flex_debug;
2638 }
2639
2640 void configYYset_debug (int  bdebug )
2641 {
2642         configYY_flex_debug = bdebug ;
2643 }
2644
2645 static int yy_init_globals (void)
2646 {
2647         /* Initialization is the same as for the non-reentrant scanner.
2648      * This function is called from configYYlex_destroy(), so don't allocate here.
2649      */
2650
2651     (yy_buffer_stack) = 0;
2652     (yy_buffer_stack_top) = 0;
2653     (yy_buffer_stack_max) = 0;
2654     (yy_c_buf_p) = (char *) 0;
2655     (yy_init) = 0;
2656     (yy_start) = 0;
2657
2658 /* Defined in main.c */
2659 #ifdef YY_STDINIT
2660     configYYin = stdin;
2661     configYYout = stdout;
2662 #else
2663     configYYin = (FILE *) 0;
2664     configYYout = (FILE *) 0;
2665 #endif
2666
2667     /* For future reference: Set errno on error, since we are called by
2668      * configYYlex_init()
2669      */
2670     return 0;
2671 }
2672
2673 /* configYYlex_destroy is for both reentrant and non-reentrant scanners. */
2674 int configYYlex_destroy  (void)
2675 {
2676     
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();
2682         }
2683
2684         /* Destroy the stack itself. */
2685         configYYfree((yy_buffer_stack) );
2686         (yy_buffer_stack) = NULL;
2687
2688     /* Reset the globals. This is important in a non-reentrant scanner so the next time
2689      * configYYlex() is called, initialization will occur. */
2690     yy_init_globals( );
2691
2692     return 0;
2693 }
2694
2695 /*
2696  * Internal utility routines.
2697  */
2698
2699 #ifndef yytext_ptr
2700 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2701 {
2702         register int i;
2703         for ( i = 0; i < n; ++i )
2704                 s1[i] = s2[i];
2705 }
2706 #endif
2707
2708 #ifdef YY_NEED_STRLEN
2709 static int yy_flex_strlen (yyconst char * s )
2710 {
2711         register int n;
2712         for ( n = 0; s[n]; ++n )
2713                 ;
2714
2715         return n;
2716 }
2717 #endif
2718
2719 void *configYYalloc (yy_size_t  size )
2720 {
2721         return (void *) malloc( size );
2722 }
2723
2724 void *configYYrealloc  (void * ptr, yy_size_t  size )
2725 {
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.
2732          */
2733         return (void *) realloc( (char *) ptr, size );
2734 }
2735
2736 void configYYfree (void * ptr )
2737 {
2738         free( (char *) ptr );   /* see configYYrealloc() for (char *) cast */
2739 }
2740
2741 #define YYTABLES_NAME "yytables"
2742
2743 #line 805 "config.l"
2744
2745
2746
2747 /*@ ----------------------------------------------------------------------------
2748  */
2749
2750 void Config::writeTemplate(FTextStream &t,bool sl,bool upd)
2751 {
2752   t << "# Doxyfile " << versionString << endl << endl;
2753   if (!sl)
2754   {
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";
2757     t << "#\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";
2764   }
2765   ConfigOption *option = m_options->first();
2766   while (option)
2767   {
2768     option->writeTemplate(t,sl,upd);
2769     option = m_options->next();
2770   }
2771 }
2772
2773 void Config::writeXML(FTextStream &t)
2774 {
2775   t << "<doxygenconfig>" << endl;
2776   bool first=TRUE;
2777   ConfigOption *option = m_options->first();
2778   while (option)
2779   {
2780     if (option->kind()==ConfigOption::O_Info)
2781     {
2782       if (!first) t << "  </group>" << endl;
2783       t << "  <group name='" << option->name() << "' "
2784            "docs='"        << option->docs() << "'>" << endl;
2785       first=FALSE;
2786     }
2787     else
2788     {
2789       option->writeXML(t);
2790     }
2791     option = m_options->next();
2792   }
2793   option = m_obsolete->first();
2794   while (option)
2795   {
2796     option->writeXML(t);
2797     option = m_obsolete->next();
2798   }
2799   if (!first) t << "  </group>" << endl;
2800   t << "</doxygenconfig>" << endl;
2801 }
2802
2803 void Config::convertStrToVal()
2804 {
2805   ConfigOption *option = m_options->first();
2806   while (option)
2807   {
2808     option->convertStrToVal();
2809     option = m_options->next();
2810   }
2811 }
2812
2813 static void substEnvVarsInString(QCString &s)
2814 {
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;
2818   int p=0;
2819   int i,l;
2820   //printf("substEnvVarInString(%s) start\n",s.data());
2821   while ((i=re.match(s,p,&l))!=-1 || (i=re2.match(s,p,&l))!=-1)
2822   {
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
2828   }
2829   s=s.stripWhiteSpace(); // to strip the bogus space that was added when an argument
2830                          // has quotes
2831   //printf("substEnvVarInString(%s) end\n",s.data());
2832 }
2833
2834 static void substEnvVarsInStrList(QStrList &sl)
2835 {
2836   char *s = sl.first();
2837   while (s)
2838   {
2839     QCString result(s);
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);
2844
2845     //printf("Result %s was quoted=%d\n",result.data(),wasQuoted);
2846
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! */
2852     {
2853       int l=result.length();
2854       int i,p=0;
2855       // skip spaces
2856       // search for a "word"
2857       for (i=0;i<l;i++)
2858       {
2859         char c=0;
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
2866         {
2867           if (c=='"') // word within quotes
2868           {
2869             p=i+1;
2870             for (i++;i<l;i++)
2871             {
2872               c=result.at(i);
2873               if (c=='"') // end quote
2874               {
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
2878                 p=i+1;
2879                 break; 
2880               }
2881               else if (c=='\\') // skip escaped stuff
2882               {
2883                 i++;
2884               }
2885             }
2886           }
2887           else if (c==' ' || c=='\t') // separator
2888           {
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
2892             p=i+1;
2893           }
2894         }
2895       }
2896       if (p!=l) // add the leftover as a string
2897       {
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
2901       }
2902     }
2903     else // just goto the next element in the list
2904     {
2905       sl.insert(sl.at(),result);
2906       sl.next();
2907     }
2908     // remove the old unexpanded string from the list
2909     int i=sl.at();
2910     sl.remove(); // current item index changes if the last element is removed.
2911     if (sl.at()==i)     // not last item
2912         s = sl.current();
2913     else                // just removed last item
2914         s = 0;
2915   }
2916 }
2917
2918 void ConfigString::substEnvVars()
2919 {
2920   substEnvVarsInString(m_value);
2921 }
2922
2923 void ConfigList::substEnvVars()
2924 {
2925   substEnvVarsInStrList(m_value);
2926 }
2927
2928 void ConfigBool::substEnvVars()
2929 {
2930   substEnvVarsInString(m_valueString);
2931 }
2932
2933 void ConfigInt::substEnvVars()
2934 {
2935   substEnvVarsInString(m_valueString);
2936 }
2937
2938 void ConfigEnum::substEnvVars()
2939 {
2940   substEnvVarsInString(m_value);
2941 }
2942
2943 void Config::substituteEnvironmentVars()
2944 {
2945   ConfigOption *option = m_options->first();
2946   while (option)
2947   {
2948     option->substEnvVars();
2949     option = m_options->next();
2950   }
2951 }
2952
2953 static void cleanUpPaths(QStrList &str)
2954 {
2955   char *sfp = str.first();
2956   while (sfp)
2957   {
2958     register char *p = sfp;
2959     if (p)
2960     {
2961       char c;
2962       while ((c=*p))
2963       {
2964         if (c=='\\') *p='/';
2965         p++;
2966       }
2967     }
2968     QCString path = sfp;
2969     if ((path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) ||
2970         path.at(path.length()-1)!='/'
2971        )
2972     {
2973       QFileInfo fi(path);
2974       if (fi.exists() && fi.isDir())
2975       {
2976         int i = str.at();
2977         str.remove();
2978         if (str.at()==i) // did not remove last item
2979           str.insert(i,fi.absFilePath().utf8()+"/");
2980         else
2981           str.append(fi.absFilePath().utf8()+"/");
2982       }
2983     }
2984     sfp = str.next();
2985   }
2986 }
2987
2988 void Config::check()
2989 {
2990   //if (!projectName.isEmpty())
2991   //{
2992   //  projectName[0]=toupper(projectName[0]);
2993   //}
2994
2995   QCString &warnFormat = Config_getString("WARN_FORMAT");
2996   if (warnFormat.stripWhiteSpace().isEmpty())
2997   {
2998     warnFormat="$file:$line $text";
2999   }
3000   else
3001   {
3002     if (warnFormat.find("$file")==-1)
3003     {
3004       config_err("warning: warning format does not contain a $file tag!\n");
3005     }
3006     if (warnFormat.find("$line")==-1)
3007     {
3008       config_err("warning: warning format does not contain a $line tag!\n");
3009     }
3010     if (warnFormat.find("$text")==-1)
3011     {
3012       config_err("warning: warning format foes not contain a $text tag!\n");
3013     }
3014   }
3015
3016   QCString &manExtension = Config_getString("MAN_EXTENSION");
3017   
3018   // set default man page extension if non is given by the user
3019   if (manExtension.isEmpty())
3020   {
3021     manExtension=".3";
3022   }
3023   
3024   QCString &paperType = Config_getEnum("PAPER_TYPE");
3025   paperType=paperType.lower().stripWhiteSpace(); 
3026   if (paperType.isEmpty())
3027   {
3028     paperType = "a4";
3029   }
3030   if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" && 
3031       paperType!="legal" && paperType!="executive")
3032   {
3033     config_err("error: Unknown page type specified");
3034   }
3035   
3036   QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE");
3037   outputLanguage=outputLanguage.stripWhiteSpace();
3038   if (outputLanguage.isEmpty())
3039   {
3040     outputLanguage = "English";
3041   }
3042
3043   QCString &htmlFileExtension=Config_getString("HTML_FILE_EXTENSION");
3044   htmlFileExtension=htmlFileExtension.stripWhiteSpace();
3045   if (htmlFileExtension.isEmpty())
3046   {
3047     htmlFileExtension = ".html";
3048   }
3049   
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
3054   {
3055     stripFromPath.append(QDir::currentDirPath().utf8()+"/");
3056   }
3057   else
3058   {
3059     cleanUpPaths(stripFromPath);
3060   }
3061
3062   // expand the relative stripFromPath values
3063   QStrList &stripFromIncPath = Config_getList("STRIP_FROM_INC_PATH");
3064   cleanUpPaths(stripFromIncPath);
3065   
3066   // Test to see if HTML header is valid
3067   QCString &headerFile = Config_getString("HTML_HEADER");
3068   if (!headerFile.isEmpty())
3069   {
3070     QFileInfo fi(headerFile);
3071     if (!fi.exists())
3072     {
3073       config_err("error: tag HTML_HEADER: header file `%s' "
3074           "does not exist\n",headerFile.data());
3075       exit(1);
3076     }
3077   }
3078   // Test to see if HTML footer is valid
3079   QCString &footerFile = Config_getString("HTML_FOOTER");
3080   if (!footerFile.isEmpty())
3081   {
3082     QFileInfo fi(footerFile);
3083     if (!fi.exists())
3084     {
3085       config_err("error: tag HTML_FOOTER: footer file `%s' "
3086           "does not exist\n",footerFile.data());
3087       exit(1);
3088     }
3089   }
3090   // Test to see if LaTeX header is valid
3091   QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
3092   if (!latexHeaderFile.isEmpty())
3093   {
3094     QFileInfo fi(latexHeaderFile);
3095     if (!fi.exists())
3096     {
3097       config_err("error: tag LATEX_HEADER: header file `%s' "
3098           "does not exist\n",latexHeaderFile.data());
3099       exit(1);
3100     }
3101   }
3102   // check include path
3103   QStrList &includePath = Config_getList("INCLUDE_PATH");
3104   char *s=includePath.first();
3105   while (s)
3106   {
3107     QFileInfo fi(s);
3108     if (!fi.exists()) config_err("warning: tag INCLUDE_PATH: include path `%s' "
3109                           "does not exist\n",s);
3110     s=includePath.next();
3111   }
3112
3113   // check aliases
3114   QStrList &aliasList = Config_getList("ALIASES");
3115   s=aliasList.first();
3116   while (s)
3117   {
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
3120     QCString alias=s;
3121     alias=alias.stripWhiteSpace();
3122     if (alias.find(re1)!=0 && alias.find(re2)!=0)
3123     {
3124       config_err("Illegal alias format `%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
3125           alias.data());
3126     }
3127     s=aliasList.next();
3128   }
3129
3130   // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled
3131   if (Config_getBool("GENERATE_TREEVIEW") && Config_getBool("GENERATE_HTMLHELP"))
3132   {
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;
3135   }
3136   if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTMLHELP"))
3137   {
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;
3140   }
3141
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"))
3144   {
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;
3147   }
3148     
3149   // check dot image format
3150   QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT");
3151   dotImageFormat=dotImageFormat.stripWhiteSpace();
3152   if (dotImageFormat.isEmpty())
3153   {
3154     dotImageFormat = "png";
3155   }
3156   //else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
3157   //{
3158   //  config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
3159   //  dotImageFormat = "png";
3160   //}
3161   
3162   
3163   // check dot path
3164   QCString &dotPath = Config_getString("DOT_PATH");
3165   if (!dotPath.isEmpty())
3166   {
3167     QFileInfo fi(dotPath);
3168     if (fi.exists() && fi.isFile()) // user specified path + exec
3169     {
3170       dotPath=fi.dirPath(TRUE).utf8()+"/";
3171     }
3172     else
3173     {
3174       QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
3175       if (!dp.exists() || !dp.isFile())
3176       {
3177         config_err("warning: the dot tool could not be found at %s\n",dotPath.data());
3178         dotPath="";
3179       }
3180       else
3181       {
3182         dotPath=dp.dirPath(TRUE).utf8()+"/";
3183       }
3184     }
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)='\\';
3188 #endif
3189   }
3190   else // make sure the string is empty but not null!
3191   {
3192     dotPath="";
3193   }
3194
3195   // check mscgen path
3196   QCString &mscgenPath = Config_getString("MSCGEN_PATH");
3197   if (!mscgenPath.isEmpty())
3198   {
3199     QFileInfo dp(mscgenPath+"/mscgen"+portable_commandExtension());
3200     if (!dp.exists() || !dp.isFile())
3201     {
3202       config_err("warning: the mscgen tool could not be found at %s\n",mscgenPath.data());
3203       mscgenPath="";
3204     }
3205     else
3206     {
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)='\\';
3211 #endif
3212     }
3213   }
3214   else // make sure the string is empty but not null!
3215   {
3216     mscgenPath="";
3217   }
3218
3219   
3220   // check input
3221   QStrList &inputSources=Config_getList("INPUT");
3222   if (inputSources.count()==0)
3223   {
3224     // use current dir as the default
3225     inputSources.append(QDir::currentDirPath().utf8());
3226   }
3227   else
3228   {
3229     s=inputSources.first();
3230     while (s)
3231     {
3232       QFileInfo fi(s);
3233       if (!fi.exists())
3234       {
3235         config_err("warning: tag INPUT: input source `%s' does not exist\n",s);
3236       }
3237       s=inputSources.next();
3238     }
3239   }
3240
3241   // add default pattern if needed
3242   QStrList &filePatternList = Config_getList("FILE_PATTERNS");
3243   if (filePatternList.isEmpty())
3244   {
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())
3281     {
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");
3304     }
3305   }
3306
3307   // add default pattern if needed
3308   QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
3309   if (examplePatternList.isEmpty())
3310   {
3311     examplePatternList.append("*");
3312   }
3313
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()
3324      )
3325   {
3326     config_err("warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
3327   }
3328
3329   // check HTMLHELP creation requirements
3330   if (!Config_getBool("GENERATE_HTML") && 
3331       Config_getBool("GENERATE_HTMLHELP"))
3332   {
3333     config_err("warning: GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
3334   }
3335
3336   // check QHP creation requirements
3337   if (Config_getBool("GENERATE_QHP"))
3338   {
3339     if (Config_getString("QHP_NAMESPACE").isEmpty())
3340     {
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";
3343     }
3344
3345     if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty())
3346     {
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";
3349     }
3350   }
3351
3352   if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
3353   {
3354     // don't show inline info for Java output, since Java has no inline 
3355     // concept.
3356     Config_getBool("INLINE_INFO")=FALSE;
3357   }
3358
3359   int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH");
3360   if (depth==0)
3361   {
3362     depth=1000;
3363   }
3364
3365   int &hue = Config_getInt("HTML_COLORSTYLE_HUE");
3366   if (hue<0)
3367   {
3368     hue=0;
3369   }
3370   else if (hue>=360)
3371   {
3372     hue=hue%360;
3373   }
3374
3375   int &sat = Config_getInt("HTML_COLORSTYLE_SAT");
3376   if (sat<0)
3377   {
3378     sat=0;
3379   }
3380   else if (sat>255)
3381   {
3382     sat=255;
3383   }
3384   int &gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
3385   if (gamma<40)
3386   {
3387     gamma=40;
3388   }
3389   else if (gamma>240)
3390   {
3391     gamma=240;
3392   }
3393
3394   
3395   // add default words if needed
3396   QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF");
3397   if (annotationFromBrief.isEmpty())
3398   {
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");
3410   }
3411
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")
3419       )
3420      )
3421   {
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="";
3435
3436
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
3439               );
3440
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;
3447   }                               
3448
3449 }
3450
3451 void Config::init()
3452 {
3453   ConfigOption *option = m_options->first();
3454   while (option)
3455   {
3456     option->init();
3457     option = m_options->next();
3458   }
3459 }
3460
3461 void Config::create()
3462 {
3463   if (m_initialized) return; 
3464   m_initialized = TRUE;
3465   addConfigOptions(this);
3466 }
3467
3468 static QCString configFileToString(const char *name)
3469 {
3470   if (name==0 || name[0]==0) return 0;
3471   QFile f;
3472
3473   bool fileOpened=FALSE;
3474   if (name[0]=='-' && name[1]==0) // read from stdin
3475   {
3476     fileOpened=f.open(IO_ReadOnly,stdin);
3477     if (fileOpened)
3478     {
3479       const int bSize=4096;
3480       QCString contents(bSize);
3481       int totalSize=0;
3482       int size;
3483       while ((size=f.readBlock(contents.data()+totalSize,bSize))==bSize)
3484       {
3485         totalSize+=bSize;
3486         contents.resize(totalSize+bSize); 
3487       }
3488       totalSize+=size+2;
3489       contents.resize(totalSize);
3490       contents.at(totalSize-2)='\n'; // to help the scanner
3491       contents.at(totalSize-1)='\0';
3492       return contents;
3493     }
3494   }
3495   else // read from file
3496   {
3497     QFileInfo fi(name);
3498     if (!fi.exists() || !fi.isFile())
3499     {
3500       config_err("error: file `%s' not found\n",name);
3501       return "";
3502     }
3503     f.setName(name);
3504     fileOpened=f.open(IO_ReadOnly);
3505     if (fileOpened)
3506     {
3507       int fsize=f.size();
3508       QCString contents(fsize+2);
3509       f.readBlock(contents.data(),fsize);
3510       f.close();
3511       if (fsize==0 || contents[fsize-1]=='\n') 
3512         contents[fsize]='\0';
3513       else
3514         contents[fsize]='\n'; // to help the scanner
3515       contents[fsize+1]='\0';
3516       return contents;
3517     }
3518   }
3519   if (!fileOpened)  
3520   {
3521     config_err("error: cannot open file `%s' for reading\n",name);
3522   }
3523   return "";
3524 }
3525
3526 bool Config::parseString(const char *fn,const char *str)
3527 {
3528   config = Config::instance();
3529   inputString   = str;
3530   inputPosition = 0;
3531   yyFileName    = fn;
3532   yyLineNr      = 1;
3533   includeStack.setAutoDelete(TRUE);
3534   includeStack.clear();
3535   includeDepth  = 0;
3536   configYYrestart( configYYin );
3537   BEGIN( Start );
3538   configYYlex();
3539   inputString = 0;
3540   return TRUE;
3541 }
3542
3543 bool Config::parse(const char *fn)
3544 {
3545   encoding = "UTF-8";
3546   return parseString(fn,configFileToString(fn)); 
3547 }
3548
3549 extern "C" { // some bogus code to keep the compiler happy
3550   //int  configYYwrap() { return 1 ; }
3551 }
3552