Fix for UBSan build
[platform/upstream/doxygen.git] / src / commentcnv.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 commentcnvYY_create_buffer
9 #define yy_delete_buffer commentcnvYY_delete_buffer
10 #define yy_flex_debug commentcnvYY_flex_debug
11 #define yy_init_buffer commentcnvYY_init_buffer
12 #define yy_flush_buffer commentcnvYY_flush_buffer
13 #define yy_load_buffer_state commentcnvYY_load_buffer_state
14 #define yy_switch_to_buffer commentcnvYY_switch_to_buffer
15 #define yyin commentcnvYYin
16 #define yyleng commentcnvYYleng
17 #define yylex commentcnvYYlex
18 #define yylineno commentcnvYYlineno
19 #define yyout commentcnvYYout
20 #define yyrestart commentcnvYYrestart
21 #define yytext commentcnvYYtext
22 #define yywrap commentcnvYYwrap
23 #define yyalloc commentcnvYYalloc
24 #define yyrealloc commentcnvYYrealloc
25 #define yyfree commentcnvYYfree
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 commentcnvYYrestart(commentcnvYYin  )
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 262144
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 commentcnvYYleng;
181
182 extern FILE *commentcnvYYin, *commentcnvYYout;
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 commentcnvYYtext. */ \
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 commentcnvYYtext 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 commentcnvYYrestart()), so that the user can continue scanning by
264          * just pointing commentcnvYYin 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 commentcnvYYtext 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 commentcnvYYleng;
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 commentcnvYYwrap()'s to do buffer switches
302  * instead of setting up a fresh commentcnvYYin.  A bit of a hack ...
303  */
304 static int yy_did_buffer_switch_on_eof;
305
306 void commentcnvYYrestart (FILE *input_file  );
307 void commentcnvYY_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
308 YY_BUFFER_STATE commentcnvYY_create_buffer (FILE *file,int size  );
309 void commentcnvYY_delete_buffer (YY_BUFFER_STATE b  );
310 void commentcnvYY_flush_buffer (YY_BUFFER_STATE b  );
311 void commentcnvYYpush_buffer_state (YY_BUFFER_STATE new_buffer  );
312 void commentcnvYYpop_buffer_state (void );
313
314 static void commentcnvYYensure_buffer_stack (void );
315 static void commentcnvYY_load_buffer_state (void );
316 static void commentcnvYY_init_buffer (YY_BUFFER_STATE b,FILE *file  );
317
318 #define YY_FLUSH_BUFFER commentcnvYY_flush_buffer(YY_CURRENT_BUFFER )
319
320 YY_BUFFER_STATE commentcnvYY_scan_buffer (char *base,yy_size_t size  );
321 YY_BUFFER_STATE commentcnvYY_scan_string (yyconst char *yy_str  );
322 YY_BUFFER_STATE commentcnvYY_scan_bytes (yyconst char *bytes,yy_size_t len  );
323
324 void *commentcnvYYalloc (yy_size_t  );
325 void *commentcnvYYrealloc (void *,yy_size_t  );
326 void commentcnvYYfree (void *  );
327
328 #define yy_new_buffer commentcnvYY_create_buffer
329
330 #define yy_set_interactive(is_interactive) \
331         { \
332         if ( ! YY_CURRENT_BUFFER ){ \
333         commentcnvYYensure_buffer_stack (); \
334                 YY_CURRENT_BUFFER_LVALUE =    \
335             commentcnvYY_create_buffer(commentcnvYYin,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         commentcnvYYensure_buffer_stack (); \
344                 YY_CURRENT_BUFFER_LVALUE =    \
345             commentcnvYY_create_buffer(commentcnvYYin,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 commentcnvYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
356
357 typedef unsigned char YY_CHAR;
358
359 FILE *commentcnvYYin = (FILE *) 0, *commentcnvYYout = (FILE *) 0;
360
361 typedef int yy_state_type;
362
363 extern int commentcnvYYlineno;
364
365 int commentcnvYYlineno = 1;
366
367 extern char *commentcnvYYtext;
368 #define yytext_ptr commentcnvYYtext
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 commentcnvYYtext.
377  */
378 #define YY_DO_BEFORE_ACTION \
379         (yytext_ptr) = yy_bp; \
380         commentcnvYYleng = (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 77
386 #define YY_END_OF_BUFFER 78
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_acclist[291] =
395     {   0,
396         1,    1,   36,   36,   24,   24,   24,   24,   63,   63,
397        78,   77,    1,   18,   77,    6,   77,   18,   77,    4,
398        18,   77,   11,   18,   77,    5,   18,   77,   18,   77,
399        18,   77,   18,   77,   30,   77,   31,   77,   29,   30,
400        77,   30,   77,   34,   77,   35,   77,   33,   34,   77,
401        34,   77,   57,   77,   77,   77,   36,   44,   77,   39,
402        77,   44,   77,   44,   77,   37,   44,   77,   44,   77,
403        44,   77,   24,   27,   77,   25,   77,   27,   77,   27,
404        77,   24,   27,   77,   27,   77,   27,   77,   20,   27,
405        77,   21,   27,   77,   24,   27,   77,   27,   77,   76,
406
407        77,   58,   77,   76,   77,   65,   77,   63,   65,   77,
408        62,   65,   77,   70,   75,   77,   72,   77,   75,   77,
409        71,   75,   77,   73,   75,   77,   74,   75,   77,   70,
410        75,   77,   70,   75,   77,    1,    3,   13,   11,   10,
411        28,   32,   36,   41,   42,   43,   41,   42,   43,   41,
412        42,   42,   43,   41,   43,   37,   37,   40,   66,   66,
413        66,   66,   66,   66,   66,   66,   66,   66,   66,   24,
414        24,   24,   23,   58,   63,   62,   70,   69,   70,   70,
415        70,   12,   10,    9,16391,   49,   38,   59,   66,   67,
416        66,   66,   66,   16,   16,   67,   66,   66,   66,   66,
417
418        66,   66,   66,   19,   26,   23,   70,16452,    2,16391,
419         9,   52,16435,16434,16439,16431,   45,   59,   59,   66,
420        66,   66,   66,   16,   66,   66,   66,   66,   66,   66,
421      8260,   70, 8260,16438,16437,16440,16432,   46, 8243, 8242,
422      8247, 8239,   66,   15,   15,   67,   66,   66,   66,   66,
423        66,   66,   66, 8246, 8245, 8248, 8240,   60,   64,   66,
424        66,   66,   66,   66,   66,   66,   66,   66,   66,   66,
425        66,   66,   66,   14,   22, 8199,   66,   66,   66,   66,
426        66,   61,   61,   67,   66,   17,   17,   67,    8,    9
427     } ;
428
429 static yyconst flex_int16_t yy_accept[330] =
430     {   0,
431         1,    1,    1,    2,    3,    3,    3,    3,    3,    3,
432         3,    4,    5,    6,    7,    8,    9,    9,    9,   10,
433        11,   11,   11,   12,   13,   16,   18,   20,   23,   26,
434        29,   31,   33,   35,   37,   39,   42,   44,   46,   48,
435        51,   53,   55,   56,   57,   60,   62,   64,   66,   69,
436        71,   73,   76,   78,   80,   82,   85,   87,   89,   92,
437        95,   98,  100,  102,  104,  106,  108,  111,  114,  117,
438       119,  121,  124,  127,  130,  133,  136,  137,  139,  139,
439       140,  140,  141,  141,  142,  143,  143,  143,  143,  143,
440       143,  144,  147,  150,  152,  154,  156,  156,  157,  158,
441
442       159,  159,  160,  161,  162,  163,  164,  165,  166,  167,
443       168,  169,  170,  170,  171,  171,  171,  172,  172,  172,
444       172,  173,  173,  174,  174,  175,  176,  177,  178,  179,
445       180,  181,  182,  182,  183,  184,  184,  185,  186,  186,
446       186,  187,  187,  187,  188,  189,  190,  191,  192,  193,
447       194,  195,  197,  198,  199,  200,  201,  202,  203,  204,
448       204,  204,  205,  206,  206,  207,  209,  210,  211,  212,
449       212,  213,  213,  213,  214,  215,  216,  217,  218,  218,
450       219,  220,  221,  222,  223,  224,  225,  226,  227,  228,
451       229,  230,  231,  231,  231,  231,  233,  234,  234,  234,
452
453       234,  235,  236,  237,  238,  239,  239,  239,  240,  240,
454       241,  241,  242,  242,  243,  244,  245,  247,  248,  249,
455       250,  251,  252,  253,  254,  254,  254,  254,  254,  254,
456       254,  254,  254,  254,  254,  254,  254,  254,  255,  255,
457       256,  256,  257,  257,  258,  259,  260,  260,  261,  262,
458       263,  264,  265,  266,  267,  267,  267,  267,  267,  267,
459       267,  267,  267,  267,  267,  267,  267,  268,  269,  270,
460       271,  272,  273,  274,  275,  275,  275,  275,  275,  275,
461       275,  275,  276,  277,  277,  278,  279,  280,  281,  282,
462       282,  282,  282,  282,  282,  282,  282,  283,  285,  286,
463
464       287,  289,  289,  289,  289,  289,  289,  289,  289,  289,
465       289,  289,  289,  289,  289,  289,  289,  289,  289,  289,
466       289,  289,  289,  289,  289,  289,  289,  291,  291
467     } ;
468
469 static yyconst flex_int32_t yy_ec[256] =
470     {   0,
471         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
472         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
473         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
474         1,    2,    5,    6,    7,    8,    1,    1,    9,    1,
475         1,   10,    1,    1,   11,   12,   13,   14,   14,   14,
476        14,   14,   14,   14,   14,   14,   14,    1,    1,   15,
477         1,   16,    1,   17,   18,   18,   18,   19,   18,   18,
478        18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
479        18,   18,   18,   18,   18,   18,   18,   18,   18,   18,
480        20,   21,   22,    1,   18,    1,   23,   24,   25,   26,
481
482        27,   28,   29,   30,   31,   29,   29,   32,   33,   34,
483        35,   29,   29,   36,   37,   38,   39,   40,   29,   41,
484        42,   29,   43,    1,   44,   45,    1,    1,    1,    1,
485         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
486         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
487         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
488         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
489         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
490         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
491         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
492
493         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
494         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
495         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
496         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
497         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
498         1,    1,    1,    1,    1
499     } ;
500
501 static yyconst flex_int32_t yy_meta[46] =
502     {   0,
503         1,    2,    3,    1,    4,    5,    6,    1,    6,    7,
504         8,    9,   10,   11,    1,    1,   12,   13,   13,    1,
505        14,    1,   15,   15,   15,   15,   15,   15,   15,   15,
506        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
507        15,   15,   16,   17,   18
508     } ;
509
510 static yyconst flex_int16_t yy_base[369] =
511     {   0,
512         0,    0,    0,   19,   12,   13,   14,   28, 1185,   39,
513        50,   91,   26,  133,   33,  176,   41,   42,  220,    0,
514        62,  264, 1187, 1189,    0, 1189, 1170, 1179, 1177, 1189,
515      1172,   38, 1189, 1189, 1189, 1189,    0, 1189, 1189, 1189,
516         0,   25,   55, 1169,    0,   73, 1189, 1175,   51,  292,
517      1163,    0, 1189, 1189,   46,   77, 1166, 1151, 1189, 1189,
518        79, 1164, 1173, 1189,    0, 1189, 1173,    0,    0, 1189,
519      1161, 1189, 1189, 1189,   85, 1160,    0, 1189, 1166, 1189,
520      1166,   81,    7, 1189, 1189,   86, 1157,   87, 1156,   97,
521         0, 1189,  109, 1189, 1189, 1189, 1162,   72,  105, 1189,
522
523         0, 1124,   60,   74,   79,   99,   83,  100,  101,   87,
524       102,   94, 1141,    0, 1131,  125,  126, 1151, 1150, 1128,
525       138, 1148,  136, 1157, 1189, 1157,    0,    0, 1189,  146,
526      1119,  147, 1030, 1189, 1189,  924, 1189,  906,    1,  148,
527       890,  896,  153, 1189,  899,  857, 1189,  131,  120,  138,
528      1189,    0,  129,  130,  137,  142,  147,  148,  151,  864,
529       872, 1189, 1189,  871, 1189,  258, 1189,  893,  185,  167,
530       880,  887,  179,  833,  831,  828,  827, 1189,  192,  826,
531       805,  161,  170,  334,  174,    0,  168,  175,  166,  171,
532       245,  172,  780,  240,  257,  338,    0,  273,  791,  268,
533
534       794,  790,  786,  784, 1189,  281,  782, 1189,  775, 1189,
535       773, 1189,  760, 1189,  358, 1189, 1189,  173,  252,  169,
536       255,  257,  269,  262,  735,  722,  735,  733,  711,  717,
537       709,  705,  698,  694,  301,  349,  705, 1189,  703, 1189,
538       701, 1189,  696, 1189,  361, 1189,  364,  337,  341,  348,
539       261,  326,  347,  344,  129,  664,  658,  661,  649,  623,
540       620,  622,  608,  619,    0,  350,  360,  356,  359,  330,
541       352,  361,  354, 1189,  611,  615,  606,  456,  466,  454,
542       460, 1189, 1189,  367,  404,  380,  386,  449,  394,  451,
543       444,  450,  449,  459,  447,  436, 1189, 1189,  388, 1189,
544
545      1189,  446,  444,  446,  445,  437,  414,  433,  411,  407,
546       398,  393,  403,  390,  395,  386,  325,  266,  465,  255,
547       435,  441,  439,  442,  275,  200, 1189, 1189,  494,  512,
548       530,  548,  566,  584,  602,  620,  638,  656,  674,  692,
549       710,  728,  746,  764,  775,  790,  808,  814,  822,  838,
550       856,  874,  891,   51,  906,  924,  942,  960,  978,  996,
551      1014, 1032, 1050, 1068, 1086, 1104, 1122, 1140
552     } ;
553
554 static yyconst flex_int16_t yy_def[369] =
555     {   0,
556       329,  329,  330,  330,  331,  331,  332,  332,  329,  329,
557       333,  333,  334,  334,  334,  334,  335,  335,  328,   19,
558       336,  336,  328,  328,  337,  328,  328,  328,  328,  328,
559       328,  328,  328,  328,  328,  328,  338,  328,  328,  328,
560       339,  328,  328,  328,  340,  341,  328,  328,  342,  328,
561       328,  343,  328,  328,  328,  343,  328,  328,  328,  328,
562       343,  328,  344,  328,   50,  328,  328,  345,  346,  328,
563       328,  328,  328,  328,  346,  346,  337,  328,  328,  328,
564       328,  328,  347,  328,  328,  328,  328,  328,  328,  328,
565       340,  328,  341,  328,  328,  328,  328,  342,  342,  328,
566
567       348,  349,  349,  349,  349,  349,  349,  349,  349,  349,
568       349,  349,  328,  343,  328,  328,  343,  328,  328,  328,
569       343,  328,  328,  344,  328,  328,  345,  346,  328,  346,
570       346,  346,  328,  328,  328,  347,  328,  350,  347,  328,
571       351,  328,  352,  328,  353,  349,  328,  349,  349,  349,
572       328,  354,  349,  349,  349,  349,  349,  349,  349,  328,
573       328,  328,  328,  328,  328,  355,  328,  350,  328,  347,
574       356,  328,  357,  358,  359,  360,  361,  328,  328,  328,
575       353,  349,  349,  349,  349,  354,  349,  349,  349,  349,
576       349,  349,  328,  328,  328,  355,  362,  328,  328,  347,
577
578       363,  364,  365,  366,  328,  328,  358,  328,  359,  328,
579       360,  328,  361,  328,  349,  328,  328,  349,  349,  349,
580       349,  349,  349,  349,  328,  328,  328,  328,  328,  328,
581       328,  328,  328,  328,  328,  347,  363,  328,  364,  328,
582       365,  328,  366,  328,  328,  328,  328,  349,  349,  349,
583       349,  349,  349,  349,  328,  328,  328,  328,  328,  328,
584       328,  328,  328,  328,  367,  347,  349,  349,  349,  349,
585       349,  349,  349,  328,  328,  328,  328,  328,  328,  328,
586       328,  328,  328,  347,  349,  349,  349,  349,  349,  328,
587       328,  328,  328,  328,  328,  347,  328,  328,  349,  328,
588
589       328,  328,  328,  328,  328,  328,  328,  347,  328,  328,
590       328,  328,  328,  328,  347,  328,  328,  328,  347,  328,
591       347,  347,  347,  347,  368,  368,  328,    0,  328,  328,
592       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
593       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
594       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
595       328,  328,  328,  328,  328,  328,  328,  328
596     } ;
597
598 static yyconst flex_int16_t yy_nxt[1235] =
599     {   0,
600       328,  328,   26,  137,   27,   28,   29,  170,   30,  137,
601        31,  138,   32,  139,   35,   35,   39,   36,   36,  138,
602        33,   26,   40,   27,   28,   29,   86,   30,   53,   31,
603        39,   32,   37,   37,   41,   53,   40,   87,   54,   33,
604        43,   42,   55,   64,   64,   54,   55,   82,   41,   58,
605        83,   44,   46,   58,   47,   48,   88,   65,   65,   49,
606        99,   65,   65,  100,   70,  186,   50,   89,   54,   54,
607        50,   71,  115,  116,   93,   59,   60,   94,  117,   95,
608       121,  328,   72,   96,  328,  135,  130,   86,   88,  118,
609       135,  122,   51,   46,  148,   47,   48,  131,   87,   89,
610
611        49,  141,  147,  142,   73,   74,  151,   50,  149,  143,
612        93,   50,  150,   94,   99,   95,  147,  100,  151,   96,
613       153,  147,  154,  155,  157,  147,  159,  117,  158,  147,
614       274,  274,  162,   51,   56,   53,  147,  156,  118,  121,
615       165,  152,  147,  147,  147,   57,  162,  130,  165,   55,
616       122,  166,  171,   55,  172,  178,  182,  184,  131,  166,
617       173,  187,  147,  185,  183,  179,  184,  188,  162,  137,
618       189,  147,  147,  147,  190,   54,   54,   61,   53,  147,
619       147,  205,  192,  191,  147,  200,  198,  184,   62,  147,
620       147,  206,   58,  147,  178,  215,   58,  199,  218,  219,
621
622       221,  220,  327,  147,  179,  222,  224,  248,  147,  250,
623       147,  147,  147,  147,  147,  147,  147,  147,   59,   60,
624        66,   67,   24,   66,   66,   66,   66,   66,   66,   66,
625        66,   66,   66,   66,   66,   66,   66,   68,   68,   66,
626        66,   66,   68,   68,   68,   68,   68,   68,   68,   68,
627        68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
628        68,   68,   66,   66,   66,   75,   70,  197,  223,  226,
629       137,  227,  228,   71,  198,  229,   76,  327,  197,  230,
630       231,  232,  233,  205,   72,  199,  249,  147,  251,  234,
631       252,  253,  270,  206,  147,  254,  162,  147,  162,  147,
632
633       197,  197,  236,  147,  147,  265,   73,   74,  101,  102,
634       102,  147,  101,  265,  102,  102,  103,  104,  105,  106,
635       102,  107,  102,  108,  109,  102,  102,  110,  102,  102,
636       102,  111,  112,  102,  216,  216,  216,  216,  216,  216,
637       216,  216,  216,  216,  216,  216,  216,  197,  216,  216,
638       216,  137,  137,  216,  216,  216,  320,  271,  197,  245,
639       246,  247,  245,  246,  247,  247,  246,  247,  147,  137,
640       267,  288,  147,  266,  268,  273,  217,  216,  216,  147,
641       197,  197,  269,  147,  272,  285,  147,  286,  284,  147,
642       147,  289,  287,  288,  147,  288,  147,  137,  147,  296,
643
644       147,  147,  147,  147,  297,  297,  297,  297,  297,  297,
645       297,  297,  297,  297,  297,  297,  297,  299,  297,  297,
646       297,  288,  147,  297,  297,  297,  288,  162,  147,  288,
647       147,  162,  319,  318,  162,  137,  147,  137,  137,  162,
648       317,  137,  316,  137,  137,  314,  298,  297,  297,  300,
649       300,  300,  300,  300,  300,  300,  300,  300,  300,  300,
650       300,  300,  308,  300,  300,  300,  315,  137,  300,  300,
651       300,  323,  322,  324,  313,  325,  312,  311,  310,  309,
652       307,  306,  305,  304,  303,  302,  282,  321,  295,  294,
653       293,  301,  300,  300,   24,   24,   24,   24,   24,   24,
654
655        24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
656        24,   24,   25,   25,   25,   25,   25,   25,   25,   25,
657        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
658        34,   34,   34,   34,   34,   34,   34,   34,   34,   34,
659        34,   34,   34,   34,   34,   34,   34,   34,   38,   38,
660        38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
661        38,   38,   38,   38,   38,   38,   45,   45,   45,   45,
662        45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
663        45,   45,   45,   45,   52,   52,   52,   52,   52,   52,
664        52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
665
666        52,   52,   63,   63,   63,   63,   63,   63,   63,   63,
667        63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
668        69,   69,   69,   69,   69,   69,   69,   69,   69,   69,
669        69,   69,   69,   69,   69,   69,   69,   69,   77,   77,
670       292,  291,  290,  282,   77,  282,   77,  281,   77,   77,
671        77,  280,   77,   77,   77,   77,   84,   84,  279,   84,
672        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
673        84,   84,   84,   84,   85,   85,  278,   85,   85,   85,
674        85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
675        85,   85,   91,   91,  277,  276,  275,   91,  244,   91,
676
677        91,   91,   91,  242,   91,  240,   91,  238,   91,   91,
678        92,   92,   92,   92,   92,   92,   92,   92,   92,   92,
679        92,   92,   92,   92,   92,   92,   92,   92,   98,   98,
680       264,   98,  263,   98,   98,   98,   98,   98,   98,  262,
681        98,  261,   98,  260,   98,   98,  114,  114,  259,  114,
682       114,  114,  114,  114,  114,  258,  114,  257,  114,  256,
683       114,  255,  214,  114,  124,  124,  124,  124,  124,  124,
684       124,  124,  124,  124,  124,  212,  124,  210,  124,  124,
685       124,  124,  127,  127,  208,  127,  244,  127,  242,  127,
686       128,  128,  240,  128,  128,  128,  238,  128,  128,  128,
687
688       128,  128,  128,  235,  128,  225,  180,  128,  136,  136,
689       136,  136,  136,  136,  136,  136,  136,  136,  136,  136,
690       136,  136,  136,  136,  136,  136,  145,  180,  145,  214,
691       212,  145,  146,  210,  146,  208,  146,  146,  168,  168,
692       168,  168,  168,  168,  168,  168,  168,  168,  168,  168,
693       168,  168,  168,  168,  168,  168,  174,  174,  174,  174,
694       174,  174,  174,  174,  174,  174,  174,  174,  174,  174,
695       174,  174,  174,  174,  177,  177,  177,  177,  177,  177,
696       177,  177,  177,  177,  177,  177,  177,  177,  177,  177,
697       177,  177,  181,  203,  202,  169,  195,  194,  193,  147,
698
699       180,  181,  176,  181,  175,  181,  196,  196,  169,  196,
700       196,  196,  196,  196,  196,  196,  196,  196,  196,  196,
701       196,  196,  196,  196,  201,  201,  137,  201,  201,  201,
702       201,  201,  201,  201,  201,  201,  201,  201,  201,  201,
703       201,  201,  204,  204,  204,  204,  204,  204,  204,  204,
704       204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
705       207,  207,  207,  207,  207,  207,  207,  207,  207,  207,
706       207,  207,  207,  207,  207,  207,  207,  207,  209,  209,
707       209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
708       209,  209,  209,  209,  209,  209,  211,  211,  211,  211,
709
710       211,  211,  211,  211,  211,  211,  211,  211,  211,  211,
711       211,  211,  211,  211,  213,  213,  213,  213,  213,  213,
712       213,  213,  213,  213,  213,  213,  213,  213,  213,  213,
713       213,  213,  197,  197,  167,  197,  197,  197,  197,  197,
714       197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
715       237,  237,  237,  237,  237,  237,  237,  237,  237,  237,
716       237,  237,  237,  237,  237,  237,  237,  237,  239,  239,
717       239,  239,  239,  239,  239,  239,  239,  239,  239,  239,
718       239,  239,  239,  239,  239,  239,  241,  241,  241,  241,
719       241,  241,  241,  241,  241,  241,  241,  241,  241,  241,
720
721       241,  241,  241,  241,  243,  243,  243,  243,  243,  243,
722       243,  243,  243,  243,  243,  243,  243,  243,  243,  243,
723       243,  243,  283,  283,  283,  283,  283,  283,  283,  283,
724       283,  132,  283,  283,  283,  283,  283,  283,  283,  283,
725       326,  326,  326,  326,  326,  326,  326,  326,  326,  326,
726       326,  326,  326,  326,  326,  326,  326,  326,  126,  125,
727       123,  164,  163,  119,  161,  160,  147,  144,   90,  140,
728       134,  133,  132,  129,  126,  125,  123,  120,  119,  113,
729        97,   90,   81,   80,   79,   78,  328,   42,   23,  328,
730       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
731
732       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
733       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
734       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
735       328,  328,  328,  328
736     } ;
737
738 static yyconst flex_int16_t yy_chk[1235] =
739     {   0,
740         0,    0,    3,  139,    3,    3,    3,  139,    3,   83,
741         3,   83,    3,   83,    5,    6,    7,    5,    6,   83,
742         3,    4,    7,    4,    4,    4,   42,    4,   13,    4,
743         8,    4,    5,    6,    7,   15,    8,   42,   13,    4,
744        10,   10,   13,   17,   18,   15,   13,   32,    8,   15,
745        32,   10,   11,   15,   11,   11,   43,   17,   18,   11,
746        49,   17,   18,   49,   21,  354,   11,   43,   13,   13,
747        11,   21,   55,   55,   46,   15,   15,   46,   56,   46,
748        61,   98,   21,   46,   98,   82,   75,   86,   88,   56,
749        82,   61,   11,   12,  103,   12,   12,   75,   86,   88,
750
751        12,   90,  103,   90,   21,   21,  106,   12,  104,   90,
752        93,   12,  105,   93,   99,   93,  104,   99,  106,   93,
753       107,  105,  108,  109,  110,  107,  112,  117,  111,  110,
754       255,  255,  116,   12,   14,   14,  112,  109,  117,  121,
755       123,  106,  108,  109,  111,   14,  116,  130,  123,   14,
756       121,  132,  140,   14,  140,  143,  148,  149,  130,  132,
757       140,  153,  149,  150,  148,  143,  156,  154,  116,  170,
758       155,  153,  154,  148,  157,   14,   14,   16,   16,  155,
759       150,  173,  159,  158,  156,  170,  169,  182,   16,  157,
760       158,  173,   16,  159,  179,  183,   16,  169,  185,  187,
761
762       189,  188,  326,  182,  179,  190,  192,  218,  189,  220,
763       187,  220,  183,  190,  192,  218,  185,  188,   16,   16,
764        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
765        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
766        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
767        19,   19,   19,   19,   19,   19,   19,   19,   19,   19,
768        19,   19,   19,   19,   19,   22,   22,  166,  191,  194,
769       200,  194,  194,   22,  198,  194,   22,  325,  166,  194,
770       194,  195,  195,  206,   22,  198,  219,  191,  221,  195,
771       222,  223,  251,  206,  219,  224,  320,  221,  318,  222,
772
773       166,  166,  200,  251,  224,  235,   22,   22,   50,   50,
774        50,  223,   50,  235,   50,   50,   50,   50,   50,   50,
775        50,   50,   50,   50,   50,   50,   50,   50,   50,   50,
776        50,   50,   50,   50,  184,  184,  184,  184,  184,  184,
777       184,  184,  184,  184,  184,  184,  184,  196,  184,  184,
778       184,  236,  266,  184,  184,  184,  317,  252,  196,  215,
779       215,  215,  245,  245,  245,  247,  247,  247,  252,  284,
780       248,  270,  270,  236,  249,  254,  184,  184,  184,  248,
781       196,  196,  250,  249,  253,  267,  254,  268,  266,  253,
782       250,  272,  269,  271,  271,  273,  273,  315,  268,  284,
783
784       215,  269,  267,  272,  285,  285,  285,  285,  285,  285,
785       285,  285,  285,  285,  285,  285,  285,  287,  285,  285,
786       285,  286,  286,  285,  285,  285,  289,  316,  287,  299,
787       299,  314,  315,  313,  312,  308,  289,  321,  296,  311,
788       310,  323,  309,  322,  324,  307,  285,  285,  285,  288,
789       288,  288,  288,  288,  288,  288,  288,  288,  288,  288,
790       288,  288,  296,  288,  288,  288,  308,  319,  288,  288,
791       288,  322,  321,  323,  306,  324,  305,  304,  303,  302,
792       295,  294,  293,  292,  291,  290,  281,  319,  280,  279,
793       278,  288,  288,  288,  329,  329,  329,  329,  329,  329,
794
795       329,  329,  329,  329,  329,  329,  329,  329,  329,  329,
796       329,  329,  330,  330,  330,  330,  330,  330,  330,  330,
797       330,  330,  330,  330,  330,  330,  330,  330,  330,  330,
798       331,  331,  331,  331,  331,  331,  331,  331,  331,  331,
799       331,  331,  331,  331,  331,  331,  331,  331,  332,  332,
800       332,  332,  332,  332,  332,  332,  332,  332,  332,  332,
801       332,  332,  332,  332,  332,  332,  333,  333,  333,  333,
802       333,  333,  333,  333,  333,  333,  333,  333,  333,  333,
803       333,  333,  333,  333,  334,  334,  334,  334,  334,  334,
804       334,  334,  334,  334,  334,  334,  334,  334,  334,  334,
805
806       334,  334,  335,  335,  335,  335,  335,  335,  335,  335,
807       335,  335,  335,  335,  335,  335,  335,  335,  335,  335,
808       336,  336,  336,  336,  336,  336,  336,  336,  336,  336,
809       336,  336,  336,  336,  336,  336,  336,  336,  337,  337,
810       277,  276,  275,  264,  337,  263,  337,  262,  337,  337,
811       337,  261,  337,  337,  337,  337,  338,  338,  260,  338,
812       338,  338,  338,  338,  338,  338,  338,  338,  338,  338,
813       338,  338,  338,  338,  339,  339,  259,  339,  339,  339,
814       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
815       339,  339,  340,  340,  258,  257,  256,  340,  243,  340,
816
817       340,  340,  340,  241,  340,  239,  340,  237,  340,  340,
818       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
819       341,  341,  341,  341,  341,  341,  341,  341,  342,  342,
820       234,  342,  233,  342,  342,  342,  342,  342,  342,  232,
821       342,  231,  342,  230,  342,  342,  343,  343,  229,  343,
822       343,  343,  343,  343,  343,  228,  343,  227,  343,  226,
823       343,  225,  213,  343,  344,  344,  344,  344,  344,  344,
824       344,  344,  344,  344,  344,  211,  344,  209,  344,  344,
825       344,  344,  345,  345,  207,  345,  204,  345,  203,  345,
826       346,  346,  202,  346,  346,  346,  201,  346,  346,  346,
827
828       346,  346,  346,  199,  346,  193,  181,  346,  347,  347,
829       347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
830       347,  347,  347,  347,  347,  347,  348,  180,  348,  177,
831       176,  348,  349,  175,  349,  174,  349,  349,  350,  350,
832       350,  350,  350,  350,  350,  350,  350,  350,  350,  350,
833       350,  350,  350,  350,  350,  350,  351,  351,  351,  351,
834       351,  351,  351,  351,  351,  351,  351,  351,  351,  351,
835       351,  351,  351,  351,  352,  352,  352,  352,  352,  352,
836       352,  352,  352,  352,  352,  352,  352,  352,  352,  352,
837       352,  352,  353,  172,  171,  168,  164,  161,  160,  146,
838
839       145,  353,  142,  353,  141,  353,  355,  355,  138,  355,
840       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
841       355,  355,  355,  355,  356,  356,  136,  356,  356,  356,
842       356,  356,  356,  356,  356,  356,  356,  356,  356,  356,
843       356,  356,  357,  357,  357,  357,  357,  357,  357,  357,
844       357,  357,  357,  357,  357,  357,  357,  357,  357,  357,
845       358,  358,  358,  358,  358,  358,  358,  358,  358,  358,
846       358,  358,  358,  358,  358,  358,  358,  358,  359,  359,
847       359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
848       359,  359,  359,  359,  359,  359,  360,  360,  360,  360,
849
850       360,  360,  360,  360,  360,  360,  360,  360,  360,  360,
851       360,  360,  360,  360,  361,  361,  361,  361,  361,  361,
852       361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
853       361,  361,  362,  362,  133,  362,  362,  362,  362,  362,
854       362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
855       363,  363,  363,  363,  363,  363,  363,  363,  363,  363,
856       363,  363,  363,  363,  363,  363,  363,  363,  364,  364,
857       364,  364,  364,  364,  364,  364,  364,  364,  364,  364,
858       364,  364,  364,  364,  364,  364,  365,  365,  365,  365,
859       365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
860
861       365,  365,  365,  365,  366,  366,  366,  366,  366,  366,
862       366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
863       366,  366,  367,  367,  367,  367,  367,  367,  367,  367,
864       367,  131,  367,  367,  367,  367,  367,  367,  367,  367,
865       368,  368,  368,  368,  368,  368,  368,  368,  368,  368,
866       368,  368,  368,  368,  368,  368,  368,  368,  126,  124,
867       122,  120,  119,  118,  115,  113,  102,   97,   89,   87,
868        81,   79,   76,   71,   67,   63,   62,   58,   57,   51,
869        48,   44,   31,   29,   28,   27,   23,    9,  328,  328,
870       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
871
872       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
873       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
874       328,  328,  328,  328,  328,  328,  328,  328,  328,  328,
875       328,  328,  328,  328
876     } ;
877
878 extern int commentcnvYY_flex_debug;
879 int commentcnvYY_flex_debug = 0;
880
881 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
882 static char *yy_full_match;
883 static int yy_lp;
884 static int yy_looking_for_trail_begin = 0;
885 static int yy_full_lp;
886 static int *yy_full_state;
887 #define YY_TRAILING_MASK 0x2000
888 #define YY_TRAILING_HEAD_MASK 0x4000
889 #define REJECT \
890 { \
891 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */ \
892 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
893 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
894 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
895 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
896 ++(yy_lp); \
897 goto find_rule; \
898 }
899
900 #define yymore() yymore_used_but_not_detected
901 #define YY_MORE_ADJ 0
902 #define YY_RESTORE_YY_MORE_OFFSET
903 char *commentcnvYYtext;
904 #line 1 "commentcnv.l"
905 /*****************************************************************************
906  *
907  * $Id: commentcnv.l,v 1.80 2001/03/19 19:27:41 root Exp $
908  *
909  * Copyright (C) 1997-2012 by Dimitri van Heesch.
910  *
911  * Permission to use, copy, modify, and distribute this software and its
912  * documentation under the terms of the GNU General Public License is hereby 
913  * granted. No representations are made about the suitability of this software 
914  * for any purpose. It is provided "as is" without express or implied warranty.
915  * See the GNU General Public License for more details.
916  *
917  * Documents produced by Doxygen are derivative works derived from the
918  * input used in their production; they are not affected by this license.
919  *
920  */
921 #line 19 "commentcnv.l"
922
923 #define YY_NEVER_INTERACTIVE 1
924   
925 #include <stdio.h>
926 #include <stdlib.h>
927
928 #include <qstack.h>
929 #include <qregexp.h>
930 #include <qtextstream.h>
931 #include <qglobal.h>
932
933 #include "bufstr.h"
934 #include "debug.h"
935 #include "message.h"
936 #include "config.h"
937 #include "doxygen.h"
938 #include "util.h"
939
940 #include <assert.h>
941
942 #define YY_NO_INPUT 1
943
944 #define ADDCHAR(c)    g_outBuf->addChar(c)
945 #define ADDARRAY(a,s) g_outBuf->addArray(a,s)
946   
947 struct CondCtx
948 {
949   CondCtx(int line,QCString id,bool b) 
950     : lineNr(line),sectionId(id), skip(b) {}
951   int lineNr;
952   QCString sectionId;
953   bool skip;
954 };
955   
956 static BufStr * g_inBuf;
957 static BufStr * g_outBuf;
958 static int      g_inBufPos;
959 static int      g_col;
960 static int      g_blockHeadCol;
961 static bool     g_mlBrief;
962 static int      g_readLineCtx;
963 static bool     g_skip;
964 static QCString g_fileName;
965 static int      g_lineNr;
966 static int      g_condCtx;
967 static QStack<CondCtx> g_condStack;
968 static QCString g_blockName;
969 static int      g_lastCommentContext;
970 static bool     g_inSpecialComment;
971 static bool     g_inRoseComment;
972 static int      g_stringContext;
973 static int      g_charContext;
974 static int      g_javaBlock;
975 static bool     g_specialComment;
976
977 static QCString g_aliasString;
978 static int      g_blockCount;
979 static bool     g_lastEscaped;
980 static int      g_lastBlockContext;
981 static bool     g_pythonDocString;
982
983
984 static SrcLangExt g_lang;
985
986 static void replaceCommentMarker(const char *s,int len)
987 {
988   const char *p=s;
989   char c;
990   // copy leading blanks
991   while ((c=*p) && (c==' ' || c=='\t' || c=='\n')) 
992   {
993     ADDCHAR(c);
994     g_lineNr += c=='\n';
995     p++;
996   }
997   // replace start of comment marker by blanks and the last character by a *
998   int blanks=0;
999   while ((c=*p) && (c=='/' || c=='!' || c=='#')) 
1000   {
1001     blanks++;
1002     p++;
1003     if (*p=='<') // comment-after-item marker 
1004     { 
1005       blanks++;
1006       p++; 
1007     }
1008     if (c=='!') // end after first !
1009     {
1010       break;
1011     }
1012   }
1013   if (blanks>0)
1014   {
1015     while (blanks>2)
1016     {
1017       ADDCHAR(' ');
1018       blanks--;
1019     }
1020     if (blanks>1) ADDCHAR('*');
1021     ADDCHAR(' ');
1022   }
1023   // copy comment line to output
1024   ADDARRAY(p,len-(p-s));
1025 }
1026
1027 static inline int computeIndent(const char *s)
1028 {
1029   int col=0;
1030   static int tabSize=Config_getInt("TAB_SIZE");
1031   const char *p=s;
1032   char c;
1033   while ((c=*p++))
1034   {
1035     if (c==' ') col++;
1036     else if (c=='\t') col+=tabSize-(col%tabSize); 
1037     else break;
1038   }
1039   return col;
1040 }
1041
1042 static inline void copyToOutput(const char *s,int len)
1043 {
1044   int i;
1045   if (g_skip) // only add newlines.
1046   {
1047     for (i=0;i<len;i++) 
1048     {
1049       if (s[i]=='\n') 
1050       {
1051         ADDCHAR('\n');
1052         //fprintf(stderr,"---> skip %d\n",g_lineNr);
1053         g_lineNr++;
1054       }
1055     }
1056   }
1057   else if (len>0)
1058   {
1059     ADDARRAY(s,len);
1060     static int tabSize=Config_getInt("TAB_SIZE");
1061     for (i=0;i<len;i++) 
1062     {
1063       switch (s[i])
1064       {
1065         case '\n': g_col=0; 
1066                    //fprintf(stderr,"---> copy %d\n",g_lineNr);
1067                    g_lineNr++; break;
1068         case '\t': g_col+=tabSize-(g_col%tabSize); break;
1069         default:   g_col++; break;
1070       }
1071     }
1072   }
1073 }
1074
1075 static void startCondSection(const char *sectId)
1076 {
1077   g_condStack.push(new CondCtx(g_lineNr,sectId,g_skip));
1078   if (Config_getList("ENABLED_SECTIONS").find(sectId)!=-1)
1079   {
1080     //printf("*** Section is enabled!\n");
1081   }
1082   else
1083   {
1084     //printf("*** Section is disabled!\n");
1085     g_skip=TRUE;
1086   }
1087 }
1088
1089 static void endCondSection()
1090 {
1091   if (g_condStack.isEmpty())
1092   {
1093     warn(g_fileName,g_lineNr,"Found \\endcond command without matching \\cond");
1094     g_skip=FALSE;
1095   }
1096   else
1097   {
1098     CondCtx *ctx = g_condStack.pop();
1099     g_skip=ctx->skip;
1100   }
1101 }
1102
1103 /** copies string \a s with length \a len to the output, while 
1104  *  replacing any alias commands found in the string.
1105  */
1106 static void replaceAliases(const char *s)
1107 {
1108   QCString result = resolveAliasCmd(s);
1109   //printf("replaceAliases(%s)->'%s'\n",s,result.data());
1110   copyToOutput(result,result.length());
1111 }
1112
1113
1114 #undef  YY_INPUT
1115 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1116
1117 static int yyread(char *buf,int max_size)
1118 {
1119   int bytesInBuf = g_inBuf->curPos()-g_inBufPos;
1120   int bytesToCopy = QMIN(max_size,bytesInBuf);
1121   memcpy(buf,g_inBuf->data()+g_inBufPos,bytesToCopy);
1122   g_inBufPos+=bytesToCopy;
1123   return bytesToCopy;
1124 }
1125
1126 void replaceComment(int offset);
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138 #line 1139 "<stdout>"
1139
1140 #define INITIAL 0
1141 #define Scan 1
1142 #define SkipString 2
1143 #define SkipChar 3
1144 #define SComment 4
1145 #define CComment 5
1146 #define Verbatim 6
1147 #define VerbatimCode 7
1148 #define ReadLine 8
1149 #define CondLine 9
1150 #define ReadAliasArgs 10
1151
1152 #ifndef YY_NO_UNISTD_H
1153 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1154  * down here because we want the user's section 1 to have been scanned first.
1155  * The user has a chance to override it with an option.
1156  */
1157 #include <unistd.h>
1158 #endif
1159
1160 #ifndef YY_EXTRA_TYPE
1161 #define YY_EXTRA_TYPE void *
1162 #endif
1163
1164 static int yy_init_globals (void );
1165
1166 /* Accessor methods to globals.
1167    These are made visible to non-reentrant scanners for convenience. */
1168
1169 int commentcnvYYlex_destroy (void );
1170
1171 int commentcnvYYget_debug (void );
1172
1173 void commentcnvYYset_debug (int debug_flag  );
1174
1175 YY_EXTRA_TYPE commentcnvYYget_extra (void );
1176
1177 void commentcnvYYset_extra (YY_EXTRA_TYPE user_defined  );
1178
1179 FILE *commentcnvYYget_in (void );
1180
1181 void commentcnvYYset_in  (FILE * in_str  );
1182
1183 FILE *commentcnvYYget_out (void );
1184
1185 void commentcnvYYset_out  (FILE * out_str  );
1186
1187 yy_size_t commentcnvYYget_leng (void );
1188
1189 char *commentcnvYYget_text (void );
1190
1191 int commentcnvYYget_lineno (void );
1192
1193 void commentcnvYYset_lineno (int line_number  );
1194
1195 /* Macros after this point can all be overridden by user definitions in
1196  * section 1.
1197  */
1198
1199 #ifndef YY_SKIP_YYWRAP
1200 #ifdef __cplusplus
1201 extern "C" int commentcnvYYwrap (void );
1202 #else
1203 extern int commentcnvYYwrap (void );
1204 #endif
1205 #endif
1206
1207     static void yyunput (int c,char *buf_ptr  );
1208     
1209 #ifndef yytext_ptr
1210 static void yy_flex_strncpy (char *,yyconst char *,int );
1211 #endif
1212
1213 #ifdef YY_NEED_STRLEN
1214 static int yy_flex_strlen (yyconst char * );
1215 #endif
1216
1217 #ifndef YY_NO_INPUT
1218
1219 #ifdef __cplusplus
1220 static int yyinput (void );
1221 #else
1222 static int input (void );
1223 #endif
1224
1225 #endif
1226
1227 /* Amount of stuff to slurp up with each read. */
1228 #ifndef YY_READ_BUF_SIZE
1229 #define YY_READ_BUF_SIZE 262144
1230 #endif
1231
1232 /* Copy whatever the last rule matched to the standard output. */
1233 #ifndef ECHO
1234 /* This used to be an fputs(), but since the string might contain NUL's,
1235  * we now use fwrite().
1236  */
1237 #define ECHO fwrite( commentcnvYYtext, commentcnvYYleng, 1, commentcnvYYout )
1238 #endif
1239
1240 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
1241  * is returned in "result".
1242  */
1243 #ifndef YY_INPUT
1244 #define YY_INPUT(buf,result,max_size) \
1245         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1246                 { \
1247                 int c = '*'; \
1248                 yy_size_t n; \
1249                 for ( n = 0; n < max_size && \
1250                              (c = getc( commentcnvYYin )) != EOF && c != '\n'; ++n ) \
1251                         buf[n] = (char) c; \
1252                 if ( c == '\n' ) \
1253                         buf[n++] = (char) c; \
1254                 if ( c == EOF && ferror( commentcnvYYin ) ) \
1255                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
1256                 result = n; \
1257                 } \
1258         else \
1259                 { \
1260                 errno=0; \
1261                 while ( (result = fread(buf, 1, max_size, commentcnvYYin))==0 && ferror(commentcnvYYin)) \
1262                         { \
1263                         if( errno != EINTR) \
1264                                 { \
1265                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1266                                 break; \
1267                                 } \
1268                         errno=0; \
1269                         clearerr(commentcnvYYin); \
1270                         } \
1271                 }\
1272 \
1273
1274 #endif
1275
1276 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1277  * we don't want an extra ';' after the "return" because that will cause
1278  * some compilers to complain about unreachable statements.
1279  */
1280 #ifndef yyterminate
1281 #define yyterminate() return YY_NULL
1282 #endif
1283
1284 /* Number of entries by which start-condition stack grows. */
1285 #ifndef YY_START_STACK_INCR
1286 #define YY_START_STACK_INCR 25
1287 #endif
1288
1289 /* Report a fatal error. */
1290 #ifndef YY_FATAL_ERROR
1291 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1292 #endif
1293
1294 /* end tables serialization structures and prototypes */
1295
1296 /* Default declaration of generated scanner - a define so the user can
1297  * easily add parameters.
1298  */
1299 #ifndef YY_DECL
1300 #define YY_DECL_IS_OURS 1
1301
1302 extern int commentcnvYYlex (void);
1303
1304 #define YY_DECL int commentcnvYYlex (void)
1305 #endif /* !YY_DECL */
1306
1307 /* Code executed at the beginning of each rule, after commentcnvYYtext and commentcnvYYleng
1308  * have been set up.
1309  */
1310 #ifndef YY_USER_ACTION
1311 #define YY_USER_ACTION
1312 #endif
1313
1314 /* Code executed at the end of each rule. */
1315 #ifndef YY_BREAK
1316 #define YY_BREAK break;
1317 #endif
1318
1319 #define YY_RULE_SETUP \
1320         if ( commentcnvYYleng > 0 ) \
1321                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1322                                 (commentcnvYYtext[commentcnvYYleng - 1] == '\n'); \
1323         YY_USER_ACTION
1324
1325 /** The main scanner function which does all the work.
1326  */
1327 YY_DECL
1328 {
1329         register yy_state_type yy_current_state;
1330         register char *yy_cp, *yy_bp;
1331         register int yy_act;
1332     
1333 #line 240 "commentcnv.l"
1334
1335
1336 #line 1337 "<stdout>"
1337
1338         if ( !(yy_init) )
1339                 {
1340                 (yy_init) = 1;
1341
1342 #ifdef YY_USER_INIT
1343                 YY_USER_INIT;
1344 #endif
1345
1346         /* Create the reject buffer large enough to save one state per allowed character. */
1347         if ( ! (yy_state_buf) )
1348             (yy_state_buf) = (yy_state_type *)commentcnvYYalloc(YY_STATE_BUF_SIZE  );
1349             if ( ! (yy_state_buf) )
1350                 YY_FATAL_ERROR( "out of dynamic memory in commentcnvYYlex()" );
1351
1352                 if ( ! (yy_start) )
1353                         (yy_start) = 1; /* first start state */
1354
1355                 if ( ! commentcnvYYin )
1356                         commentcnvYYin = stdin;
1357
1358                 if ( ! commentcnvYYout )
1359                         commentcnvYYout = stdout;
1360
1361                 if ( ! YY_CURRENT_BUFFER ) {
1362                         commentcnvYYensure_buffer_stack ();
1363                         YY_CURRENT_BUFFER_LVALUE =
1364                                 commentcnvYY_create_buffer(commentcnvYYin,YY_BUF_SIZE );
1365                 }
1366
1367                 commentcnvYY_load_buffer_state( );
1368                 }
1369
1370         while ( 1 )             /* loops until end-of-file is reached */
1371                 {
1372                 yy_cp = (yy_c_buf_p);
1373
1374                 /* Support of commentcnvYYtext. */
1375                 *yy_cp = (yy_hold_char);
1376
1377                 /* yy_bp points to the position in yy_ch_buf of the start of
1378                  * the current run.
1379                  */
1380                 yy_bp = yy_cp;
1381
1382                 yy_current_state = (yy_start);
1383                 yy_current_state += YY_AT_BOL();
1384
1385                 (yy_state_ptr) = (yy_state_buf);
1386                 *(yy_state_ptr)++ = yy_current_state;
1387
1388 yy_match:
1389                 do
1390                         {
1391                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1392                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1393                                 {
1394                                 yy_current_state = (int) yy_def[yy_current_state];
1395                                 if ( yy_current_state >= 329 )
1396                                         yy_c = yy_meta[(unsigned int) yy_c];
1397                                 }
1398                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1399                         *(yy_state_ptr)++ = yy_current_state;
1400                         ++yy_cp;
1401                         }
1402                 while ( yy_base[yy_current_state] != 1189 );
1403
1404 yy_find_action:
1405                 yy_current_state = *--(yy_state_ptr);
1406                 (yy_lp) = yy_accept[yy_current_state];
1407 goto find_rule; /* Shut up GCC warning -Wall */
1408 find_rule: /* we branch to this label when backing up */
1409                 for ( ; ; ) /* until we find what rule we matched */
1410                         {
1411                         if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
1412                                 {
1413                                 yy_act = yy_acclist[(yy_lp)];
1414                                 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1415                                      (yy_looking_for_trail_begin) )
1416                                         {
1417                                         if ( yy_act == (yy_looking_for_trail_begin) )
1418                                                 {
1419                                                 (yy_looking_for_trail_begin) = 0;
1420                                                 yy_act &= ~YY_TRAILING_HEAD_MASK;
1421                                                 break;
1422                                                 }
1423                                         }
1424                                 else if ( yy_act & YY_TRAILING_MASK )
1425                                         {
1426                                         (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
1427                                         (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
1428                                         (yy_full_match) = yy_cp;
1429                                         (yy_full_state) = (yy_state_ptr);
1430                                         (yy_full_lp) = (yy_lp);
1431                                         }
1432                                 else
1433                                         {
1434                                         (yy_full_match) = yy_cp;
1435                                         (yy_full_state) = (yy_state_ptr);
1436                                         (yy_full_lp) = (yy_lp);
1437                                         break;
1438                                         }
1439                                 ++(yy_lp);
1440                                 goto find_rule;
1441                                 }
1442                         --yy_cp;
1443                         yy_current_state = *--(yy_state_ptr);
1444                         (yy_lp) = yy_accept[yy_current_state];
1445                         }
1446
1447                 YY_DO_BEFORE_ACTION;
1448
1449 do_action:      /* This label is used only to access EOF actions. */
1450
1451                 switch ( yy_act )
1452         { /* beginning of action switch */
1453 case 1:
1454 YY_RULE_SETUP
1455 #line 242 "commentcnv.l"
1456 { /* eat anything that is not " / or \n */ 
1457                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1458                                    }
1459         YY_BREAK
1460 case 2:
1461 YY_RULE_SETUP
1462 #line 245 "commentcnv.l"
1463 { /* start of python long comment */
1464                                      if (g_lang!=SrcLangExt_Python)
1465                                      {
1466                                        REJECT;
1467                                      }
1468                                      else
1469                                      {
1470                                        g_pythonDocString = TRUE;
1471                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1472                                        BEGIN(CComment);
1473                                      }
1474                                    }
1475         YY_BREAK
1476 case 3:
1477 YY_RULE_SETUP
1478 #line 257 "commentcnv.l"
1479 {
1480                                      if (g_lang!=SrcLangExt_Fortran)
1481                                      {
1482                                        REJECT;
1483                                      }
1484                                      else
1485                                      {
1486                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1487                                        BEGIN(CComment);
1488                                      }
1489                                    }
1490         YY_BREAK
1491 case 4:
1492 YY_RULE_SETUP
1493 #line 268 "commentcnv.l"
1494 { /* start of a string */ 
1495                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1496                                      g_stringContext = YY_START;
1497                                      BEGIN(SkipString); 
1498                                    }
1499         YY_BREAK
1500 case 5:
1501 YY_RULE_SETUP
1502 #line 273 "commentcnv.l"
1503 {
1504                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1505                                      g_charContext = YY_START;
1506                                      BEGIN(SkipChar);
1507                                    }
1508         YY_BREAK
1509 case 6:
1510 /* rule 6 can match eol */
1511 YY_RULE_SETUP
1512 #line 278 "commentcnv.l"
1513 { /* new line */ 
1514                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1515                                    }
1516         YY_BREAK
1517 case 7:
1518 /* rule 7 can match eol */
1519 YY_RULE_SETUP
1520 #line 281 "commentcnv.l"
1521 { /* start C++ style special comment block */
1522                                      if (g_mlBrief) 
1523                                      {
1524                                        REJECT; // bail out if we do not need to convert
1525                                      }
1526                                      else
1527                                      {
1528                                        int i=3;
1529                                        if (commentcnvYYtext[2]=='/')
1530                                        {
1531                                          while (i<(int)commentcnvYYleng && commentcnvYYtext[i]=='/') i++;
1532                                        }
1533                                        g_blockHeadCol=g_col;
1534                                        copyToOutput("/**",3); 
1535                                        replaceAliases(commentcnvYYtext+i);
1536                                        g_inSpecialComment=TRUE;
1537                                        BEGIN(SComment); 
1538                                      }
1539                                    }
1540         YY_BREAK
1541 case 8:
1542 /* rule 8 can match eol */
1543 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1544 (yy_c_buf_p) = yy_cp -= 1;
1545 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1546 YY_RULE_SETUP
1547 #line 300 "commentcnv.l"
1548 { /* Start of Rational Rose ANSI C++ comment block */
1549                                      if (g_mlBrief) REJECT;
1550                                      int i=17; //=strlen("//##Documentation");
1551                                      g_blockHeadCol=g_col;
1552                                      copyToOutput("/**",3);
1553                                      replaceAliases(commentcnvYYtext+i);
1554                                      g_inRoseComment=TRUE;
1555                                      BEGIN(SComment);
1556                                    }
1557         YY_BREAK
1558 case 9:
1559 /* rule 9 can match eol */
1560 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1561 (yy_c_buf_p) = yy_cp = yy_bp + 2;
1562 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1563 YY_RULE_SETUP
1564 #line 309 "commentcnv.l"
1565 { /* one line C++ comment */ 
1566                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1567                                      g_readLineCtx=YY_START;
1568                                      BEGIN(ReadLine);
1569                                    }
1570         YY_BREAK
1571 case 10:
1572 YY_RULE_SETUP
1573 #line 314 "commentcnv.l"
1574 { /* start of a C comment */
1575                                      g_specialComment=(int)commentcnvYYleng==3;
1576                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1577                                      BEGIN(CComment); 
1578                                    }
1579         YY_BREAK
1580 case 11:
1581 YY_RULE_SETUP
1582 #line 319 "commentcnv.l"
1583 {
1584                                      if (g_lang!=SrcLangExt_Python)
1585                                      {
1586                                        REJECT;
1587                                      }
1588                                      else
1589                                      {
1590                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1591                                        BEGIN(CComment);
1592                                      }
1593                                    }
1594         YY_BREAK
1595 case 12:
1596 YY_RULE_SETUP
1597 #line 330 "commentcnv.l"
1598 {
1599                                      if (g_lang!=SrcLangExt_VHDL)
1600                                      {
1601                                        REJECT;
1602                                      }
1603                                      else
1604                                      {
1605                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1606                                        BEGIN(CComment);
1607                                      }
1608                                    }
1609         YY_BREAK
1610 case 13:
1611 YY_RULE_SETUP
1612 #line 341 "commentcnv.l"
1613 {
1614                                      if (g_lang!=SrcLangExt_Fortran)
1615                                      {
1616                                        REJECT;
1617                                      }
1618                                      else
1619                                      {
1620                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1621                                        BEGIN(CComment);
1622                                      }
1623                                    }
1624         YY_BREAK
1625 case 14:
1626 /* rule 14 can match eol */
1627 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1628 (yy_c_buf_p) = yy_cp = yy_bp + 6;
1629 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1630 YY_RULE_SETUP
1631 #line 352 "commentcnv.l"
1632 {
1633                                      copyToOutput("@code",5); 
1634                                      g_lastCommentContext = YY_START;
1635                                      g_javaBlock=1;
1636                                      g_blockName=&commentcnvYYtext[1];
1637                                      BEGIN(VerbatimCode);
1638                                    }
1639         YY_BREAK
1640 case 15:
1641 /* rule 15 can match eol */
1642 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1643 (yy_c_buf_p) = yy_cp -= 1;
1644 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1645 YY_RULE_SETUP
1646 #line 359 "commentcnv.l"
1647 { /* start of a verbatim block */
1648                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1649                                      g_lastCommentContext = YY_START;
1650                                      g_javaBlock=0;
1651                                      g_blockName=&commentcnvYYtext[1];
1652                                      BEGIN(VerbatimCode);
1653                                    }
1654         YY_BREAK
1655 case 16:
1656 YY_RULE_SETUP
1657 #line 366 "commentcnv.l"
1658 {
1659                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1660                                      g_blockName=&commentcnvYYtext[1];
1661                                      if (g_blockName.at(1)=='[')
1662                                      {
1663                                        g_blockName.at(1)=']';
1664                                      }
1665                                      else if (g_blockName.at(1)=='{')
1666                                      {
1667                                        g_blockName.at(1)='}';
1668                                      }
1669                                      g_lastCommentContext = YY_START;
1670                                      BEGIN(Verbatim);
1671                                    }
1672         YY_BREAK
1673 case 17:
1674 /* rule 17 can match eol */
1675 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1676 (yy_c_buf_p) = yy_cp -= 1;
1677 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1678 YY_RULE_SETUP
1679 #line 380 "commentcnv.l"
1680 { /* start of a verbatim block */
1681                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1682                                      g_blockName=&commentcnvYYtext[1];
1683                                      g_lastCommentContext = YY_START;
1684                                      BEGIN(Verbatim);
1685                                    }
1686         YY_BREAK
1687 case 18:
1688 YY_RULE_SETUP
1689 #line 386 "commentcnv.l"
1690 { /* any other character */
1691                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1692                                    }
1693         YY_BREAK
1694 case 19:
1695 YY_RULE_SETUP
1696 #line 389 "commentcnv.l"
1697 { /* end of verbatim block */
1698                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1699                                      if (commentcnvYYtext[1]=='f') // end of formula
1700                                      {
1701                                        BEGIN(g_lastCommentContext);
1702                                      }
1703                                      else if (&commentcnvYYtext[4]==g_blockName)
1704                                      {
1705                                        BEGIN(g_lastCommentContext);
1706                                      }
1707                                    }
1708         YY_BREAK
1709 case 20:
1710 YY_RULE_SETUP
1711 #line 400 "commentcnv.l"
1712 {
1713                                      if (g_javaBlock==0)
1714                                      {
1715                                        REJECT;
1716                                      }
1717                                      else
1718                                      {
1719                                        g_javaBlock++;
1720                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1721                                      }
1722                                    }
1723         YY_BREAK
1724 case 21:
1725 YY_RULE_SETUP
1726 #line 411 "commentcnv.l"
1727 {
1728                                      if (g_javaBlock==0)
1729                                      {
1730                                        REJECT;
1731                                      }
1732                                      else
1733                                      {
1734                                        g_javaBlock--;
1735                                        if (g_javaBlock==0)
1736                                        {
1737                                          copyToOutput(" @endcode ",10);
1738                                          BEGIN(g_lastCommentContext);
1739                                        }
1740                                        else
1741                                        {
1742                                          copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1743                                        }
1744                                      }
1745                                    }
1746         YY_BREAK
1747 case 22:
1748 YY_RULE_SETUP
1749 #line 430 "commentcnv.l"
1750 { /* end of verbatim block */
1751                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1752                                      if (&commentcnvYYtext[4]==g_blockName)
1753                                      {
1754                                        BEGIN(g_lastCommentContext);
1755                                      }
1756                                    }
1757         YY_BREAK
1758 case 23:
1759 YY_RULE_SETUP
1760 #line 437 "commentcnv.l"
1761 { /* skip leading comments */
1762                                      if (!g_inSpecialComment)
1763                                      {
1764                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1765                                      }
1766                                      else
1767                                      {
1768                                        int l=0;
1769                                        while (commentcnvYYtext[l]==' ' || commentcnvYYtext[l]=='\t')
1770                                        {
1771                                          l++;
1772                                        }
1773                                        copyToOutput(commentcnvYYtext,l);
1774                                        if (commentcnvYYleng-l==3) // ends with //! or ///
1775                                        {
1776                                          copyToOutput(" * ",3);
1777                                        }
1778                                        else // ends with //
1779                                        {
1780                                          copyToOutput("//",2);
1781                                        }
1782                                      }
1783                                    }
1784         YY_BREAK
1785 case 24:
1786 YY_RULE_SETUP
1787 #line 460 "commentcnv.l"
1788 { /* any character not a backslash or new line or } */
1789                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1790                                    }
1791         YY_BREAK
1792 case 25:
1793 /* rule 25 can match eol */
1794 YY_RULE_SETUP
1795 #line 463 "commentcnv.l"
1796 { /* new line in verbatim block */
1797                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1798                                    }
1799         YY_BREAK
1800 case 26:
1801 YY_RULE_SETUP
1802 #line 466 "commentcnv.l"
1803 {
1804                                      if (g_blockName=="dot" || g_blockName=="msc" || g_blockName.at(0)=='f')
1805                                      {
1806                                        // see bug 487871, strip /// from dot images and formulas.
1807                                        int l=0;
1808                                        while (commentcnvYYtext[l]==' ' || commentcnvYYtext[l]=='\t')
1809                                        {
1810                                          l++;
1811                                        }
1812                                        copyToOutput(commentcnvYYtext,l);
1813                                        copyToOutput("   ",3);
1814                                      }
1815                                      else // even slashes are verbatim (e.g. \verbatim, \code)
1816                                      {
1817                                        REJECT;
1818                                      }
1819                                    }
1820         YY_BREAK
1821 case 27:
1822 YY_RULE_SETUP
1823 #line 483 "commentcnv.l"
1824 { /* any other character */
1825                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1826                                    }
1827         YY_BREAK
1828 case 28:
1829 YY_RULE_SETUP
1830 #line 486 "commentcnv.l"
1831 { /* escaped character in string */
1832                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1833                                    }
1834         YY_BREAK
1835 case 29:
1836 YY_RULE_SETUP
1837 #line 489 "commentcnv.l"
1838 { /* end of string */ 
1839                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1840                                      BEGIN(g_stringContext); 
1841                                    }
1842         YY_BREAK
1843 case 30:
1844 YY_RULE_SETUP
1845 #line 493 "commentcnv.l"
1846 { /* any other string character */ 
1847                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1848                                    }
1849         YY_BREAK
1850 case 31:
1851 /* rule 31 can match eol */
1852 YY_RULE_SETUP
1853 #line 496 "commentcnv.l"
1854 { /* new line inside string (illegal for some compilers) */ 
1855                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1856                                    }
1857         YY_BREAK
1858 case 32:
1859 YY_RULE_SETUP
1860 #line 499 "commentcnv.l"
1861 { /* escaped character */
1862                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1863                                    }
1864         YY_BREAK
1865 case 33:
1866 YY_RULE_SETUP
1867 #line 502 "commentcnv.l"
1868 { /* end of character literal */ 
1869                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1870                                      BEGIN(g_charContext);
1871                                    }
1872         YY_BREAK
1873 case 34:
1874 YY_RULE_SETUP
1875 #line 506 "commentcnv.l"
1876 { /* any other string character */ 
1877                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1878                                    }
1879         YY_BREAK
1880 case 35:
1881 /* rule 35 can match eol */
1882 YY_RULE_SETUP
1883 #line 509 "commentcnv.l"
1884 { /* new line character */
1885                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1886                                    }
1887         YY_BREAK
1888 case 36:
1889 YY_RULE_SETUP
1890 #line 513 "commentcnv.l"
1891 { /* anything that is not a '*' or command */ 
1892                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1893                                    }
1894         YY_BREAK
1895 case 37:
1896 YY_RULE_SETUP
1897 #line 516 "commentcnv.l"
1898 { /* stars without slashes */
1899                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1900                                    }
1901         YY_BREAK
1902 case 38:
1903 YY_RULE_SETUP
1904 #line 519 "commentcnv.l"
1905 { /* end of Python docstring */
1906                                      if (g_lang!=SrcLangExt_Python)
1907                                      {
1908                                        REJECT;
1909                                      }
1910                                      else
1911                                      {
1912                                        g_pythonDocString = FALSE;
1913                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1914                                        BEGIN(Scan);
1915                                      }
1916                                    }
1917         YY_BREAK
1918 case 39:
1919 /* rule 39 can match eol */
1920 YY_RULE_SETUP
1921 #line 531 "commentcnv.l"
1922 { /* new line in comment */
1923                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
1924                                    }
1925         YY_BREAK
1926 case 40:
1927 YY_RULE_SETUP
1928 #line 534 "commentcnv.l"
1929 { /* end of C comment */
1930                                      if (g_lang==SrcLangExt_Python)
1931                                      {
1932                                        REJECT;
1933                                      }
1934                                      else
1935                                      {
1936                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1937                                        BEGIN(Scan);
1938                                      }
1939                                    }
1940         YY_BREAK
1941 case 41:
1942 /* rule 41 can match eol */
1943 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1944 (yy_c_buf_p) = yy_cp = yy_bp + 1;
1945 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1946 YY_RULE_SETUP
1947 #line 545 "commentcnv.l"
1948 { /* end of Python comment */
1949                                      if (g_lang!=SrcLangExt_Python || g_pythonDocString)
1950                                      {
1951                                        REJECT;
1952                                      }
1953                                      else
1954                                      {
1955                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1956                                        BEGIN(Scan);
1957                                      }
1958                                    }
1959         YY_BREAK
1960 case 42:
1961 /* rule 42 can match eol */
1962 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1963 (yy_c_buf_p) = yy_cp = yy_bp + 1;
1964 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1965 YY_RULE_SETUP
1966 #line 556 "commentcnv.l"
1967 { /* end of VHDL comment */
1968                                      if (g_lang!=SrcLangExt_VHDL)
1969                                      {
1970                                        REJECT;
1971                                      }
1972                                      else
1973                                      {
1974                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1975                                        BEGIN(Scan);
1976                                      }
1977                                    }
1978         YY_BREAK
1979 case 43:
1980 /* rule 43 can match eol */
1981 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
1982 (yy_c_buf_p) = yy_cp = yy_bp + 1;
1983 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
1984 YY_RULE_SETUP
1985 #line 567 "commentcnv.l"
1986 { /* end of Fortran comment */
1987                                      if (g_lang!=SrcLangExt_Fortran)
1988                                      {
1989                                        REJECT;
1990                                      }
1991                                      else
1992                                      {
1993                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
1994                                        BEGIN(Scan);
1995                                      }
1996                                    }
1997         YY_BREAK
1998 /* removed for bug 674842 (bug was introduced in rev 768)
1999 <CComment>"'"                      {
2000                                      g_charContext = YY_START;
2001                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2002                                      BEGIN(SkipChar);
2003                                    }
2004 <CComment>"\""                     {
2005                                      g_stringContext = YY_START;
2006                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2007                                      BEGIN(SkipString);
2008                                    }
2009    */
2010 case 44:
2011 YY_RULE_SETUP
2012 #line 590 "commentcnv.l"
2013 {
2014                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
2015                                    }
2016         YY_BREAK
2017 case 45:
2018 /* rule 45 can match eol */
2019 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
2020 (yy_c_buf_p) = yy_cp -= 1;
2021 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
2022 YY_RULE_SETUP
2023 #line 593 "commentcnv.l"
2024 {
2025                                      replaceComment(0);
2026                                    }
2027         YY_BREAK
2028 case 46:
2029 /* rule 46 can match eol */
2030 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
2031 (yy_c_buf_p) = yy_cp -= 1;
2032 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
2033 YY_RULE_SETUP
2034 #line 596 "commentcnv.l"
2035 {
2036                                      replaceComment(1); 
2037                                    }
2038         YY_BREAK
2039 case 47:
2040 /* rule 47 can match eol */
2041 YY_RULE_SETUP
2042 #line 599 "commentcnv.l"
2043
2044                                      replaceComment(0);
2045                                      g_readLineCtx=YY_START;
2046                                      BEGIN(ReadLine);
2047                                    }
2048         YY_BREAK
2049 case 48:
2050 /* rule 48 can match eol */
2051 YY_RULE_SETUP
2052 #line 604 "commentcnv.l"
2053
2054                                      replaceComment(1); 
2055                                      g_readLineCtx=YY_START;
2056                                      BEGIN(ReadLine);
2057                                    }
2058         YY_BREAK
2059 case 49:
2060 #line 610 "commentcnv.l"
2061 case 50:
2062 /* rule 50 can match eol */
2063 #line 611 "commentcnv.l"
2064 case 51:
2065 /* rule 51 can match eol */
2066 YY_RULE_SETUP
2067 #line 611 "commentcnv.l"
2068 {    // or   //!something
2069                                      replaceComment(0);
2070                                      g_readLineCtx=YY_START;
2071                                      BEGIN(ReadLine);
2072                                    }
2073         YY_BREAK
2074 case 52:
2075 /* rule 52 can match eol */
2076 #line 617 "commentcnv.l"
2077 case 53:
2078 /* rule 53 can match eol */
2079 #line 618 "commentcnv.l"
2080 case 54:
2081 /* rule 54 can match eol */
2082 YY_RULE_SETUP
2083 #line 618 "commentcnv.l"
2084
2085                                      replaceComment(1); 
2086                                      g_readLineCtx=YY_START;
2087                                      BEGIN(ReadLine);
2088                                    }
2089         YY_BREAK
2090 case 55:
2091 /* rule 55 can match eol */
2092 YY_RULE_SETUP
2093 #line 623 "commentcnv.l"
2094 {
2095                                      if (!g_inRoseComment)
2096                                      {
2097                                        REJECT;
2098                                      }
2099                                      else
2100                                      {
2101                                        replaceComment(0);
2102                                        g_readLineCtx=YY_START;
2103                                        BEGIN(ReadLine);
2104                                      }
2105                                    }
2106         YY_BREAK
2107 case 56:
2108 /* rule 56 can match eol */
2109 YY_RULE_SETUP
2110 #line 635 "commentcnv.l"
2111 {
2112                                      if (!g_inRoseComment)
2113                                      {
2114                                        REJECT;
2115                                      }
2116                                      else
2117                                      {
2118                                        replaceComment(1); 
2119                                        g_readLineCtx=YY_START;
2120                                        BEGIN(ReadLine);
2121                                      }
2122                                    }
2123         YY_BREAK
2124 case 57:
2125 /* rule 57 can match eol */
2126 YY_RULE_SETUP
2127 #line 647 "commentcnv.l"
2128 { /* end of special comment */
2129                                      copyToOutput(" */",3); 
2130                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng); 
2131                                      g_inSpecialComment=FALSE;
2132                                      g_inRoseComment=FALSE;
2133                                      BEGIN(Scan); 
2134                                    }
2135         YY_BREAK
2136 case 58:
2137 /* rule 58 can match eol */
2138 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
2139 (yy_c_buf_p) = yy_cp -= 1;
2140 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
2141 YY_RULE_SETUP
2142 #line 654 "commentcnv.l"
2143 {
2144                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2145                                      BEGIN(g_readLineCtx);
2146                                    }
2147         YY_BREAK
2148 case 59:
2149 YY_RULE_SETUP
2150 #line 658 "commentcnv.l"
2151 { // escaped command
2152                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2153                                    }
2154         YY_BREAK
2155 case 60:
2156 YY_RULE_SETUP
2157 #line 661 "commentcnv.l"
2158 { // conditional section
2159                                      g_condCtx = YY_START; 
2160                                      BEGIN(CondLine);
2161                                    }
2162         YY_BREAK
2163 case 61:
2164 /* rule 61 can match eol */
2165 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
2166 (yy_c_buf_p) = yy_cp = yy_bp + 8;
2167 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
2168 YY_RULE_SETUP
2169 #line 665 "commentcnv.l"
2170 { // end of conditional section
2171                                      bool oldSkip=g_skip;
2172                                      endCondSection();
2173                                      if (YY_START==CComment && oldSkip && !g_skip) 
2174                                      {
2175                                        //printf("** Adding start of comment!\n");
2176                                        if (g_lang!=SrcLangExt_Python &&
2177                                            g_lang!=SrcLangExt_VHDL &&
2178                                            g_lang!=SrcLangExt_Fortran)
2179                                        {
2180                                          ADDCHAR('/');
2181                                          ADDCHAR('*');
2182                                          if (g_specialComment)
2183                                          {
2184                                            ADDCHAR('*');
2185                                          }
2186                                        }
2187                                      }
2188                                     }
2189         YY_BREAK
2190 case 62:
2191 YY_RULE_SETUP
2192 #line 684 "commentcnv.l"
2193 {
2194                                      bool oldSkip=g_skip;
2195                                      startCondSection(commentcnvYYtext);
2196                                      if (g_condCtx==CComment && !oldSkip && g_skip) 
2197                                      {
2198                                        //printf("** Adding terminator for comment!\n");
2199                                        if (g_lang!=SrcLangExt_Python &&
2200                                            g_lang!=SrcLangExt_VHDL &&
2201                                            g_lang!=SrcLangExt_Fortran)
2202                                        {
2203                                          ADDCHAR('*');
2204                                          ADDCHAR('/');
2205                                        }
2206                                      }
2207                                      BEGIN(g_condCtx);
2208                                    }
2209         YY_BREAK
2210 case 63:
2211 YY_RULE_SETUP
2212 #line 700 "commentcnv.l"
2213
2214         YY_BREAK
2215 case 64:
2216 /* rule 64 can match eol */
2217 *yy_cp = (yy_hold_char); /* undo effects of setting up commentcnvYYtext */
2218 (yy_c_buf_p) = yy_cp -= 1;
2219 YY_DO_BEFORE_ACTION; /* set up commentcnvYYtext again */
2220 #line 702 "commentcnv.l"
2221 case 65:
2222 /* rule 65 can match eol */
2223 YY_RULE_SETUP
2224 #line 702 "commentcnv.l"
2225 { // forgot section id?
2226                                      if (YY_START!=CondLine) g_condCtx=YY_START;
2227                                      bool oldSkip=g_skip;
2228                                      startCondSection(" "); // fake section id causing the section to be hidden unconditionally
2229                                      if (g_condCtx==CComment && !oldSkip && g_skip) 
2230                                      {
2231                                        //printf("** Adding terminator for comment!\n");
2232                                        if (g_lang!=SrcLangExt_Python &&
2233                                            g_lang!=SrcLangExt_VHDL)
2234                                        {
2235                                          ADDCHAR('*');
2236                                          ADDCHAR('/');
2237                                        }
2238                                      }
2239                                      if (*commentcnvYYtext=='\n') g_lineNr++;
2240                                      BEGIN(g_condCtx);
2241                                    }
2242         YY_BREAK
2243 case 66:
2244 YY_RULE_SETUP
2245 #line 719 "commentcnv.l"
2246 { // expand alias without arguments
2247                                      replaceAliases(commentcnvYYtext);
2248                                    }
2249         YY_BREAK
2250 case 67:
2251 YY_RULE_SETUP
2252 #line 722 "commentcnv.l"
2253 { // expand alias with arguments
2254                                      g_lastBlockContext=YY_START;
2255                                      g_blockCount=1;
2256                                      g_aliasString=commentcnvYYtext;
2257                                      g_lastEscaped=0;
2258                                      BEGIN( ReadAliasArgs );
2259                                    }
2260         YY_BREAK
2261 case 68:
2262 YY_RULE_SETUP
2263 #line 729 "commentcnv.l"
2264 { // skip leading special comments (see bug 618079)
2265                                    }
2266         YY_BREAK
2267 case 69:
2268 YY_RULE_SETUP
2269 #line 731 "commentcnv.l"
2270 { // oops, end of comment in the middle of an alias?
2271                                      if (g_lang==SrcLangExt_Python)
2272                                      {
2273                                        REJECT;
2274                                      }
2275                                      else // abort the alias, restart scanning
2276                                      {
2277                                        copyToOutput(g_aliasString,g_aliasString.length());
2278                                        copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2279                                        BEGIN(Scan);
2280                                      }
2281                                    }
2282         YY_BREAK
2283 case 70:
2284 YY_RULE_SETUP
2285 #line 743 "commentcnv.l"
2286 {
2287                                      g_aliasString+=commentcnvYYtext;
2288                                      g_lastEscaped=FALSE;
2289                                    }
2290         YY_BREAK
2291 case 71:
2292 YY_RULE_SETUP
2293 #line 747 "commentcnv.l"
2294 {
2295                                      if (g_lastEscaped)  g_lastEscaped=FALSE;
2296                                      else                g_lastEscaped=TRUE;
2297                                      g_aliasString+=commentcnvYYtext;
2298                                    }
2299         YY_BREAK
2300 case 72:
2301 /* rule 72 can match eol */
2302 YY_RULE_SETUP
2303 #line 752 "commentcnv.l"
2304 {
2305                                      g_aliasString+=commentcnvYYtext;
2306                                      g_lineNr++;
2307                                      g_lastEscaped=FALSE;
2308                                    }
2309         YY_BREAK
2310 case 73:
2311 YY_RULE_SETUP
2312 #line 757 "commentcnv.l"
2313 {
2314                                      g_aliasString+=commentcnvYYtext;
2315                                      if (!g_lastEscaped) g_blockCount++;
2316                                      g_lastEscaped=FALSE;
2317                                    }
2318         YY_BREAK
2319 case 74:
2320 YY_RULE_SETUP
2321 #line 762 "commentcnv.l"
2322 {
2323                                      g_aliasString+=commentcnvYYtext;
2324                                      if (!g_lastEscaped) g_blockCount--;
2325                                      if (g_blockCount==0)
2326                                      {
2327                                        replaceAliases(g_aliasString);
2328                                        BEGIN( g_lastBlockContext );
2329                                      }
2330                                      g_lastEscaped=FALSE;
2331                                    }
2332         YY_BREAK
2333 case 75:
2334 YY_RULE_SETUP
2335 #line 772 "commentcnv.l"
2336 {
2337                                      g_aliasString+=commentcnvYYtext;
2338                                      g_lastEscaped=FALSE;
2339                                    }
2340         YY_BREAK
2341 case 76:
2342 YY_RULE_SETUP
2343 #line 776 "commentcnv.l"
2344 {
2345                                      copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
2346                                    }
2347         YY_BREAK
2348 case 77:
2349 YY_RULE_SETUP
2350 #line 780 "commentcnv.l"
2351 ECHO;
2352         YY_BREAK
2353 #line 2354 "<stdout>"
2354                         case YY_STATE_EOF(INITIAL):
2355                         case YY_STATE_EOF(Scan):
2356                         case YY_STATE_EOF(SkipString):
2357                         case YY_STATE_EOF(SkipChar):
2358                         case YY_STATE_EOF(SComment):
2359                         case YY_STATE_EOF(CComment):
2360                         case YY_STATE_EOF(Verbatim):
2361                         case YY_STATE_EOF(VerbatimCode):
2362                         case YY_STATE_EOF(ReadLine):
2363                         case YY_STATE_EOF(CondLine):
2364                         case YY_STATE_EOF(ReadAliasArgs):
2365                                 yyterminate();
2366
2367         case YY_END_OF_BUFFER:
2368                 {
2369                 /* Amount of text matched not including the EOB char. */
2370                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2371
2372                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2373                 *yy_cp = (yy_hold_char);
2374                 YY_RESTORE_YY_MORE_OFFSET
2375
2376                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2377                         {
2378                         /* We're scanning a new file or input source.  It's
2379                          * possible that this happened because the user
2380                          * just pointed commentcnvYYin at a new source and called
2381                          * commentcnvYYlex().  If so, then we have to assure
2382                          * consistency between YY_CURRENT_BUFFER and our
2383                          * globals.  Here is the right place to do so, because
2384                          * this is the first action (other than possibly a
2385                          * back-up) that will match for the new input source.
2386                          */
2387                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2388                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = commentcnvYYin;
2389                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2390                         }
2391
2392                 /* Note that here we test for yy_c_buf_p "<=" to the position
2393                  * of the first EOB in the buffer, since yy_c_buf_p will
2394                  * already have been incremented past the NUL character
2395                  * (since all states make transitions on EOB to the
2396                  * end-of-buffer state).  Contrast this with the test
2397                  * in input().
2398                  */
2399                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2400                         { /* This was really a NUL. */
2401                         yy_state_type yy_next_state;
2402
2403                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2404
2405                         yy_current_state = yy_get_previous_state(  );
2406
2407                         /* Okay, we're now positioned to make the NUL
2408                          * transition.  We couldn't have
2409                          * yy_get_previous_state() go ahead and do it
2410                          * for us because it doesn't know how to deal
2411                          * with the possibility of jamming (and we don't
2412                          * want to build jamming into it because then it
2413                          * will run more slowly).
2414                          */
2415
2416                         yy_next_state = yy_try_NUL_trans( yy_current_state );
2417
2418                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2419
2420                         if ( yy_next_state )
2421                                 {
2422                                 /* Consume the NUL. */
2423                                 yy_cp = ++(yy_c_buf_p);
2424                                 yy_current_state = yy_next_state;
2425                                 goto yy_match;
2426                                 }
2427
2428                         else
2429                                 {
2430                                 yy_cp = (yy_c_buf_p);
2431                                 goto yy_find_action;
2432                                 }
2433                         }
2434
2435                 else switch ( yy_get_next_buffer(  ) )
2436                         {
2437                         case EOB_ACT_END_OF_FILE:
2438                                 {
2439                                 (yy_did_buffer_switch_on_eof) = 0;
2440
2441                                 if ( commentcnvYYwrap( ) )
2442                                         {
2443                                         /* Note: because we've taken care in
2444                                          * yy_get_next_buffer() to have set up
2445                                          * commentcnvYYtext, we can now set up
2446                                          * yy_c_buf_p so that if some total
2447                                          * hoser (like flex itself) wants to
2448                                          * call the scanner after we return the
2449                                          * YY_NULL, it'll still work - another
2450                                          * YY_NULL will get returned.
2451                                          */
2452                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
2453
2454                                         yy_act = YY_STATE_EOF(YY_START);
2455                                         goto do_action;
2456                                         }
2457
2458                                 else
2459                                         {
2460                                         if ( ! (yy_did_buffer_switch_on_eof) )
2461                                                 YY_NEW_FILE;
2462                                         }
2463                                 break;
2464                                 }
2465
2466                         case EOB_ACT_CONTINUE_SCAN:
2467                                 (yy_c_buf_p) =
2468                                         (yytext_ptr) + yy_amount_of_matched_text;
2469
2470                                 yy_current_state = yy_get_previous_state(  );
2471
2472                                 yy_cp = (yy_c_buf_p);
2473                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2474                                 goto yy_match;
2475
2476                         case EOB_ACT_LAST_MATCH:
2477                                 (yy_c_buf_p) =
2478                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
2479
2480                                 yy_current_state = yy_get_previous_state(  );
2481
2482                                 yy_cp = (yy_c_buf_p);
2483                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2484                                 goto yy_find_action;
2485                         }
2486                 break;
2487                 }
2488
2489         default:
2490                 YY_FATAL_ERROR(
2491                         "fatal flex scanner internal error--no action found" );
2492         } /* end of action switch */
2493                 } /* end of scanning one token */
2494 } /* end of commentcnvYYlex */
2495
2496 /* yy_get_next_buffer - try to read in a new buffer
2497  *
2498  * Returns a code representing an action:
2499  *      EOB_ACT_LAST_MATCH -
2500  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2501  *      EOB_ACT_END_OF_FILE - end of file
2502  */
2503 static int yy_get_next_buffer (void)
2504 {
2505         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2506         register char *source = (yytext_ptr);
2507         register int number_to_move, i;
2508         int ret_val;
2509
2510         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
2511                 YY_FATAL_ERROR(
2512                 "fatal flex scanner internal error--end of buffer missed" );
2513
2514         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2515                 { /* Don't try to fill the buffer, so this is an EOF. */
2516                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
2517                         {
2518                         /* We matched a single character, the EOB, so
2519                          * treat this as a final EOF.
2520                          */
2521                         return EOB_ACT_END_OF_FILE;
2522                         }
2523
2524                 else
2525                         {
2526                         /* We matched some text prior to the EOB, first
2527                          * process it.
2528                          */
2529                         return EOB_ACT_LAST_MATCH;
2530                         }
2531                 }
2532
2533         /* Try to read more data. */
2534
2535         /* First move last chars to start of buffer. */
2536         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
2537
2538         for ( i = 0; i < number_to_move; ++i )
2539                 *(dest++) = *(source++);
2540
2541         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2542                 /* don't do the read, it's not guaranteed to return an EOF,
2543                  * just force an EOF
2544                  */
2545                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
2546
2547         else
2548                 {
2549                         yy_size_t num_to_read =
2550                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2551
2552                 while ( num_to_read <= 0 )
2553                         { /* Not enough room in the buffer - grow it. */
2554
2555                         YY_FATAL_ERROR(
2556 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
2557
2558                         }
2559
2560                 if ( num_to_read > YY_READ_BUF_SIZE )
2561                         num_to_read = YY_READ_BUF_SIZE;
2562
2563                 /* Read in more data. */
2564                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2565                         (yy_n_chars), num_to_read );
2566
2567                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2568                 }
2569
2570         if ( (yy_n_chars) == 0 )
2571                 {
2572                 if ( number_to_move == YY_MORE_ADJ )
2573                         {
2574                         ret_val = EOB_ACT_END_OF_FILE;
2575                         commentcnvYYrestart(commentcnvYYin  );
2576                         }
2577
2578                 else
2579                         {
2580                         ret_val = EOB_ACT_LAST_MATCH;
2581                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2582                                 YY_BUFFER_EOF_PENDING;
2583                         }
2584                 }
2585
2586         else
2587                 ret_val = EOB_ACT_CONTINUE_SCAN;
2588
2589         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2590                 /* Extend the array by 50%, plus the number we really need. */
2591                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
2592                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) commentcnvYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
2593                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2594                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2595         }
2596
2597         (yy_n_chars) += number_to_move;
2598         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
2599         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
2600
2601         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2602
2603         return ret_val;
2604 }
2605
2606 /* yy_get_previous_state - get the state just before the EOB char was reached */
2607
2608     static yy_state_type yy_get_previous_state (void)
2609 {
2610         register yy_state_type yy_current_state;
2611         register char *yy_cp;
2612     
2613         yy_current_state = (yy_start);
2614         yy_current_state += YY_AT_BOL();
2615
2616         (yy_state_ptr) = (yy_state_buf);
2617         *(yy_state_ptr)++ = yy_current_state;
2618
2619         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
2620                 {
2621                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2622                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2623                         {
2624                         yy_current_state = (int) yy_def[yy_current_state];
2625                         if ( yy_current_state >= 329 )
2626                                 yy_c = yy_meta[(unsigned int) yy_c];
2627                         }
2628                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2629                 *(yy_state_ptr)++ = yy_current_state;
2630                 }
2631
2632         return yy_current_state;
2633 }
2634
2635 /* yy_try_NUL_trans - try to make a transition on the NUL character
2636  *
2637  * synopsis
2638  *      next_state = yy_try_NUL_trans( current_state );
2639  */
2640     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2641 {
2642         register int yy_is_jam;
2643     
2644         register YY_CHAR yy_c = 1;
2645         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2646                 {
2647                 yy_current_state = (int) yy_def[yy_current_state];
2648                 if ( yy_current_state >= 329 )
2649                         yy_c = yy_meta[(unsigned int) yy_c];
2650                 }
2651         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2652         yy_is_jam = (yy_current_state == 328);
2653         if ( ! yy_is_jam )
2654                 *(yy_state_ptr)++ = yy_current_state;
2655
2656         return yy_is_jam ? 0 : yy_current_state;
2657 }
2658
2659     static void yyunput (int c, register char * yy_bp )
2660 {
2661         register char *yy_cp;
2662     
2663     yy_cp = (yy_c_buf_p);
2664
2665         /* undo effects of setting up commentcnvYYtext */
2666         *yy_cp = (yy_hold_char);
2667
2668         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2669                 { /* need to shift things up to make room */
2670                 /* +2 for EOB chars. */
2671                 register yy_size_t number_to_move = (yy_n_chars) + 2;
2672                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2673                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2674                 register char *source =
2675                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2676
2677                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2678                         *--dest = *--source;
2679
2680                 yy_cp += (int) (dest - source);
2681                 yy_bp += (int) (dest - source);
2682                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2683                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2684
2685                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2686                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
2687                 }
2688
2689         *--yy_cp = (char) c;
2690
2691         (yytext_ptr) = yy_bp;
2692         (yy_hold_char) = *yy_cp;
2693         (yy_c_buf_p) = yy_cp;
2694 }
2695
2696 #ifndef YY_NO_INPUT
2697 #ifdef __cplusplus
2698     static int yyinput (void)
2699 #else
2700     static int input  (void)
2701 #endif
2702
2703 {
2704         int c;
2705     
2706         *(yy_c_buf_p) = (yy_hold_char);
2707
2708         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2709                 {
2710                 /* yy_c_buf_p now points to the character we want to return.
2711                  * If this occurs *before* the EOB characters, then it's a
2712                  * valid NUL; if not, then we've hit the end of the buffer.
2713                  */
2714                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2715                         /* This was really a NUL. */
2716                         *(yy_c_buf_p) = '\0';
2717
2718                 else
2719                         { /* need more input */
2720                         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
2721                         ++(yy_c_buf_p);
2722
2723                         switch ( yy_get_next_buffer(  ) )
2724                                 {
2725                                 case EOB_ACT_LAST_MATCH:
2726                                         /* This happens because yy_g_n_b()
2727                                          * sees that we've accumulated a
2728                                          * token and flags that we need to
2729                                          * try matching the token before
2730                                          * proceeding.  But for input(),
2731                                          * there's no matching to consider.
2732                                          * So convert the EOB_ACT_LAST_MATCH
2733                                          * to EOB_ACT_END_OF_FILE.
2734                                          */
2735
2736                                         /* Reset buffer status. */
2737                                         commentcnvYYrestart(commentcnvYYin );
2738
2739                                         /*FALLTHROUGH*/
2740
2741                                 case EOB_ACT_END_OF_FILE:
2742                                         {
2743                                         if ( commentcnvYYwrap( ) )
2744                                                 return 0;
2745
2746                                         if ( ! (yy_did_buffer_switch_on_eof) )
2747                                                 YY_NEW_FILE;
2748 #ifdef __cplusplus
2749                                         return yyinput();
2750 #else
2751                                         return input();
2752 #endif
2753                                         }
2754
2755                                 case EOB_ACT_CONTINUE_SCAN:
2756                                         (yy_c_buf_p) = (yytext_ptr) + offset;
2757                                         break;
2758                                 }
2759                         }
2760                 }
2761
2762         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
2763         *(yy_c_buf_p) = '\0';   /* preserve commentcnvYYtext */
2764         (yy_hold_char) = *++(yy_c_buf_p);
2765
2766         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
2767
2768         return c;
2769 }
2770 #endif  /* ifndef YY_NO_INPUT */
2771
2772 /** Immediately switch to a different input stream.
2773  * @param input_file A readable stream.
2774  * 
2775  * @note This function does not reset the start condition to @c INITIAL .
2776  */
2777     void commentcnvYYrestart  (FILE * input_file )
2778 {
2779     
2780         if ( ! YY_CURRENT_BUFFER ){
2781         commentcnvYYensure_buffer_stack ();
2782                 YY_CURRENT_BUFFER_LVALUE =
2783             commentcnvYY_create_buffer(commentcnvYYin,YY_BUF_SIZE );
2784         }
2785
2786         commentcnvYY_init_buffer(YY_CURRENT_BUFFER,input_file );
2787         commentcnvYY_load_buffer_state( );
2788 }
2789
2790 /** Switch to a different input buffer.
2791  * @param new_buffer The new input buffer.
2792  * 
2793  */
2794     void commentcnvYY_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2795 {
2796     
2797         /* TODO. We should be able to replace this entire function body
2798          * with
2799          *              commentcnvYYpop_buffer_state();
2800          *              commentcnvYYpush_buffer_state(new_buffer);
2801      */
2802         commentcnvYYensure_buffer_stack ();
2803         if ( YY_CURRENT_BUFFER == new_buffer )
2804                 return;
2805
2806         if ( YY_CURRENT_BUFFER )
2807                 {
2808                 /* Flush out information for old buffer. */
2809                 *(yy_c_buf_p) = (yy_hold_char);
2810                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2811                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2812                 }
2813
2814         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2815         commentcnvYY_load_buffer_state( );
2816
2817         /* We don't actually know whether we did this switch during
2818          * EOF (commentcnvYYwrap()) processing, but the only time this flag
2819          * is looked at is after commentcnvYYwrap() is called, so it's safe
2820          * to go ahead and always set it.
2821          */
2822         (yy_did_buffer_switch_on_eof) = 1;
2823 }
2824
2825 static void commentcnvYY_load_buffer_state  (void)
2826 {
2827         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2828         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2829         commentcnvYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2830         (yy_hold_char) = *(yy_c_buf_p);
2831 }
2832
2833 /** Allocate and initialize an input buffer state.
2834  * @param file A readable stream.
2835  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2836  * 
2837  * @return the allocated buffer state.
2838  */
2839     YY_BUFFER_STATE commentcnvYY_create_buffer  (FILE * file, int  size )
2840 {
2841         YY_BUFFER_STATE b;
2842     
2843         b = (YY_BUFFER_STATE) commentcnvYYalloc(sizeof( struct yy_buffer_state )  );
2844         if ( ! b )
2845                 YY_FATAL_ERROR( "out of dynamic memory in commentcnvYY_create_buffer()" );
2846
2847         b->yy_buf_size = size;
2848
2849         /* yy_ch_buf has to be 2 characters longer than the size given because
2850          * we need to put in 2 end-of-buffer characters.
2851          */
2852         b->yy_ch_buf = (char *) commentcnvYYalloc(b->yy_buf_size + 2  );
2853         if ( ! b->yy_ch_buf )
2854                 YY_FATAL_ERROR( "out of dynamic memory in commentcnvYY_create_buffer()" );
2855
2856         b->yy_is_our_buffer = 1;
2857
2858         commentcnvYY_init_buffer(b,file );
2859
2860         return b;
2861 }
2862
2863 /** Destroy the buffer.
2864  * @param b a buffer created with commentcnvYY_create_buffer()
2865  * 
2866  */
2867     void commentcnvYY_delete_buffer (YY_BUFFER_STATE  b )
2868 {
2869     
2870         if ( ! b )
2871                 return;
2872
2873         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2874                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2875
2876         if ( b->yy_is_our_buffer )
2877                 commentcnvYYfree((void *) b->yy_ch_buf  );
2878
2879         commentcnvYYfree((void *) b  );
2880 }
2881
2882 #ifndef __cplusplus
2883 extern int isatty (int );
2884 #endif /* __cplusplus */
2885     
2886 /* Initializes or reinitializes a buffer.
2887  * This function is sometimes called more than once on the same buffer,
2888  * such as during a commentcnvYYrestart() or at EOF.
2889  */
2890     static void commentcnvYY_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2891
2892 {
2893         int oerrno = errno;
2894     
2895         commentcnvYY_flush_buffer(b );
2896
2897         b->yy_input_file = file;
2898         b->yy_fill_buffer = 1;
2899
2900     /* If b is the current buffer, then commentcnvYY_init_buffer was _probably_
2901      * called from commentcnvYYrestart() or through yy_get_next_buffer.
2902      * In that case, we don't want to reset the lineno or column.
2903      */
2904     if (b != YY_CURRENT_BUFFER){
2905         b->yy_bs_lineno = 1;
2906         b->yy_bs_column = 0;
2907     }
2908
2909         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2910     
2911         errno = oerrno;
2912 }
2913
2914 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2915  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2916  * 
2917  */
2918     void commentcnvYY_flush_buffer (YY_BUFFER_STATE  b )
2919 {
2920         if ( ! b )
2921                 return;
2922
2923         b->yy_n_chars = 0;
2924
2925         /* We always need two end-of-buffer characters.  The first causes
2926          * a transition to the end-of-buffer state.  The second causes
2927          * a jam in that state.
2928          */
2929         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2930         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2931
2932         b->yy_buf_pos = &b->yy_ch_buf[0];
2933
2934         b->yy_at_bol = 1;
2935         b->yy_buffer_status = YY_BUFFER_NEW;
2936
2937         if ( b == YY_CURRENT_BUFFER )
2938                 commentcnvYY_load_buffer_state( );
2939 }
2940
2941 /** Pushes the new state onto the stack. The new state becomes
2942  *  the current state. This function will allocate the stack
2943  *  if necessary.
2944  *  @param new_buffer The new state.
2945  *  
2946  */
2947 void commentcnvYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
2948 {
2949         if (new_buffer == NULL)
2950                 return;
2951
2952         commentcnvYYensure_buffer_stack();
2953
2954         /* This block is copied from commentcnvYY_switch_to_buffer. */
2955         if ( YY_CURRENT_BUFFER )
2956                 {
2957                 /* Flush out information for old buffer. */
2958                 *(yy_c_buf_p) = (yy_hold_char);
2959                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2960                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2961                 }
2962
2963         /* Only push if top exists. Otherwise, replace top. */
2964         if (YY_CURRENT_BUFFER)
2965                 (yy_buffer_stack_top)++;
2966         YY_CURRENT_BUFFER_LVALUE = new_buffer;
2967
2968         /* copied from commentcnvYY_switch_to_buffer. */
2969         commentcnvYY_load_buffer_state( );
2970         (yy_did_buffer_switch_on_eof) = 1;
2971 }
2972
2973 /** Removes and deletes the top of the stack, if present.
2974  *  The next element becomes the new top.
2975  *  
2976  */
2977 void commentcnvYYpop_buffer_state (void)
2978 {
2979         if (!YY_CURRENT_BUFFER)
2980                 return;
2981
2982         commentcnvYY_delete_buffer(YY_CURRENT_BUFFER );
2983         YY_CURRENT_BUFFER_LVALUE = NULL;
2984         if ((yy_buffer_stack_top) > 0)
2985                 --(yy_buffer_stack_top);
2986
2987         if (YY_CURRENT_BUFFER) {
2988                 commentcnvYY_load_buffer_state( );
2989                 (yy_did_buffer_switch_on_eof) = 1;
2990         }
2991 }
2992
2993 /* Allocates the stack if it does not exist.
2994  *  Guarantees space for at least one push.
2995  */
2996 static void commentcnvYYensure_buffer_stack (void)
2997 {
2998         yy_size_t num_to_alloc;
2999     
3000         if (!(yy_buffer_stack)) {
3001
3002                 /* First allocation is just for 2 elements, since we don't know if this
3003                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3004                  * immediate realloc on the next call.
3005          */
3006                 num_to_alloc = 1;
3007                 (yy_buffer_stack) = (struct yy_buffer_state**)commentcnvYYalloc
3008                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
3009                                                                 );
3010                 if ( ! (yy_buffer_stack) )
3011                         YY_FATAL_ERROR( "out of dynamic memory in commentcnvYYensure_buffer_stack()" );
3012                                                                   
3013                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3014                                 
3015                 (yy_buffer_stack_max) = num_to_alloc;
3016                 (yy_buffer_stack_top) = 0;
3017                 return;
3018         }
3019
3020         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3021
3022                 /* Increase the buffer to prepare for a possible push. */
3023                 int grow_size = 8 /* arbitrary grow size */;
3024
3025                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3026                 (yy_buffer_stack) = (struct yy_buffer_state**)commentcnvYYrealloc
3027                                                                 ((yy_buffer_stack),
3028                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
3029                                                                 );
3030                 if ( ! (yy_buffer_stack) )
3031                         YY_FATAL_ERROR( "out of dynamic memory in commentcnvYYensure_buffer_stack()" );
3032
3033                 /* zero only the new slots.*/
3034                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3035                 (yy_buffer_stack_max) = num_to_alloc;
3036         }
3037 }
3038
3039 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3040  * @param base the character buffer
3041  * @param size the size in bytes of the character buffer
3042  * 
3043  * @return the newly allocated buffer state object. 
3044  */
3045 YY_BUFFER_STATE commentcnvYY_scan_buffer  (char * base, yy_size_t  size )
3046 {
3047         YY_BUFFER_STATE b;
3048     
3049         if ( size < 2 ||
3050              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3051              base[size-1] != YY_END_OF_BUFFER_CHAR )
3052                 /* They forgot to leave room for the EOB's. */
3053                 return 0;
3054
3055         b = (YY_BUFFER_STATE) commentcnvYYalloc(sizeof( struct yy_buffer_state )  );
3056         if ( ! b )
3057                 YY_FATAL_ERROR( "out of dynamic memory in commentcnvYY_scan_buffer()" );
3058
3059         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3060         b->yy_buf_pos = b->yy_ch_buf = base;
3061         b->yy_is_our_buffer = 0;
3062         b->yy_input_file = 0;
3063         b->yy_n_chars = b->yy_buf_size;
3064         b->yy_is_interactive = 0;
3065         b->yy_at_bol = 1;
3066         b->yy_fill_buffer = 0;
3067         b->yy_buffer_status = YY_BUFFER_NEW;
3068
3069         commentcnvYY_switch_to_buffer(b  );
3070
3071         return b;
3072 }
3073
3074 /** Setup the input buffer state to scan a string. The next call to commentcnvYYlex() will
3075  * scan from a @e copy of @a str.
3076  * @param yystr a NUL-terminated string to scan
3077  * 
3078  * @return the newly allocated buffer state object.
3079  * @note If you want to scan bytes that may contain NUL values, then use
3080  *       commentcnvYY_scan_bytes() instead.
3081  */
3082 YY_BUFFER_STATE commentcnvYY_scan_string (yyconst char * yystr )
3083 {
3084     
3085         return commentcnvYY_scan_bytes(yystr,strlen(yystr) );
3086 }
3087
3088 /** Setup the input buffer state to scan the given bytes. The next call to commentcnvYYlex() will
3089  * scan from a @e copy of @a bytes.
3090  * @param bytes the byte buffer to scan
3091  * @param len the number of bytes in the buffer pointed to by @a bytes.
3092  * 
3093  * @return the newly allocated buffer state object.
3094  */
3095 YY_BUFFER_STATE commentcnvYY_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
3096 {
3097         YY_BUFFER_STATE b;
3098         char *buf;
3099         yy_size_t n, i;
3100     
3101         /* Get memory for full buffer, including space for trailing EOB's. */
3102         n = _yybytes_len + 2;
3103         buf = (char *) commentcnvYYalloc(n  );
3104         if ( ! buf )
3105                 YY_FATAL_ERROR( "out of dynamic memory in commentcnvYY_scan_bytes()" );
3106
3107         for ( i = 0; i < _yybytes_len; ++i )
3108                 buf[i] = yybytes[i];
3109
3110         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3111
3112         b = commentcnvYY_scan_buffer(buf,n );
3113         if ( ! b )
3114                 YY_FATAL_ERROR( "bad buffer in commentcnvYY_scan_bytes()" );
3115
3116         /* It's okay to grow etc. this buffer, and we should throw it
3117          * away when we're done.
3118          */
3119         b->yy_is_our_buffer = 1;
3120
3121         return b;
3122 }
3123
3124 #ifndef YY_EXIT_FAILURE
3125 #define YY_EXIT_FAILURE 2
3126 #endif
3127
3128 static void yy_fatal_error (yyconst char* msg )
3129 {
3130         (void) fprintf( stderr, "%s\n", msg );
3131         exit( YY_EXIT_FAILURE );
3132 }
3133
3134 /* Redefine yyless() so it works in section 3 code. */
3135
3136 #undef yyless
3137 #define yyless(n) \
3138         do \
3139                 { \
3140                 /* Undo effects of setting up commentcnvYYtext. */ \
3141         int yyless_macro_arg = (n); \
3142         YY_LESS_LINENO(yyless_macro_arg);\
3143                 commentcnvYYtext[commentcnvYYleng] = (yy_hold_char); \
3144                 (yy_c_buf_p) = commentcnvYYtext + yyless_macro_arg; \
3145                 (yy_hold_char) = *(yy_c_buf_p); \
3146                 *(yy_c_buf_p) = '\0'; \
3147                 commentcnvYYleng = yyless_macro_arg; \
3148                 } \
3149         while ( 0 )
3150
3151 /* Accessor  methods (get/set functions) to struct members. */
3152
3153 /** Get the current line number.
3154  * 
3155  */
3156 int commentcnvYYget_lineno  (void)
3157 {
3158         
3159     return commentcnvYYlineno;
3160 }
3161
3162 /** Get the input stream.
3163  * 
3164  */
3165 FILE *commentcnvYYget_in  (void)
3166 {
3167         return commentcnvYYin;
3168 }
3169
3170 /** Get the output stream.
3171  * 
3172  */
3173 FILE *commentcnvYYget_out  (void)
3174 {
3175         return commentcnvYYout;
3176 }
3177
3178 /** Get the length of the current token.
3179  * 
3180  */
3181 yy_size_t commentcnvYYget_leng  (void)
3182 {
3183         return commentcnvYYleng;
3184 }
3185
3186 /** Get the current token.
3187  * 
3188  */
3189
3190 char *commentcnvYYget_text  (void)
3191 {
3192         return commentcnvYYtext;
3193 }
3194
3195 /** Set the current line number.
3196  * @param line_number
3197  * 
3198  */
3199 void commentcnvYYset_lineno (int  line_number )
3200 {
3201     
3202     commentcnvYYlineno = line_number;
3203 }
3204
3205 /** Set the input stream. This does not discard the current
3206  * input buffer.
3207  * @param in_str A readable stream.
3208  * 
3209  * @see commentcnvYY_switch_to_buffer
3210  */
3211 void commentcnvYYset_in (FILE *  in_str )
3212 {
3213         commentcnvYYin = in_str ;
3214 }
3215
3216 void commentcnvYYset_out (FILE *  out_str )
3217 {
3218         commentcnvYYout = out_str ;
3219 }
3220
3221 int commentcnvYYget_debug  (void)
3222 {
3223         return commentcnvYY_flex_debug;
3224 }
3225
3226 void commentcnvYYset_debug (int  bdebug )
3227 {
3228         commentcnvYY_flex_debug = bdebug ;
3229 }
3230
3231 static int yy_init_globals (void)
3232 {
3233         /* Initialization is the same as for the non-reentrant scanner.
3234      * This function is called from commentcnvYYlex_destroy(), so don't allocate here.
3235      */
3236
3237     (yy_buffer_stack) = 0;
3238     (yy_buffer_stack_top) = 0;
3239     (yy_buffer_stack_max) = 0;
3240     (yy_c_buf_p) = (char *) 0;
3241     (yy_init) = 0;
3242     (yy_start) = 0;
3243
3244     (yy_state_buf) = 0;
3245     (yy_state_ptr) = 0;
3246     (yy_full_match) = 0;
3247     (yy_lp) = 0;
3248
3249 /* Defined in main.c */
3250 #ifdef YY_STDINIT
3251     commentcnvYYin = stdin;
3252     commentcnvYYout = stdout;
3253 #else
3254     commentcnvYYin = (FILE *) 0;
3255     commentcnvYYout = (FILE *) 0;
3256 #endif
3257
3258     /* For future reference: Set errno on error, since we are called by
3259      * commentcnvYYlex_init()
3260      */
3261     return 0;
3262 }
3263
3264 /* commentcnvYYlex_destroy is for both reentrant and non-reentrant scanners. */
3265 int commentcnvYYlex_destroy  (void)
3266 {
3267     
3268     /* Pop the buffer stack, destroying each element. */
3269         while(YY_CURRENT_BUFFER){
3270                 commentcnvYY_delete_buffer(YY_CURRENT_BUFFER  );
3271                 YY_CURRENT_BUFFER_LVALUE = NULL;
3272                 commentcnvYYpop_buffer_state();
3273         }
3274
3275         /* Destroy the stack itself. */
3276         commentcnvYYfree((yy_buffer_stack) );
3277         (yy_buffer_stack) = NULL;
3278
3279     commentcnvYYfree ( (yy_state_buf) );
3280     (yy_state_buf)  = NULL;
3281
3282     /* Reset the globals. This is important in a non-reentrant scanner so the next time
3283      * commentcnvYYlex() is called, initialization will occur. */
3284     yy_init_globals( );
3285
3286     return 0;
3287 }
3288
3289 /*
3290  * Internal utility routines.
3291  */
3292
3293 #ifndef yytext_ptr
3294 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3295 {
3296         register int i;
3297         for ( i = 0; i < n; ++i )
3298                 s1[i] = s2[i];
3299 }
3300 #endif
3301
3302 #ifdef YY_NEED_STRLEN
3303 static int yy_flex_strlen (yyconst char * s )
3304 {
3305         register int n;
3306         for ( n = 0; s[n]; ++n )
3307                 ;
3308
3309         return n;
3310 }
3311 #endif
3312
3313 void *commentcnvYYalloc (yy_size_t  size )
3314 {
3315         return (void *) malloc( size );
3316 }
3317
3318 void *commentcnvYYrealloc  (void * ptr, yy_size_t  size )
3319 {
3320         /* The cast to (char *) in the following accommodates both
3321          * implementations that use char* generic pointers, and those
3322          * that use void* generic pointers.  It works with the latter
3323          * because both ANSI C and C++ allow castless assignment from
3324          * any pointer type to void*, and deal with argument conversions
3325          * as though doing an assignment.
3326          */
3327         return (void *) realloc( (char *) ptr, size );
3328 }
3329
3330 void commentcnvYYfree (void * ptr )
3331 {
3332         free( (char *) ptr );   /* see commentcnvYYrealloc() for (char *) cast */
3333 }
3334
3335 #define YYTABLES_NAME "yytables"
3336
3337 #line 780 "commentcnv.l"
3338
3339
3340
3341 void replaceComment(int offset)
3342 {
3343   if (g_mlBrief)
3344   {
3345     copyToOutput(commentcnvYYtext,(int)commentcnvYYleng);
3346   }
3347   else
3348   {
3349     //printf("replaceComment(%s)\n",commentcnvYYtext);
3350     int i=computeIndent(&commentcnvYYtext[offset]);
3351     if (i==g_blockHeadCol)
3352     {
3353       replaceCommentMarker(commentcnvYYtext,(int)commentcnvYYleng);
3354     }
3355     else
3356     {
3357       copyToOutput(" */",3);
3358       int i;for (i=(int)commentcnvYYleng-1;i>=0;i--) unput(commentcnvYYtext[i]);
3359       g_inSpecialComment=FALSE;
3360       BEGIN(Scan);                                            
3361     }                                                         
3362   }
3363 }
3364
3365 /*! This function does three things:
3366  *  -# It converts multi-line C++ style comment blocks (that are aligned)
3367  *     to C style comment blocks (if MULTILINE_CPP_IS_BRIEF is set to NO).
3368  *  -# It replaces aliases with their definition (see ALIASES)
3369  *  -# It handles conditional sections (cond...endcond blocks)
3370  */
3371 void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
3372 {
3373   //printf("convertCppComments(%s)\n",fileName);
3374   g_inBuf    = inBuf;
3375   g_outBuf   = outBuf;
3376   g_inBufPos = 0;
3377   g_col      = 0;
3378   g_mlBrief = Config_getBool("MULTILINE_CPP_IS_BRIEF");
3379   g_skip     = FALSE;
3380   g_fileName = fileName;
3381   g_lang = getLanguageFromFileName(fileName);
3382   g_pythonDocString = FALSE;
3383   g_lineNr   = 1;
3384   g_condStack.clear();
3385   g_condStack.setAutoDelete(TRUE);
3386   if (g_lang==SrcLangExt_Markdown)
3387   {
3388     BEGIN(CComment);
3389   }
3390   else
3391   {
3392     BEGIN(Scan);
3393   }
3394   commentcnvYYlex();
3395   while (!g_condStack.isEmpty())
3396   {
3397     CondCtx *ctx = g_condStack.pop();
3398     QCString sectionInfo = " ";
3399     if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data()); 
3400     warn(g_fileName,ctx->lineNr,"Conditional section%sdoes not have "
3401         "a corresponding \\endcond command within this file.",sectionInfo.data());
3402   }
3403   if (Debug::isFlagSet(Debug::CommentCnv))
3404   {
3405     g_outBuf->at(g_outBuf->curPos())='\0';
3406     msg("-------------\n%s\n-------------\n",g_outBuf->data());
3407   }
3408 }
3409
3410
3411 //----------------------------------------------------------------------------
3412 #if !defined(YY_FLEX_SUBMINOR_VERSION) 
3413 extern "C" { // some bogus code to keep the compiler happy
3414     void commentcnvYYdummy() { yy_flex_realloc(0,0); } 
3415 }
3416 #endif
3417
3418