Fix for UBSan build
[platform/upstream/doxygen.git] / src / pycode.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 pycodeYY_create_buffer
9 #define yy_delete_buffer pycodeYY_delete_buffer
10 #define yy_flex_debug pycodeYY_flex_debug
11 #define yy_init_buffer pycodeYY_init_buffer
12 #define yy_flush_buffer pycodeYY_flush_buffer
13 #define yy_load_buffer_state pycodeYY_load_buffer_state
14 #define yy_switch_to_buffer pycodeYY_switch_to_buffer
15 #define yyin pycodeYYin
16 #define yyleng pycodeYYleng
17 #define yylex pycodeYYlex
18 #define yylineno pycodeYYlineno
19 #define yyout pycodeYYout
20 #define yyrestart pycodeYYrestart
21 #define yytext pycodeYYtext
22 #define yywrap pycodeYYwrap
23 #define yyalloc pycodeYYalloc
24 #define yyrealloc pycodeYYrealloc
25 #define yyfree pycodeYYfree
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 pycodeYYrestart(pycodeYYin  )
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 pycodeYYleng;
181
182 extern FILE *pycodeYYin, *pycodeYYout;
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 pycodeYYtext. */ \
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 pycodeYYtext 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 pycodeYYrestart()), so that the user can continue scanning by
264          * just pointing pycodeYYin 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 pycodeYYtext 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 pycodeYYleng;
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 pycodeYYwrap()'s to do buffer switches
302  * instead of setting up a fresh pycodeYYin.  A bit of a hack ...
303  */
304 static int yy_did_buffer_switch_on_eof;
305
306 void pycodeYYrestart (FILE *input_file  );
307 void pycodeYY_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
308 YY_BUFFER_STATE pycodeYY_create_buffer (FILE *file,int size  );
309 void pycodeYY_delete_buffer (YY_BUFFER_STATE b  );
310 void pycodeYY_flush_buffer (YY_BUFFER_STATE b  );
311 void pycodeYYpush_buffer_state (YY_BUFFER_STATE new_buffer  );
312 void pycodeYYpop_buffer_state (void );
313
314 static void pycodeYYensure_buffer_stack (void );
315 static void pycodeYY_load_buffer_state (void );
316 static void pycodeYY_init_buffer (YY_BUFFER_STATE b,FILE *file  );
317
318 #define YY_FLUSH_BUFFER pycodeYY_flush_buffer(YY_CURRENT_BUFFER )
319
320 YY_BUFFER_STATE pycodeYY_scan_buffer (char *base,yy_size_t size  );
321 YY_BUFFER_STATE pycodeYY_scan_string (yyconst char *yy_str  );
322 YY_BUFFER_STATE pycodeYY_scan_bytes (yyconst char *bytes,yy_size_t len  );
323
324 void *pycodeYYalloc (yy_size_t  );
325 void *pycodeYYrealloc (void *,yy_size_t  );
326 void pycodeYYfree (void *  );
327
328 #define yy_new_buffer pycodeYY_create_buffer
329
330 #define yy_set_interactive(is_interactive) \
331         { \
332         if ( ! YY_CURRENT_BUFFER ){ \
333         pycodeYYensure_buffer_stack (); \
334                 YY_CURRENT_BUFFER_LVALUE =    \
335             pycodeYY_create_buffer(pycodeYYin,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         pycodeYYensure_buffer_stack (); \
344                 YY_CURRENT_BUFFER_LVALUE =    \
345             pycodeYY_create_buffer(pycodeYYin,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 pycodeYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
356
357 typedef unsigned char YY_CHAR;
358
359 FILE *pycodeYYin = (FILE *) 0, *pycodeYYout = (FILE *) 0;
360
361 typedef int yy_state_type;
362
363 extern int pycodeYYlineno;
364
365 int pycodeYYlineno = 1;
366
367 extern char *pycodeYYtext;
368 #define yytext_ptr pycodeYYtext
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 pycodeYYtext.
377  */
378 #define YY_DO_BEFORE_ACTION \
379         (yytext_ptr) = yy_bp; \
380         pycodeYYleng = (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 61
386 #define YY_END_OF_BUFFER 62
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[957] =
395     {   0,
396     16416,16416,   62,   60,   61,   59,   60,   61,   58,   61,
397        56,   60,   61,   57,   60,   61,   55,   60,   61,   60,
398        61,   60,   61,   60,   61,   35,   58,   61,   20,   34,
399        60,   61,   20,   34,   60,   61,   20,   34,   60,   61,
400        20,   34,   60,   61,   20,   34,   60,   61,   20,   34,
401        60,   61,   20,   34,   60,   61,   20,   34,   60,   61,
402        20,   34,   60,   61,   20,   34,   60,   61,   20,   34,
403        60,   61,   20,   34,   60,   61,   20,   34,   60,   61,
404        20,   34,   60,   61,   20,   34,   60,   61,   20,   34,
405        60,   61,   20,   34,   60,   61,   20,   34,   60,   61,
406
407        20,   34,   60,   61,   20,   34,   60,   61,   20,   34,
408        60,   61,   20,   34,   60,   61,   20,   34,   60,   61,
409        20,   34,   60,   61,   59,   60,   61,   11,   60,   61,
410        10,   60,   61,   10,   60,   61,   10,   60,   61,   10,
411        60,   61,   13,   60,   61,   12,   59,   60,   61,   13,
412        56,   60,   61,   13,   57,   60,   61,   13,   55,   60,
413        61,   14,   60,   61,   12,   13,   60,   61,   15,   60,
414        61,   13,   60,   61,   13,   60,   61,   13,   60,   61,
415        13,   60,   61,    6,   60,   61,    6,   60,   61,    6,
416        60,   61,    6,   60,   61,    7,   59,   60,   61,    7,
417
418        60,   61,    9,   60,   61,    8,   60,   61,    8,   60,
419        61,    8,   60,   61,    8,   60,   61,   33,   58,   61,
420        20,   60,   61,   20,   60,   61,   20,   60,   61,   20,
421        60,   61,   20,   60,   61,   20,   60,   61,   20,   60,
422        61,   20,   60,   61,   20,   60,   61,   20,   60,   61,
423        20,   60,   61,   20,   60,   61,   20,   60,   61,   20,
424        60,   61,   20,   60,   61,   20,   60,   61,   20,   60,
425        61,   20,   60,   61,   20,   60,   61,   20,   60,   61,
426        20,   60,   61,   20,   60,   61,   20,   60,   61,   20,
427        60,   61,   29,   59,   60,   61,   28,   58,   61,   21,
428
429        59,   60,   61,   27,   58,   61,   26,   57,   60,   61,
430        25,   60,   61,   25,   60,   61,   25,   60,   61,   25,
431        60,   61,   25,   60,   61,   25,   60,   61,   25,   60,
432        61,   25,   60,   61,   25,   60,   61,   25,   60,   61,
433        25,   60,   61,   25,   60,   61,   25,   60,   61,   25,
434        60,   61,   25,   60,   61,   25,   60,   61,   25,   60,
435        61,   25,   60,   61,   25,   60,   61,   25,   60,   61,
436        25,   60,   61,   25,   60,   61,   59,   60,   61,16414,
437        31,   58,   61, 8224,   60,   61, 8224,   57,   60,   61,
438      8224,   60,   61, 8224,   60,   61, 8224,   60,   61,   40,
439
440        41,   60,   61,   40,   41,   59,   60,   61,   41,   56,
441        60,   61,   40,   41,   57,   60,   61,   39,   41,   55,
442        60,   61,   40,   41,   60,   61,   40,   41,   60,   61,
443        41,   60,   61,   40,   41,   60,   61,   46,   47,   60,
444        61,   46,   47,   59,   60,   61,   45,   47,   56,   60,
445        61,   46,   47,   57,   60,   61,   47,   55,   60,   61,
446        46,   47,   60,   61,   46,   47,   60,   61,   47,   60,
447        61,   46,   47,   60,   61,   50,   52,   60,   61,   50,
448        52,   59,   60,   61,   50,   51,   58,   61,   50,   52,
449        56,   60,   61,   50,   52,   57,   60,   61,   50,   52,
450
451        55,   60,   61,   50,   52,   60,   61,   50,   52,   60,
452        61,   52,   60,   61,   50,   52,   60,   61,   59,   57,
453        56,   55,   18,   20,   34,   20,   34,   20,   34,   20,
454        34,   20,   34,   20,   34,   16,   20,   34,   20,   34,
455        20,   34,   20,   34,   20,   34,   20,   34,   20,   34,
456        20,   34,   20,   34,   20,   34,   20,   34,   17,   20,
457        34,   20,   34,   17,   20,   34,   20,   34,   20,   34,
458        20,   34,   20,   34,   20,   34,   20,   34,   20,   34,
459        20,   34,   20,   34,   20,   34,   59,   11,   10,   10,
460        13,   12,   59,   13,   13,   57,   13,   13,   13,   56,
461
462        13,   55,   13,    6,    6,    7,   59,    8,    8,   20,
463        20,   20,   20,   20,   20,   16,   20,   20,   20,   20,
464        20,   20,   20,   20,   20,   20,   20,   17,   20,   20,
465        17,   20,   20,   20,   20,   20,   20,   20,   20,   20,
466        20,   20,   29,   59,   28,   21,   59,   26,   57,   25,
467        25,   25,   25,   25,   23,   25,   25,   25,   25,   25,
468        25,   25,   25,   25,   25,   25,   24,   25,   25,   24,
469        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
470        59,16414,   31, 8222,   40,   40,   59,   40,   57,   56,
471        40,   37,   37,   36,   46,   46,   59,   46,   57,   55,
472
473        46,   43,   43,   42,   50,   50,   59,   50,   50,   57,
474        57,   50,   50,   54,   53,   19,   20,   34,   20,   34,
475        20,   34,   20,   34,   20,   34,   20,   34,   20,   34,
476        16,   20,   34,   20,   34,   20,   34,   20,   34,   20,
477        34,   20,   34,   20,   34,   20,   34,   20,   34,   20,
478        34,   20,   34,   20,   34,   20,   34,   20,   34,   20,
479        34,   20,   34,   13,   54,   13,   53,    8,   20,   20,
480        20,   20,   20,   20,   20,   16,   20,   20,   20,   20,
481        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
482        20,   20,   25,   25,   25,   25,   25,   25,   23,   25,
483
484        25,   25,   25,   25,   25,   25,   25,   25,   25,   25,
485        25,   25,   25,   25,   38,   54,   44,   53,   48,   54,
486        49,   53,   19,   20,   34,    3,   20,   34,   16,   20,
487        34,   20,   34,   20,   34,   20,   34,   20,   34,    1,
488        20,   34,   20,   34,   20,   34,   20,   34,   20,   34,
489        20,   34,   20,   34,   20,   34,   20,   34,   20,   34,
490        20,   34,   20,    3,   20,   16,   20,   20,   20,   20,
491        20,   20,   20,   20,   20,   20,   20,   20,   20,   20,
492        20,   20,   25,   25,   25,   25,   25,   25,   25,   25,
493        25,   25,   22,   24,   25,   25,   25,   25,   25,   25,
494
495        20,   34,   16,   20,   34,   20,   34,   20,   34,   20,
496        34,   20,   34,   20,   34,   20,   34,   20,   34,   20,
497        16,   20,   20,   20,   20,   20,   20,   20,   20,   25,
498        25,   25,   25,   25,   25,   25,   25,    2,   20,   34,
499        20,   34,    5,   19,   20,   20,   25,   25,   20,   34,
500         4,   18,    5,   19,   20,   25
501     } ;
502
503 static yyconst flex_int16_t yy_accept[506] =
504     {   0,
505         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
506         1,    1,    1,    1,    1,    1,    1,    1,    1,    2,
507         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
508         3,    4,    6,    9,   11,   14,   17,   20,   22,   24,
509        26,   29,   33,   37,   41,   45,   49,   53,   57,   61,
510        65,   69,   73,   77,   81,   85,   89,   93,   97,  101,
511       105,  109,  113,  117,  121,  125,  128,  131,  134,  137,
512       140,  143,  146,  150,  154,  158,  162,  165,  169,  172,
513       175,  178,  181,  184,  187,  190,  193,  196,  200,  203,
514       206,  209,  212,  215,  218,  221,  224,  227,  230,  233,
515
516       236,  239,  242,  245,  248,  251,  254,  257,  260,  263,
517       266,  269,  272,  275,  278,  281,  284,  287,  290,  293,
518       297,  300,  304,  307,  311,  314,  317,  320,  323,  326,
519       329,  332,  335,  338,  341,  344,  347,  350,  353,  356,
520       359,  362,  365,  368,  371,  374,  377,  381,  384,  387,
521       391,  394,  397,  400,  404,  409,  413,  418,  423,  427,
522       431,  434,  438,  442,  447,  452,  457,  461,  465,  469,
523       472,  476,  480,  485,  489,  494,  499,  504,  508,  512,
524       515,  519,  520,  520,  521,  521,  522,  523,  523,  524,
525       524,  526,  528,  530,  532,  534,  536,  539,  541,  543,
526
527       545,  547,  549,  551,  553,  555,  557,  559,  562,  564,
528       567,  569,  571,  573,  575,  577,  579,  581,  583,  585,
529       587,  588,  589,  590,  591,  592,  594,  595,  597,  598,
530       599,  601,  603,  604,  605,  606,  608,  608,  609,  610,
531       611,  612,  613,  614,  615,  616,  618,  619,  620,  621,
532       622,  623,  624,  625,  626,  627,  628,  630,  631,  633,
533       634,  635,  636,  637,  638,  639,  640,  641,  642,  643,
534       645,  646,  648,  650,  651,  652,  653,  654,  655,  657,
535       658,  659,  660,  661,  662,  663,  664,  665,  666,  667,
536       669,  670,  672,  673,  674,  675,  676,  677,  678,  679,
537
538       680,  681,  683,  684,  685,  686,  688,  688,  690,  691,
539       692,  693,  694,  695,  696,  698,  700,  700,  701,  702,
540       703,  704,  705,  706,  706,  708,  709,  711,  712,  713,
541       714,  715,  716,  717,  719,  721,  723,  725,  727,  729,
542       731,  734,  736,  738,  740,  742,  744,  746,  748,  750,
543       752,  754,  756,  758,  760,  762,  764,  766,  768,  769,
544       770,  771,  772,  773,  774,  775,  776,  778,  779,  780,
545       781,  782,  783,  784,  785,  786,  787,  788,  789,  790,
546       791,  792,  793,  794,  795,  796,  797,  798,  799,  801,
547       802,  803,  804,  805,  806,  807,  808,  809,  810,  811,
548
549       812,  813,  814,  815,  817,  817,  819,  819,  821,  823,
550       824,  826,  829,  832,  834,  836,  838,  840,  841,  843,
551       845,  847,  849,  851,  853,  855,  857,  859,  861,  863,
552       864,  866,  868,  869,  870,  871,  872,  873,  874,  875,
553       876,  877,  878,  879,  880,  881,  882,  883,  884,  885,
554       886,  887,  888,  889,  890,  891,  892,  893,  896,  897,
555       898,  899,  900,  901,  903,  906,  908,  910,  912,  914,
556       916,  918,  920,  920,  921,  923,  924,  925,  926,  927,
557       928,  929,  930,  931,  932,  933,  934,  935,  936,  937,
558       938,  939,  941,  943,  945,  946,  947,  948,  949,  951,
559
560       953,  955,  956,  957,  957
561     } ;
562
563 static yyconst flex_int32_t yy_ec[256] =
564     {   0,
565         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
566         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
567         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
568         1,    2,    4,    5,    6,    1,    4,    4,    7,    8,
569         9,    4,    4,   10,    4,   11,    4,   12,   12,   12,
570        12,   12,   12,   12,   12,   12,   12,   13,    4,    4,
571         4,    4,    1,    1,   14,   14,   14,   14,   14,   15,
572        14,   14,   14,   14,   14,   14,   14,   16,   14,   14,
573        14,   17,   14,   18,   19,   14,   14,   14,   14,   14,
574         4,   20,    4,    1,   21,    4,   22,   23,   24,   25,
575
576        26,   27,   28,   29,   30,   14,   31,   32,   33,   34,
577        35,   36,   14,   37,   38,   39,   40,   14,   41,   42,
578        43,   14,    4,    4,    4,    4,    1,    1,    1,    1,
579         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
580         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
581         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
582         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
583         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
584         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
585         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
586
587         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
588         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
589         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
590         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
591         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
592         1,    1,    1,    1,    1
593     } ;
594
595 static yyconst flex_int32_t yy_meta[44] =
596     {   0,
597         1,    2,    3,    4,    5,    4,    5,    6,    2,    4,
598         7,    8,    2,    9,    9,    9,    9,    9,    9,   10,
599         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
600         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
601         9,    9,    9
602     } ;
603
604 static yyconst flex_int16_t yy_base[535] =
605     {   0,
606         0,   39,   79,    0,  122,    0,  165,    0,  208,    0,
607       251,    0,  294,    0,    6,    8,  337,    0,  380,  420,
608         0,    0,    0,    0,  459,  498,  537,  576,  615,  654,
609      1626, 1627, 1623, 1627, 1596,    0, 1572,    7,   11,   15,
610      1627,   13,   25,   15,   46,   23,  387,   27,  382,  380,
611        51,  398,  399,  400,  420,   56,  433,  405,  437,  462,
612       392,  435,  475,  427,   19,   61, 1627,    0,    8,  470,
613       504,    0, 1570, 1565,  489, 1543, 1627,    0, 1627,  694,
614       714,   38,  434,    0,   61,  509,  515, 1541, 1627, 1627,
615      1530,  518,  548,  553, 1627,   62,  441,  502,  523,  482,
616
617       592,  537,  525,  576,  565,  594,  593,  578,  604,  539,
618       516,  555,  632,  640,  638,  561,  670,  657,  633,   69,
619      1627, 1531, 1627,    0,    0, 1498,  501, 1467,  665,    5,
620      1464,  370, 1474,  453,  653, 1459,  679, 1462, 1446, 1443,
621       602,  704, 1428,  722, 1382, 1380,  565, 1627, 1627,    0,
622       620,  726,  730,    0, 1405, 1401,  703, 1398,  731,  735,
623       604,  739,    0, 1402, 1398,  744, 1393,  743,  748,  677,
624       753, 1379,  394, 1378, 1391,  766, 1388,  761,  772,  775,
625       786, 1391, 1387,    0, 1383, 1380, 1371,  789, 1627,    0,
626       642,  776,  787,  789,  794,  799,  803,  804,  681,  805,
627
628       809,  814,  823,  824,  685,  829,  834,  746,  835,  840,
629       842,  846,  848,  852,  854,  859,  865,  866,  870,  879,
630       586, 1627,    0,  821,    0, 1367, 1347,  886, 1337,  861,
631      1337, 1330,    0,    0,  884, 1333,    0, 1320,  896,  872,
632       885,  900,  902,  907,  908,  912,  913,  914,  918,  919,
633       924,  920,  929,  930,  937,  945,  947,  949,  953,  957,
634       958,  962,  963,  968,  967,  973,  975,  980,  981,  682,
635      1627, 1314,    0,    0, 1282, 1261,  897, 1270, 1249, 1255,
636      1258, 1228, 1233,  451, 1231, 1214, 1204, 1192, 1191,    0,
637      1186,    0, 1188, 1157, 1156, 1160, 1153, 1143, 1130, 1139,
638
639      1126,  759, 1627, 1627,    0, 1145, 1132,  989, 1114,  942,
640      1627,  772, 1627,    0, 1115,  994, 1108, 1093,  997, 1627,
641       816, 1627, 1078, 1008,  656, 1084, 1014, 1069, 1063, 1015,
642      1627, 1627, 1015, 1016, 1017, 1021, 1022, 1028, 1029, 1030,
643      1044, 1034, 1045, 1049, 1051, 1055, 1057, 1066, 1068, 1070,
644      1075, 1074, 1076, 1084, 1082, 1086,    0,    0, 1053, 1088,
645      1094, 1095, 1096, 1102, 1117, 1119, 1121, 1123, 1125, 1127,
646      1132, 1131, 1133, 1137, 1138, 1149, 1151, 1155, 1157, 1159,
647      1163, 1167, 1020, 1025, 1023, 1022,  993,  977,    0,  985,
648       982,  977,  973,  954,  959,  942,  936,  913,  909,  868,
649
650       852,  847,  840, 1627, 1174, 1627, 1177, 1627, 1627, 1173,
651      1180, 1181, 1190, 1192, 1194, 1196, 1200,  859, 1201, 1206,
652      1202, 1207, 1208, 1212, 1220, 1224, 1228, 1232, 1234, 1239,
653      1241, 1245, 1246, 1255, 1256, 1260, 1261, 1266, 1262, 1267,
654      1268, 1274, 1280, 1281, 1288, 1294, 1292,  829,  812,  807,
655       795,  797,  768,  756,  761,  708,  716,    0,  693,  702,
656       679,  671,  642, 1299, 1313, 1300, 1301, 1311, 1315, 1317,
657      1319, 1321,    0, 1325, 1337, 1338, 1342, 1343, 1350, 1349,
658      1351, 1355,  594,  585,  575,  548,  517,  455,  433,  416,
659       431, 1357, 1359, 1363, 1368, 1369,  361,  346, 1375, 1627,
660
661      1376, 1383,  358, 1627, 1412, 1422, 1432, 1442, 1452, 1462,
662      1467, 1469, 1478, 1488, 1498, 1501, 1504, 1508, 1517, 1520,
663      1528, 1538, 1547, 1557, 1567, 1576, 1586, 1596, 1606,   65,
664        20, 1611,   16, 1615
665     } ;
666
667 static yyconst flex_int16_t yy_def[535] =
668     {   0,
669       505,  505,  504,    3,  504,    5,  504,    7,  504,    9,
670       504,   11,  504,   13,    2,    2,  504,   17,  506,  506,
671         2,    2,    2,    2,  507,  507,  508,  508,  509,  509,
672       504,  504,  504,  504,  504,  510,  504,  504,  504,  504,
673       504,  511,  511,  511,  511,  511,  511,  511,  511,  511,
674       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
675       511,  511,  511,  511,  511,  504,  504,  512,  512,  512,
676       512,  513,  504,  513,  514,  513,  504,  513,  504,  515,
677       515,   81,   81,  516,  516,  516,  516,  504,  504,  504,
678       517,  517,  517,  517,  504,  518,  518,  518,  518,  518,
679
680       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
681       518,  518,  518,  518,  518,  518,  518,  518,  518,  504,
682       504,  504,  504,  519,  520,  520,  520,  520,  520,  520,
683       520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
684       520,  520,  520,  520,  520,  520,  521,  504,  504,  510,
685       504,  504,  504,  522,  522,  504,  523,  504,  522,  522,
686       524,  522,  525,  525,  504,  526,  504,  525,  525,  527,
687       525,  528,  528,  528,  504,  529,  504,  528,  528,  528,
688       528,  504,  504,  510,  504,  504,  504,  504,  504,  530,
689       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
690
691       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
692       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
693       504,  504,  512,  512,  513,  504,  513,  514,  513,   81,
694       513,  513,   81,  516,  516,  504,  531,  517,  517,  518,
695       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
696       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
697       518,  518,  518,  518,  518,  518,  518,  518,  518,  504,
698       504,  504,  519,  520,  520,  520,  520,  520,  520,  520,
699       520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
700       520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
701
702       520,  521,  504,  504,  522,  522,  504,  523,  504,  522,
703       504,  504,  504,  525,  525,  526,  504,  504,  525,  504,
704       504,  504,  528,  528,  528,  504,  529,  529,  504,  528,
705       504,  504,  532,  511,  511,  511,  511,  511,  511,  511,
706       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
707       511,  511,  511,  511,  511,  511,  513,  513,  517,  518,
708       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
709       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
710       518,  518,  520,  520,  520,  520,  520,  520,  520,  520,
711       520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
712
713       520,  520,  520,  504,  504,  504,  504,  504,  504,  532,
714       511,  511,  511,  511,  511,  511,  511,  504,  511,  511,
715       511,  511,  511,  511,  511,  511,  511,  511,  511,  518,
716       518,  518,  518,  518,  518,  518,  518,  518,  518,  518,
717       518,  518,  518,  518,  518,  518,  518,  520,  520,  520,
718       520,  520,  520,  520,  520,  520,  520,  520,  520,  520,
719       520,  520,  520,  511,  511,  511,  511,  511,  511,  511,
720       511,  511,  533,  518,  518,  518,  518,  518,  518,  518,
721       518,  518,  520,  520,  520,  520,  520,  520,  520,  520,
722       504,  511,  511,  534,  518,  518,  520,  520,  511,  504,
723
724       534,  518,  520,    0,  504,  504,  504,  504,  504,  504,
725       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
726       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
727       504,  504,  504,  504
728     } ;
729
730 static yyconst flex_int16_t yy_nxt[1671] =
731     {   0,
732       504,   33,   34,  504,   35,   36,   37,  120,  121,  120,
733       121,  186,  186,  187,  187,  186,   38,  187,   39,  186,
734       189,  187,  189,  190,  494,  190,  189,  188,  359,  190,
735       189,  188,  189,  190,  189,  190,   38,  190,  278,   40,
736        33,   34,  279,   35,   36,   37,  192,  188,  220,  193,
737       186,  188,  187,  189,  233,   38,  190,   39,  189,  194,
738       196,  190,  221,  189,  197,  186,  190,  187,  222,  189,
739       270,  271,  190,  333,  233,   38,  201,  211,   40,   32,
740        33,   41,   32,   35,   36,   37,   32,   32,   32,   32,
741        32,   32,   42,   43,   44,   45,   46,   47,   32,   42,
742
743        48,   49,   50,   51,   52,   53,   54,   42,   55,   42,
744        56,   42,   57,   58,   59,   60,   61,   62,   63,   64,
745        42,   65,   32,   66,   34,   32,   35,   36,   37,   67,
746        32,   32,   32,   32,   32,   68,   68,   68,   69,   68,
747        70,   32,   68,   68,   68,   68,   68,   68,   68,   68,
748        68,   68,   68,   68,   68,   68,   68,   68,   69,   68,
749        68,   71,   68,   68,   68,   72,   73,   34,   72,   74,
750        75,   76,   32,   77,   78,   72,   72,   79,   80,   80,
751        80,   81,   80,   82,   72,   80,   80,   80,   80,   80,
752        80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
753
754        80,   81,   80,   80,   83,   80,   80,   80,   32,   33,
755        34,   32,   35,   36,   37,   32,   32,   32,   32,   32,
756        32,   84,   84,   84,   85,   84,   86,   32,   84,   84,
757        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
758        84,   84,   84,   84,   85,   84,   84,   87,   84,   84,
759        84,   32,   88,   34,   32,   35,   36,   37,   89,   89,
760        89,   32,   32,   90,   91,   91,   91,   92,   91,   93,
761        32,   91,   91,   91,   91,   91,   91,   91,   91,   91,
762        91,   91,   91,   91,   91,   91,   91,   92,   91,   91,
763        94,   91,   91,   91,   32,   33,   95,   32,   35,   36,
764
765        37,   32,   32,   32,   32,   32,   32,   96,   97,   98,
766        99,  100,  101,   32,   96,  102,  103,  104,  105,  106,
767       107,  108,   96,  109,   96,  110,   96,  111,  112,  113,
768       114,  115,  116,  117,  118,   96,  119,   32,  122,  123,
769        32,   35,  124,   37,   32,   32,   32,   32,   32,   32,
770       125,  126,  125,  127,  128,  129,   32,  125,  130,  131,
771       132,  133,  134,  135,  136,  125,  137,  125,  138,  125,
772       139,  140,  141,  142,  125,  143,  144,  145,  125,  146,
773        32,  147,  148,  292,   35,  150,   37,  189,  292,  189,
774       190,  186,  190,  187,  189,  325,  151,  190,  152,  189,
775
776       503,  281,  190,  195,  282,  189,  189,  189,  190,  190,
777       190,  199,  189,  324,  200,  190,  151,  217,  198,  153,
778        32,  147,  148,  195,   35,  150,   37,  189,  204,  202,
779       190,  207,  491,  205,  189,  206,  151,  190,  152,  203,
780       189,  210,  189,  190,  189,  190,  208,  190,  189,  292,
781       233,  190,  209,  210,  389,  219,  151,  210,  213,  153,
782       155,   34,  241,  156,  157,  158,  186,  212,  187,  189,
783       233,  218,  190,  214,  186,  159,  187,  160,  161,  186,
784       390,  187,  189,  215,  284,  190,  224,  216,  391,  189,
785       184,  195,  190,  389,  285,  159,  184,  184,  162,  155,
786
787        34,  184,  156,  157,  158,  186,  224,  187,  186,  189,
788       187,  195,  190,  186,  159,  187,  160,  161,  243,  186,
789       224,  187,  186,  189,  187,  235,  190,  186,  237,  187,
790       189,  235,  189,  190,  159,  190,  242,  162,  164,   34,
791       224,  165,  166,  167,  189,  235,  189,  190,  389,  190,
792       261,  235,  186,  168,  187,  169,  170,  186,  237,  187,
793       260,  247,  189,  237,  239,  190,  302,  303,  189,  239,
794       245,  190,  189,  168,  246,  190,  171,  164,   34,  498,
795       165,  166,  167,  189,  239,  189,  190,  221,  190,  239,
796       250,  259,  168,  222,  169,  170,  186,  267,  187,  189,
797
798       189,  189,  190,  190,  190,  312,  313,  248,  244,  256,
799       249,  189,  168,  292,  190,  171,  173,  174,  497,  175,
800       176,  177,  253,  295,  186,  251,  187,  254,  244,  255,
801       257,  178,  389,  179,  180,  252,  258,  259,  296,  189,
802       189,  259,  190,  190,  186,  189,  187,  189,  190,  189,
803       190,  178,  190,  262,  181,  173,  174,  325,  175,  176,
804       177,  264,  269,  266,  189,  265,  292,  190,  263,  186,
805       178,  187,  179,  180,  186,  324,  187,  189,  321,  322,
806       190,  277,  286,  270,  271,  268,  244,  287,  189,  288,
807       178,  190,  189,  181,  225,  190,  292,  225,  225,  225,
808
809       225,  277,  339,  225,  225,  290,  244,  184,  186,  184,
810       187,  291,  292,  225,  225,  490,  292,  225,  231,  225,
811       232,  210,  184,  225,  225,  297,  186,  292,  187,  298,
812       186,  292,  187,  225,  186,  309,  187,  187,  277,  309,
813       489,  187,  188,  309,  488,  187,  188,  186,  184,  318,
814       184,  310,  186,  189,  318,  310,  190,  186,  277,  318,
815       302,  303,  188,  184,  319,  186,  188,  187,  323,  319,
816       184,  310,  184,  405,  313,  310,  186,  504,  187,  323,
817       324,  323,  487,  189,  319,  328,  190,  486,  330,  319,
818       186,  324,  187,  186,  189,  187,  189,  190,  186,  190,
819
820       187,  189,  330,  485,  190,  324,  189,  334,  330,  190,
821       189,  189,  189,  190,  190,  190,  189,  407,  322,  190,
822       335,  189,  330,  210,  190,  186,  484,  187,  336,  338,
823       189,  189,  389,  190,  190,  341,  189,  292,  340,  190,
824       337,  189,  189,  342,  190,  190,  344,  189,  483,  189,
825       190,  343,  190,  189,  389,  189,  190,  345,  190,  189,
826       418,  189,  190,  346,  190,  225,  189,  225,  347,  190,
827       348,  463,  189,  189,  349,  190,  190,  189,  462,  189,
828       190,  351,  190,  352,  210,  350,  189,  184,  186,  190,
829       187,  461,  189,  184,  184,  190,  354,  353,  184,  355,
830
831       186,  186,  187,  187,  356,  460,  237,  189,  210,  189,
832       190,  186,  190,  187,  189,  189,  360,  190,  190,  189,
833       189,  189,  190,  190,  190,  189,  189,  189,  190,  190,
834       190,  189,  259,  361,  190,  365,  189,  189,  364,  190,
835       190,  362,  459,  370,  189,  367,  309,  190,  187,  363,
836       458,  366,  189,  368,  189,  190,  189,  190,  457,  190,
837       189,  369,  371,  190,  189,  189,  259,  190,  190,  189,
838       189,  372,  190,  190,  189,  189,  456,  190,  190,  373,
839       189,  455,  189,  190,  374,  190,  389,  189,  189,  375,
840       190,  190,  377,  184,  454,  184,  259,  378,  184,  376,
841
842       184,  186,  453,  318,  380,  379,  382,  292,  184,  381,
843       504,  292,  323,  184,  323,  452,  323,  259,  184,  186,
844       184,  187,  189,  189,  189,  190,  190,  190,  189,  189,
845       451,  190,  190,  328,  324,  189,  189,  189,  190,  190,
846       190,  189,  412,  450,  190,  418,  413,  414,  449,  415,
847       389,  189,  189,  411,  190,  190,  189,  448,  189,  190,
848       210,  190,  189,  237,  189,  190,  416,  190,  417,  409,
849       210,  504,  420,  189,  419,  189,  190,  189,  190,  421,
850       190,  189,  189,  189,  190,  190,  190,  413,  408,  189,
851       423,  189,  190,  189,  190,  189,  190,  324,  190,  317,
852
853       422,  189,  189,  189,  190,  190,  190,  210,  424,  189,
854       427,  425,  190,  428,  406,  426,  315,  429,  307,  431,
855       432,  433,  418,  434,  189,  430,  189,  190,  189,  190,
856       189,  190,  189,  190,  189,  190,  404,  190,  189,  189,
857       189,  190,  190,  190,  189,  189,  306,  190,  190,  259,
858       259,  403,  437,  438,  435,  439,  189,  436,  189,  190,
859       441,  190,  189,  432,  189,  190,  189,  190,  402,  190,
860       189,  440,  292,  190,  189,  405,  313,  190,  407,  322,
861       189,  401,  400,  190,  442,  445,  259,  189,  189,  399,
862       190,  190,  443,  398,  446,  292,  444,  189,  447,  189,
863
864       190,  189,  190,  189,  190,  413,  190,  189,  189,  189,
865       190,  190,  190,  189,  189,  189,  190,  190,  190,  189,
866       397,  396,  190,  469,  210,  395,  394,  189,  464,  466,
867       190,  189,  471,  465,  190,  189,  467,  468,  473,  189,
868       292,  189,  190,  470,  190,  210,  189,  393,  189,  190,
869       210,  190,  189,  189,  392,  190,  190,  210,  210,  389,
870       472,  388,  189,  189,  432,  190,  190,  189,  189,  189,
871       190,  190,  190,  189,  189,  189,  190,  190,  190,  387,
872       386,  189,  474,  479,  190,  259,  385,  189,  189,  476,
873       190,  190,  481,  475,  292,  189,  477,  478,  473,  189,
874
875       384,  189,  190,  480,  190,  259,  189,  189,  189,  190,
876       190,  190,  259,  383,  491,  272,  259,  482,  189,  259,
877       189,  190,  189,  190,  189,  190,  189,  190,  189,  190,
878       237,  190,  189,  492,  236,  190,  229,  413,  491,  210,
879       413,  227,  493,  358,  189,  189,  413,  190,  190,  189,
880       189,  357,  190,  190,  210,  413,  189,  189,  189,  190,
881       190,  190,  189,  432,  189,  190,  189,  190,  226,  190,
882       500,  495,  432,  190,  496,  189,  189,  185,  190,  190,
883       259,  432,  189,  500,  183,  190,  190,  432,  259,  332,
884       189,  331,  182,  190,  329,  326,  499,  324,  324,  317,
885
886       210,  210,  183,  315,  185,  307,  306,  502,  259,  301,
887       300,  259,   32,   32,   32,   32,   32,   32,   32,   32,
888        32,   32,  149,  149,  149,  149,  149,  149,  149,  149,
889       149,  149,  154,  154,  154,  154,  154,  154,  154,  154,
890       154,  154,  163,  163,  163,  163,  163,  163,  163,  163,
891       163,  163,  172,  172,  172,  172,  172,  172,  172,  172,
892       172,  172,  184,  184,  299,  184,  184,  184,  184,  184,
893       184,  184,  191,  191,  191,  191,  223,  223,  225,  292,
894       294,  225,  225,  293,  225,  225,  225,  225,  228,  228,
895       289,  228,  228,  228,  228,  228,  228,  228,  230,  283,
896
897       280,  230,  230,  276,  230,  230,  230,  230,  234,  234,
898       238,  238,  238,  240,  240,  240,  240,  273,  273,  275,
899       273,  273,  273,  273,  273,  273,  273,  274,  274,  304,
900       304,  304,  272,  304,  304,  304,  304,  304,  305,  305,
901       237,  305,  236,  305,  305,  305,  305,  308,  308,  229,
902       308,  308,  308,  308,  308,  308,  308,  311,  311,  311,
903       311,  311,  311,  311,  311,  311,  311,  314,  314,  227,
904       314,  226,  314,  314,  314,  314,  316,  316,  185,  316,
905       316,  316,  316,  316,  316,  316,  320,  320,  320,  320,
906       320,  320,  320,  320,  320,  320,  323,  323,  323,  323,
907
908       183,  323,  323,  323,  323,  323,  327,  327,  327,  327,
909       327,  327,  327,  327,  327,  327,  410,  410,  410,  410,
910       501,  501,  501,  501,  182,  504,   31,  504,  504,  504,
911       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
912       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
913       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
914       504,  504,  504,  504,  504,  504,  504,  504,  504,  504
915     } ;
916
917 static yyconst flex_int16_t yy_chk[1671] =
918     {   0,
919         0,    1,    1,    0,    1,    1,    1,   15,   15,   16,
920        16,   38,   69,   38,   69,   39,    1,   39,    1,   40,
921        42,   40,   44,   42,  533,   44,   65,   39,  531,   65,
922        46,   40,   43,   46,   48,   43,    1,   48,  130,    1,
923         2,    2,  130,    2,    2,    2,   43,   39,   65,   44,
924        45,   40,   45,   45,   82,    2,   45,    2,   51,   46,
925        48,   51,   66,   56,   48,   85,   56,   85,   66,   96,
926       120,  120,   96,  530,   82,    2,   51,   56,    2,    3,
927         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
928         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
929
930         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
931         3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
932         3,    3,    5,    5,    5,    5,    5,    5,    5,    5,
933         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
934         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
935         5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
936         5,    5,    5,    5,    5,    7,    7,    7,    7,    7,
937         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
938         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
939         7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
940
941         7,    7,    7,    7,    7,    7,    7,    7,    9,    9,
942         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
943         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
944         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
945         9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
946         9,   11,   11,   11,   11,   11,   11,   11,   11,   11,
947        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
948        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
949        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
950        11,   11,   11,   11,   13,   13,   13,   13,   13,   13,
951
952        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
953        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
954        13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
955        13,   13,   13,   13,   13,   13,   13,   17,   17,   17,
956        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
957        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
958        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
959        17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
960        19,   19,   19,  503,   19,   19,   19,   50,  498,   49,
961        50,   47,   49,   47,   47,  173,   19,   47,   19,   61,
962
963       497,  132,   61,   47,  132,   52,   53,   54,   52,   53,
964        54,   50,   58,  173,   50,   58,   19,   61,   49,   19,
965        20,   20,   20,   47,   20,   20,   20,   55,   53,   52,
966        55,   54,  491,   53,   64,   53,   20,   64,   20,   52,
967        57,   58,   62,   57,   59,   62,   55,   59,   97,  490,
968        83,   97,   55,   55,  489,   64,   20,   55,   59,   20,
969        25,   25,   97,   25,   25,   25,   60,   57,   60,   60,
970        83,   62,   60,   59,   70,   25,   70,   25,   25,   63,
971       284,   63,   63,   60,  134,   63,   70,   60,  284,  100,
972        75,   63,  100,  488,  134,   25,   75,   75,   25,   26,
973
974        26,   75,   26,   26,   26,  127,   70,  127,   71,   98,
975        71,   63,   98,   86,   26,   86,   26,   26,  100,   87,
976        71,   87,   92,  111,   92,   86,  111,   99,   92,   99,
977        99,   87,  103,   99,   26,  103,   98,   26,   27,   27,
978        71,   27,   27,   27,  102,   86,  110,  102,  487,  110,
979       111,   87,   93,   27,   93,   27,   27,   94,   93,   94,
980       110,  103,  112,   94,   93,  112,  147,  147,  116,   94,
981       102,  116,  105,   27,  102,  105,   27,   28,   28,  486,
982        28,   28,   28,  104,   93,  108,  104,  221,  108,   94,
983       105,  112,   28,  221,   28,   28,  101,  116,  101,  101,
984
985       107,  106,  101,  107,  106,  161,  161,  104,  101,  108,
986       104,  109,   28,  485,  109,   28,   29,   29,  484,   29,
987        29,   29,  107,  141,  151,  106,  151,  107,  101,  107,
988       109,   29,  483,   29,   29,  106,  109,  109,  141,  113,
989       119,  109,  113,  119,  114,  115,  114,  114,  115,  191,
990       114,   29,  191,  113,   29,   30,   30,  325,   30,   30,
991        30,  114,  119,  115,  118,  114,  463,  118,  113,  129,
992        30,  129,   30,   30,  117,  325,  117,  117,  170,  170,
993       117,  129,  135,  270,  270,  118,  117,  135,  199,  135,
994        30,  199,  205,   30,   80,  205,  462,   80,   80,   80,
995
996        80,  129,  199,   80,   80,  137,  117,  157,  142,  157,
997       142,  137,  137,   80,   81,  461,  137,   81,   81,   81,
998        81,  205,  157,   81,   81,  142,  144,  460,  144,  142,
999       152,  459,  152,   81,  153,  159,  153,  159,  144,  160,
1000       457,  160,  152,  162,  456,  162,  153,  168,  166,  168,
1001       166,  160,  169,  208,  169,  162,  208,  171,  144,  171,
1002       302,  302,  152,  166,  169,  178,  153,  178,  176,  171,
1003       176,  160,  176,  312,  312,  162,  179,  180,  179,  180,
1004       178,  180,  455,  192,  169,  176,  192,  454,  179,  171,
1005       181,  179,  181,  188,  193,  188,  194,  193,  195,  194,
1006
1007       195,  195,  181,  453,  195,  181,  196,  192,  179,  196,
1008       197,  198,  200,  197,  198,  200,  201,  321,  321,  201,
1009       193,  202,  181,  196,  202,  224,  452,  224,  194,  198,
1010       203,  204,  451,  203,  204,  201,  206,  450,  200,  206,
1011       197,  207,  209,  202,  207,  209,  203,  210,  449,  211,
1012       210,  202,  211,  212,  448,  213,  212,  204,  213,  214,
1013       418,  215,  214,  206,  215,  230,  216,  230,  207,  216,
1014       209,  403,  217,  218,  211,  217,  218,  219,  402,  240,
1015       219,  214,  240,  215,  212,  213,  220,  228,  235,  220,
1016       235,  401,  241,  228,  228,  241,  217,  216,  228,  219,
1017
1018       239,  277,  239,  277,  220,  400,  239,  242,  218,  243,
1019       242,  244,  243,  244,  244,  245,  241,  244,  245,  246,
1020       247,  248,  246,  247,  248,  249,  250,  252,  249,  250,
1021       252,  251,  245,  242,  251,  248,  253,  254,  247,  253,
1022       254,  243,  399,  252,  255,  250,  310,  255,  310,  246,
1023       398,  249,  256,  251,  257,  256,  258,  257,  397,  258,
1024       259,  251,  253,  259,  260,  261,  254,  260,  261,  262,
1025       263,  255,  262,  263,  265,  264,  396,  265,  264,  256,
1026       266,  395,  267,  266,  258,  267,  394,  268,  269,  260,
1027       268,  269,  263,  308,  393,  308,  261,  264,  316,  262,
1028
1029       316,  319,  392,  319,  266,  265,  269,  391,  308,  268,
1030       324,  390,  324,  316,  324,  388,  327,  267,  327,  330,
1031       327,  330,  333,  334,  335,  333,  334,  335,  336,  337,
1032       387,  336,  337,  327,  330,  338,  339,  340,  338,  339,
1033       340,  342,  335,  386,  342,  341,  336,  337,  385,  338,
1034       384,  341,  343,  334,  341,  343,  344,  383,  345,  344,
1035       342,  345,  346,  359,  347,  346,  339,  347,  340,  329,
1036       343,  328,  345,  348,  344,  349,  348,  350,  349,  347,
1037       350,  352,  351,  353,  352,  351,  353,  346,  326,  355,
1038       349,  354,  355,  356,  354,  360,  356,  323,  360,  318,
1039
1040       348,  361,  362,  363,  361,  362,  363,  350,  351,  364,
1041       354,  352,  364,  355,  317,  353,  315,  356,  309,  361,
1042       362,  363,  367,  364,  365,  360,  366,  365,  367,  366,
1043       368,  367,  369,  368,  370,  369,  307,  370,  372,  371,
1044       373,  372,  371,  373,  374,  375,  306,  374,  375,  368,
1045       369,  301,  370,  371,  365,  373,  376,  366,  377,  376,
1046       375,  377,  378,  372,  379,  378,  380,  379,  300,  380,
1047       381,  374,  299,  381,  382,  405,  405,  382,  407,  407,
1048       410,  298,  297,  410,  377,  380,  376,  411,  412,  296,
1049       411,  412,  378,  295,  381,  294,  379,  413,  382,  414,
1050
1051       413,  415,  414,  416,  415,  411,  416,  417,  419,  421,
1052       417,  419,  421,  420,  422,  423,  420,  422,  423,  424,
1053       293,  291,  424,  421,  415,  289,  288,  425,  414,  417,
1054       425,  426,  423,  416,  426,  427,  419,  420,  427,  428,
1055       287,  429,  428,  422,  429,  425,  430,  286,  431,  430,
1056       424,  431,  432,  433,  285,  432,  433,  428,  429,  283,
1057       426,  282,  434,  435,  430,  434,  435,  436,  437,  439,
1058       436,  437,  439,  438,  440,  441,  438,  440,  441,  281,
1059       280,  442,  433,  439,  442,  434,  279,  443,  444,  436,
1060       443,  444,  441,  435,  278,  445,  437,  438,  445,  447,
1061
1062       276,  446,  447,  440,  446,  443,  464,  466,  467,  464,
1063       466,  467,  442,  275,  465,  272,  447,  444,  468,  446,
1064       465,  468,  469,  465,  470,  469,  471,  470,  472,  471,
1065       238,  472,  474,  466,  236,  474,  232,  464,  475,  467,
1066       471,  231,  468,  229,  475,  476,  469,  475,  476,  477,
1067       478,  227,  477,  478,  472,  470,  480,  479,  481,  480,
1068       479,  481,  482,  474,  492,  482,  493,  492,  226,  493,
1069       494,  476,  481,  494,  478,  495,  496,  187,  495,  496,
1070       477,  479,  499,  501,  186,  499,  501,  480,  482,  185,
1071       502,  183,  182,  502,  177,  175,  492,  174,  172,  167,
1072
1073       499,  493,  165,  164,  158,  156,  155,  495,  502,  146,
1074       145,  496,  505,  505,  505,  505,  505,  505,  505,  505,
1075       505,  505,  506,  506,  506,  506,  506,  506,  506,  506,
1076       506,  506,  507,  507,  507,  507,  507,  507,  507,  507,
1077       507,  507,  508,  508,  508,  508,  508,  508,  508,  508,
1078       508,  508,  509,  509,  509,  509,  509,  509,  509,  509,
1079       509,  509,  510,  510,  143,  510,  510,  510,  510,  510,
1080       510,  510,  511,  511,  511,  511,  512,  512,  513,  140,
1081       139,  513,  513,  138,  513,  513,  513,  513,  514,  514,
1082       136,  514,  514,  514,  514,  514,  514,  514,  515,  133,
1083
1084       131,  515,  515,  128,  515,  515,  515,  515,  516,  516,
1085       517,  517,  517,  518,  518,  518,  518,  519,  519,  126,
1086       519,  519,  519,  519,  519,  519,  519,  520,  520,  521,
1087       521,  521,  122,  521,  521,  521,  521,  521,  522,  522,
1088        91,  522,   88,  522,  522,  522,  522,  523,  523,   76,
1089       523,  523,  523,  523,  523,  523,  523,  524,  524,  524,
1090       524,  524,  524,  524,  524,  524,  524,  525,  525,   74,
1091       525,   73,  525,  525,  525,  525,  526,  526,   37,  526,
1092       526,  526,  526,  526,  526,  526,  527,  527,  527,  527,
1093       527,  527,  527,  527,  527,  527,  528,  528,  528,  528,
1094
1095        35,  528,  528,  528,  528,  528,  529,  529,  529,  529,
1096       529,  529,  529,  529,  529,  529,  532,  532,  532,  532,
1097       534,  534,  534,  534,   33,   31,  504,  504,  504,  504,
1098       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
1099       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
1100       504,  504,  504,  504,  504,  504,  504,  504,  504,  504,
1101       504,  504,  504,  504,  504,  504,  504,  504,  504,  504
1102     } ;
1103
1104 extern int pycodeYY_flex_debug;
1105 int pycodeYY_flex_debug = 0;
1106
1107 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
1108 static char *yy_full_match;
1109 static int yy_lp;
1110 static int yy_looking_for_trail_begin = 0;
1111 static int yy_full_lp;
1112 static int *yy_full_state;
1113 #define YY_TRAILING_MASK 0x2000
1114 #define YY_TRAILING_HEAD_MASK 0x4000
1115 #define REJECT \
1116 { \
1117 *yy_cp = (yy_hold_char); /* undo effects of setting up pycodeYYtext */ \
1118 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
1119 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
1120 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
1121 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
1122 ++(yy_lp); \
1123 goto find_rule; \
1124 }
1125
1126 #define yymore() yymore_used_but_not_detected
1127 #define YY_MORE_ADJ 0
1128 #define YY_RESTORE_YY_MORE_OFFSET
1129 char *pycodeYYtext;
1130 #line 1 "pycode.l"
1131 /******************************************************************************
1132  *
1133  * $Id: pycode.h,v 1.9 2001/03/19 19:27:39 root Exp $
1134  *
1135  * Copyright (C) 1997-2012 by Dimitri van Heesch.
1136  *
1137  * Permission to use, copy, modify, and distribute this software and its
1138  * documentation under the terms of the GNU General Public License is hereby 
1139  * granted. No representations are made about the suitability of this software 
1140  * for any purpose. It is provided "as is" without express or implied warranty.
1141  * See the GNU General Public License for more details.
1142  *
1143  * Documents produced by Doxygen are derivative works derived from the
1144  * input used in their production; they are not affected by this license.
1145  *
1146  */
1147 /*  This code is based on the work done by the MoxyPyDoxy team
1148  *  (Linda Leong, Mike Rivera, Kim Truong, and Gabriel Estrada)
1149  *  in Spring 2005 as part of CS 179E: Compiler Design Project
1150  *  at the University of California, Riverside; the course was
1151  *  taught by Peter H. Froehlich <phf@acm.org>.
1152  */
1153 #line 26 "pycode.l"
1154
1155 #include <stdio.h>
1156 #include <qvaluestack.h>
1157
1158 #include "pycode.h"
1159 #include "message.h"
1160
1161 #include "scanner.h"
1162 #include "entry.h"
1163 #include "doxygen.h"
1164 #include "outputlist.h"
1165 #include "util.h"
1166 #include "membername.h"
1167 #include "searchindex.h"
1168
1169 #define YY_NEVER_INTERACTIVE 1
1170 #define YY_NO_INPUT 1
1171
1172 static ClassSDict    g_codeClassSDict(17);
1173 static QCString      g_curClassName;
1174 static QStrList      g_curClassBases;
1175
1176
1177 static CodeOutputInterface * g_code;
1178 static const char *  g_inputString;     //!< the code fragment as text
1179 static int           g_inputPosition;   //!< read offset during parsing 
1180 static const char *  g_currentFontClass;
1181 static bool          g_needsTermination;
1182 static Definition   *g_searchCtx;
1183 static int           g_inputLines;      //!< number of line in the code fragment
1184 static int           g_yyLineNr;        //!< current line number
1185 static FileDef *     g_sourceFileDef;
1186 static Definition *  g_currentDefinition;
1187 static MemberDef *   g_currentMemberDef;
1188 static bool          g_includeCodeFragment;
1189 static QCString      g_realScope;
1190 //static bool          g_insideBody;
1191 static int           g_bodyCurlyCount;
1192 static bool          g_searchingForBody;
1193 static QCString      g_classScope;
1194 static int           g_paramParens;
1195 //static int           g_anchorCount;
1196
1197 static bool          g_exampleBlock;
1198 static QCString      g_exampleName;
1199 static QCString      g_exampleFile;
1200
1201 static QCString      g_type;
1202 static QCString      g_name;
1203
1204 static bool          g_doubleStringIsDoc;
1205 static bool          g_doubleQuote;
1206 static bool          g_noSuiteFound;
1207 static int           g_stringContext;
1208
1209 static QValueStack<uint> g_indents;  //!< Tracks indentation levels for scoping in python
1210
1211 static void endFontClass();
1212 static void adjustScopesAndSuites(unsigned indentLength);
1213
1214
1215 /*! Represents a stack of variable to class mappings as found in the
1216  *  code. Each scope is enclosed in pushScope() and popScope() calls.
1217  *  Variables are added by calling addVariables() and one can search
1218  *  for variable using findVariable().
1219  */
1220 class PyVariableContext 
1221 {
1222   public:
1223     static const ClassDef *dummyContext;    
1224     class Scope : public SDict<ClassDef> 
1225     {
1226       public:
1227         Scope() : SDict<ClassDef>(17) {}
1228     };
1229     
1230     PyVariableContext() 
1231     {
1232       m_scopes.setAutoDelete(TRUE);
1233     }
1234
1235     virtual ~PyVariableContext() 
1236     {
1237     }
1238     
1239     void pushScope() 
1240     {
1241       m_scopes.append(new Scope);
1242     }
1243
1244     void popScope() 
1245     {
1246       if (m_scopes.count()>0) 
1247       {
1248         m_scopes.remove(m_scopes.count()-1);
1249       }
1250     }
1251
1252     void clear() 
1253     {
1254       m_scopes.clear();
1255       m_globalScope.clear();
1256     }
1257
1258     void clearExceptGlobal() 
1259     {
1260       m_scopes.clear();
1261     }
1262
1263     void addVariable(const QCString &type,const QCString &name);
1264     ClassDef *findVariable(const QCString &name);
1265     
1266   private:
1267     Scope        m_globalScope;
1268     QList<Scope> m_scopes;
1269 };
1270
1271 void PyVariableContext::addVariable(const QCString &type,const QCString &name)
1272 {
1273   //printf("PyVariableContext::addVariable(%s,%s)\n",type.data(),name.data());
1274   QCString ltype = type.simplifyWhiteSpace();
1275   QCString lname = name.simplifyWhiteSpace();
1276
1277   Scope *scope = m_scopes.count()==0 ? &m_globalScope : m_scopes.getLast();
1278   ClassDef *varType;
1279   if (
1280       (varType=g_codeClassSDict[ltype]) ||  // look for class definitions inside the code block
1281       (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,ltype)) // look for global class definitions
1282      ) 
1283   {
1284     scope->append(lname,varType); // add it to a list
1285   }
1286   else 
1287   {
1288     if (m_scopes.count()>0) // for local variables add a dummy entry so the name 
1289                             // is hidden to avoid FALSE links to global variables with the same name
1290                             // TODO: make this work for namespaces as well!
1291     {
1292       scope->append(lname,dummyContext);
1293     }
1294   }
1295 }
1296
1297 ClassDef *PyVariableContext::findVariable(const QCString &name)
1298 {
1299   if (name.isEmpty()) return 0;
1300   ClassDef *result = 0;
1301   QListIterator<Scope> sli(m_scopes);
1302   Scope *scope;
1303   // search from inner to outer scope
1304   for (sli.toLast();(scope=sli.current());--sli)
1305   {
1306     result = scope->find(name);
1307     if (result) 
1308     {
1309       return result;
1310     }
1311   }
1312   // nothing found -> also try the global scope
1313   result=m_globalScope.find(name);
1314   return result;
1315 }
1316
1317 static PyVariableContext g_theVarContext;
1318 const ClassDef *PyVariableContext::dummyContext = (ClassDef*)0x8;
1319
1320 class PyCallContext
1321 {
1322   public:
1323     struct Ctx
1324     {
1325       Ctx() : name(g_name), type(g_type), cd(0) {}
1326       QCString name;
1327       QCString type;
1328       ClassDef *cd;
1329     };
1330
1331     PyCallContext() 
1332     {
1333       m_classList.append(new Ctx);
1334       m_classList.setAutoDelete(TRUE);
1335     }
1336
1337     virtual ~PyCallContext() {}
1338
1339     void setClass(ClassDef *cd)
1340     {
1341       Ctx *ctx = m_classList.getLast();
1342       if (ctx) 
1343       {
1344         ctx->cd=cd;
1345       }
1346     }
1347     void pushScope()
1348     {
1349       m_classList.append(new Ctx);
1350     }
1351
1352     void popScope()
1353     {
1354       if (m_classList.count()>1)
1355       {
1356         Ctx *ctx = m_classList.getLast();
1357         if (ctx)
1358         {
1359           g_name = ctx->name;
1360           g_type = ctx->type;
1361         }
1362         m_classList.removeLast();
1363       }
1364       else
1365       {
1366       }
1367     }
1368
1369     void clear()
1370     {
1371       m_classList.clear();
1372       m_classList.append(new Ctx);
1373     }
1374
1375     ClassDef *getClass() const
1376     {
1377       Ctx *ctx = m_classList.getLast();
1378
1379       if (ctx)
1380         return ctx->cd;
1381       else
1382         return 0;
1383     }
1384
1385   private:
1386     QList<Ctx> m_classList;    
1387 };
1388
1389 static PyCallContext g_theCallContext;
1390
1391
1392 /*! counts the number of lines in the input */
1393 static int countLines()
1394 {
1395   const char *p=g_inputString;
1396   char c;
1397   int count=1;
1398   while ((c=*p)) 
1399   { 
1400     p++ ; 
1401     if (c=='\n') count++;  
1402   }
1403   if (p>g_inputString && *(p-1)!='\n') 
1404   { // last line does not end with a \n, so we add an extra
1405     // line and explicitly terminate the line after parsing.
1406     count++, 
1407     g_needsTermination=TRUE; 
1408   } 
1409   return count;
1410 }
1411
1412 static void setCurrentDoc(const QCString &anchor)
1413 {
1414   if (Doxygen::searchIndex)
1415   {
1416     if (g_searchCtx)
1417     {
1418       Doxygen::searchIndex->setCurrentDoc(g_searchCtx,g_searchCtx->anchor(),FALSE);
1419     }
1420     else
1421     {
1422       Doxygen::searchIndex->setCurrentDoc(g_sourceFileDef,anchor,TRUE);
1423     }
1424   }
1425 }
1426
1427 static void addToSearchIndex(const char *text)
1428 {
1429   if (Doxygen::searchIndex)
1430   {
1431     Doxygen::searchIndex->addWord(text,FALSE);
1432   }
1433 }
1434
1435
1436 static ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
1437 {
1438   int pos=0;
1439   QCString type = s;
1440   QCString className;
1441   QCString templSpec;
1442   while (extractClassNameFromType(type,pos,className,templSpec)!=-1)
1443   {
1444     QCString clName=className+templSpec;
1445
1446     ClassDef *cd=0;
1447     if (!g_classScope.isEmpty())
1448     {
1449       cd=getResolvedClass(d,g_sourceFileDef,g_classScope+"::"+clName);
1450     }
1451     if (cd==0)
1452     {
1453       cd=getResolvedClass(d,g_sourceFileDef,clName);
1454     }
1455     if (cd)
1456     {
1457       return cd;
1458     }
1459   }
1460
1461   return 0;
1462 }
1463
1464
1465
1466 /*! start a new line of code, inserting a line number if g_sourceFileDef
1467  * is TRUE. If a definition starts at the current line, then the line
1468  * number is linked to the documentation of that definition.
1469  */
1470 static void startCodeLine()
1471 {
1472   //if (g_currentFontClass) { g_code->endFontClass(); }
1473   if (g_sourceFileDef)
1474   {
1475     //QCString lineNumber,lineAnchor;
1476     //lineNumber.sprintf("%05d",g_yyLineNr);
1477     //lineAnchor.sprintf("l%05d",g_yyLineNr);
1478    
1479     Definition *d   = g_sourceFileDef->getSourceDefinition(g_yyLineNr);
1480     //printf("startCodeLine %d d=%p\n",g_yyLineNr,d);
1481     //g_code->startLineNumber();
1482     if (!g_includeCodeFragment && d && d->isLinkableInProject())
1483     {
1484       g_currentDefinition = d;
1485       g_currentMemberDef = g_sourceFileDef->getSourceMember(g_yyLineNr);
1486       //g_insideBody = FALSE;
1487       g_searchingForBody = TRUE;
1488       g_realScope = d->name().copy();
1489       g_classScope = d->name().copy();
1490       //printf("Real scope: `%s'\n",g_realScope.data());
1491       g_bodyCurlyCount = 0;
1492       QCString lineAnchor;
1493       lineAnchor.sprintf("l%05d",g_yyLineNr);
1494       if (g_currentMemberDef)
1495       {
1496         g_code->writeLineNumber(g_currentMemberDef->getReference(),
1497                                 g_currentMemberDef->getOutputFileBase(),
1498                                 g_currentMemberDef->anchor(),g_yyLineNr);
1499         setCurrentDoc(lineAnchor);
1500       }
1501       else
1502       {
1503         g_code->writeLineNumber(d->getReference(),
1504                                 d->getOutputFileBase(),
1505                                 0,g_yyLineNr);
1506         setCurrentDoc(lineAnchor);
1507       }
1508     }
1509     else
1510     {
1511       //g_code->codify(lineNumber);
1512       g_code->writeLineNumber(0,0,0,g_yyLineNr);
1513     }
1514     //g_code->endLineNumber();
1515   }
1516   g_code->startCodeLine(g_sourceFileDef); 
1517   if (g_currentFontClass)
1518   {
1519     g_code->startFontClass(g_currentFontClass);
1520   }
1521 }
1522
1523 static void codify(const char* text) 
1524
1525   g_code->codify(text);
1526 }
1527
1528 static void endCodeLine()
1529 {
1530   endFontClass();
1531   g_code->endCodeLine();
1532 }
1533
1534 static void nextCodeLine()
1535 {
1536   const char *fc = g_currentFontClass;
1537   endCodeLine();
1538   if (g_yyLineNr<g_inputLines) 
1539   {
1540     g_currentFontClass = fc;
1541     startCodeLine();
1542   }
1543 }
1544
1545
1546 /*! writes a link to a fragment \a text that may span multiple lines, inserting
1547  * line numbers for each line. If \a text contains newlines, the link will be 
1548  * split into multiple links with the same destination, one for each line.
1549  */
1550 static void writeMultiLineCodeLink(CodeOutputInterface &ol,
1551                   const char *ref,const char *file,
1552                   const char *anchor,const char *text,
1553                   const char *tooltip)
1554 {
1555   bool done=FALSE;
1556   char *p=(char *)text;
1557   while (!done)
1558   {
1559     char *sp=p;
1560     char c;
1561     while ((c=*p++) && c!='\n') { }
1562     if (c=='\n')
1563     {
1564       g_yyLineNr++;
1565       *(p-1)='\0';
1566       //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
1567       ol.writeCodeLink(ref,file,anchor,sp,tooltip);
1568       nextCodeLine();
1569     }
1570     else
1571     {
1572       //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
1573       ol.writeCodeLink(ref,file,anchor,sp,tooltip);
1574       done=TRUE;
1575     }
1576   }
1577 }
1578
1579
1580 static void codifyLines(char *text)
1581 {
1582   //printf("codifyLines(%d,\"%s\")\n",g_yyLineNr,text);
1583   char *p=text,*sp=p;
1584   char c;
1585   bool done=FALSE;
1586   while (!done)
1587   {
1588     sp=p;
1589     while ((c=*p++) && c!='\n') { }
1590     if (c=='\n')
1591     {
1592       g_yyLineNr++;
1593       *(p-1)='\0';
1594       g_code->codify(sp);
1595       nextCodeLine();
1596     }
1597     else
1598     {
1599       g_code->codify(sp);
1600       done=TRUE;
1601     }
1602   }
1603 }
1604
1605 static void addDocCrossReference(MemberDef *src,MemberDef *dst)
1606 {
1607   static bool referencedByRelation = Config_getBool("REFERENCED_BY_RELATION");
1608   static bool callerGraph =  Config_getBool("CALLER_GRAPH");
1609   static bool referencesRelation = Config_getBool("REFERENCES_RELATION");
1610   static bool callGraph = Config_getBool("CALL_GRAPH");
1611   if (dst->isTypedef() || dst->isEnumerate()) return; // don't add types
1612   //printf("addDocCrossReference src=%s,dst=%s\n",src->name().data(),dst->name().data());
1613   if ((referencedByRelation || callerGraph) && (src->isFunction() || src->isSlot()))
1614   {
1615     dst->addSourceReferencedBy(src);
1616   }
1617   if ((referencesRelation || callGraph) && (src->isFunction() || src->isSlot()))
1618   {
1619     src->addSourceReferences(dst);
1620   }
1621 }
1622
1623
1624
1625 static bool getLinkInScope(const QCString &c,  // scope
1626                            const QCString &m,  // member
1627                            const char *memberText, // exact text
1628                            CodeOutputInterface &ol,
1629                            const char *text
1630                           )
1631 {
1632   MemberDef    *md;
1633   ClassDef     *cd;
1634   FileDef      *fd;
1635   NamespaceDef *nd;
1636   GroupDef     *gd;
1637   //printf("Trying `%s'::`%s'\n",c.data(),m.data());
1638   if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) && 
1639       md->isLinkable())
1640   {
1641     //Definition *d=0;
1642     //if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd;
1643
1644     Definition *d = md->getOuterScope()==Doxygen::globalScope ?
1645                     md->getBodyDef() : md->getOuterScope();
1646     //printf("Found! d=%s\n",d?d->name().data():"<none>");
1647     if (md->getGroupDef()) d = md->getGroupDef();
1648     if (d && d->isLinkable())
1649     {
1650       g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
1651       //printf("g_currentDefinition=%p g_currentMemberDef=%p\n",
1652       //        g_currentDefinition,g_currentMemberDef);
1653
1654       if (g_currentDefinition && g_currentMemberDef &&
1655           md!=g_currentMemberDef)
1656       {
1657         addDocCrossReference(g_currentMemberDef,md);
1658       }
1659       //printf("d->getReference()=`%s' d->getOutputBase()=`%s' name=`%s' member name=`%s'\n",d->getReference().data(),d->getOutputFileBase().data(),d->name().data(),md->name().data());
1660      
1661       writeMultiLineCodeLink(ol,md->getReference(),
1662                                 md->getOutputFileBase(),
1663                                 md->anchor(),
1664                                 text ? text : memberText,
1665                                 md->briefDescriptionAsTooltip());
1666       addToSearchIndex(text ? text : memberText);
1667       return TRUE;
1668     } 
1669   }
1670   return FALSE;
1671 }
1672
1673 static bool getLink(const char *className,
1674                     const char *memberName,
1675                     CodeOutputInterface &ol,
1676                     const char *text=0)
1677 {
1678   QCString m=removeRedundantWhiteSpace(memberName);
1679   QCString c=className;
1680   if (!getLinkInScope(c,m,memberName,ol,text))
1681   {
1682     if (!g_curClassName.isEmpty())
1683     {
1684       if (!c.isEmpty()) c.prepend("::");
1685       c.prepend(g_curClassName);
1686       return getLinkInScope(c,m,memberName,ol,text);
1687     }
1688     return FALSE;
1689   }
1690   return TRUE;
1691 }
1692
1693
1694 /*
1695   For a given string in the source code,
1696   finds its class or global id and links to it.
1697 */
1698 static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
1699                                       bool typeOnly=FALSE)
1700 {
1701   QCString className=clName;
1702
1703   // Don't do anything for empty text
1704   if (className.isEmpty()) return;
1705
1706   //fprintf(stderr,"generateClassOrGlobalLink(className=%s)\n",className.data());
1707
1708   ClassDef *cd=0,*lcd=0;  /** Class def that we may find */
1709   MemberDef *md=0;        /** Member def that we may find */
1710   //bool isLocal=FALSE;
1711
1712   if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable
1713   {
1714     Definition *d = g_currentDefinition;
1715     QCString scope = substitute(className,".","::");
1716
1717     cd = getResolvedClass(d,g_sourceFileDef,substitute(className,".","::"),&md);
1718
1719     //fprintf(stderr,"d=%s g_sourceFileDef=%s\n",
1720     //  d?d->displayName().data():"<null>",
1721     //  g_currentDefinition?g_currentDefinition->displayName().data():"<null>");
1722     //fprintf(stderr,"is found as a type %s\n",cd?cd->name().data():"<null>");
1723
1724     if (cd==0 && md==0) // also see if it is variable or enum or enum value
1725     {
1726       NamespaceDef *nd = getResolvedNamespace(scope);
1727       if (nd)
1728       {
1729         writeMultiLineCodeLink(ol,nd->getReference(),nd->getOutputFileBase(),nd->anchor(),clName,nd->briefDescriptionAsTooltip());
1730         addToSearchIndex(className);
1731         return;
1732       }
1733       else if (getLink(g_classScope,clName,ol,clName))
1734       {
1735         return;
1736       }
1737     }
1738   }
1739   else
1740   {
1741     if (lcd!=PyVariableContext::dummyContext) 
1742     {
1743       g_theCallContext.setClass(lcd);
1744     }
1745     //isLocal=TRUE;
1746     //fprintf(stderr,"is a local variable cd=%p!\n",cd);
1747   }
1748
1749   if (cd && cd->isLinkable()) // is it a linkable class
1750   {
1751     writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),clName,cd->briefDescriptionAsTooltip());
1752     addToSearchIndex(className);
1753     if (md)
1754     {
1755       Definition *d = md->getOuterScope()==Doxygen::globalScope ?
1756                       md->getBodyDef() : md->getOuterScope();
1757       if (md->getGroupDef()) d = md->getGroupDef();
1758       if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef)
1759       {
1760         addDocCrossReference(g_currentMemberDef,md);
1761       }
1762     }
1763   }
1764   else // not a class, maybe a global member
1765   {
1766     int scopeEnd = className.findRev(".");
1767     if (scopeEnd!=-1 && !typeOnly) // name with explicit scope
1768     {
1769       QCString scope = substitute(className.left(scopeEnd),".","::");
1770       QCString locName = className.right(className.length()-scopeEnd-1);
1771       ClassDef *mcd = getClass(scope);
1772       //fprintf(stderr,"scope=%s locName=%s mcd=%p\n",scope.data(),locName.data(),mcd);
1773       if (mcd)
1774       {
1775         MemberDef *md = mcd->getMemberByName(locName);
1776         if (md)
1777         {
1778           g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
1779           writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip());
1780           addToSearchIndex(className);
1781           Definition *d = md->getOuterScope()==Doxygen::globalScope ?
1782                           md->getBodyDef() : md->getOuterScope();
1783           if (md->getGroupDef()) d = md->getGroupDef();
1784           if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef)
1785           {
1786             addDocCrossReference(g_currentMemberDef,md);
1787           }
1788           return;
1789         }
1790       }
1791       else // check namespace as well
1792       {
1793         NamespaceDef *mnd = getResolvedNamespace(scope);
1794         if (mnd)
1795         {
1796           MemberDef *md=mnd->getMemberByName(locName);
1797           if (md)
1798           {
1799             //printf("name=%s scope=%s\n",locName.data(),scope.data());
1800             g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
1801             writeMultiLineCodeLink(ol,md->getReference(),md->getOutputFileBase(),md->anchor(),clName,md->briefDescriptionAsTooltip());
1802             addToSearchIndex(className);
1803             Definition *d = md->getOuterScope()==Doxygen::globalScope ?
1804                             md->getBodyDef() : md->getOuterScope();
1805             if (md->getGroupDef()) d = md->getGroupDef();
1806             if (d && d->isLinkable() && md->isLinkable() && g_currentMemberDef)
1807             {
1808               addDocCrossReference(g_currentMemberDef,md);
1809             }
1810             return;
1811           }
1812         }
1813       }
1814     }
1815     
1816     // nothing found, just write out the word
1817     codifyLines(clName);
1818     addToSearchIndex(clName);
1819   }
1820 }
1821
1822 /*
1823    As of June 1, this function seems to work
1824    for file members, but scopes are not
1825    being correctly tracked for classes
1826    so it doesn't work for classes yet.
1827
1828 */
1829 static void generateFunctionLink(CodeOutputInterface &ol,char *funcName)
1830 {
1831   //CodeClassDef *ccd=0;
1832   ClassDef *ccd=0;
1833   QCString locScope=g_classScope.copy();
1834   QCString locFunc=removeRedundantWhiteSpace(funcName);
1835   //fprintf(stdout,"*** locScope=%s locFunc=%s\n",locScope.data(),locFunc.data());
1836   int i=locFunc.findRev("::");
1837   if (i>0)
1838   {
1839     locScope=locFunc.left(i);
1840     locFunc=locFunc.right(locFunc.length()-i-2).stripWhiteSpace();
1841   }
1842   //printf("generateFunctionLink(%s) classScope=`%s'\n",locFunc.data(),locScope.data());
1843   if (!locScope.isEmpty() && (ccd=g_codeClassSDict[locScope]))
1844   {
1845     //printf("using classScope %s\n",g_classScope.data());
1846     if (ccd->baseClasses())
1847     {
1848       BaseClassListIterator bcli(*ccd->baseClasses());
1849       for ( ; bcli.current() ; ++bcli)
1850       {
1851         if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName)) 
1852         {
1853           return;
1854         }
1855       }
1856     }
1857   }
1858   if (!getLink(locScope,locFunc,ol,funcName))
1859   {
1860     generateClassOrGlobalLink(ol,funcName);
1861   }
1862   return;
1863 }
1864
1865 static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *symName)
1866 {
1867   //printf("sym %s outerScope=%s equal=%d\n",
1868   //    sym->name().data(),sym->getOuterScope()->name().data(),
1869   //    sym->getOuterScope()==g_currentDefinition);
1870
1871   if (sym->getOuterScope() &&
1872       sym->getOuterScope()->definitionType()==Definition::TypeClass &&
1873       g_currentDefinition->definitionType()==Definition::TypeClass)
1874   {
1875     ClassDef *cd = (ClassDef*)sym->getOuterScope();
1876     ClassDef *thisCd = (ClassDef *)g_currentDefinition;
1877     QCString anchor=sym->anchor();
1878     if (sym->definitionType()==Definition::TypeMember)
1879     {
1880       if (g_currentMemberDef)
1881       {
1882         addDocCrossReference(g_currentMemberDef,(MemberDef*)sym);
1883       }
1884     }
1885     //fprintf(stderr,"cd=%s thisCd=%s\n",cd?cd->name().data():"<none>",thisCd?thisCd->name().data():"<none>");
1886
1887     // TODO: find the nearest base class in case cd is a base class of
1888     // thisCd 
1889     if (cd==thisCd || (thisCd && thisCd->isBaseClass(cd,TRUE)))
1890     {
1891       writeMultiLineCodeLink(ol,sym->getReference(),
1892           sym->getOutputFileBase(),
1893           anchor,
1894           symName,
1895           sym->briefDescriptionAsTooltip());
1896       return TRUE;
1897     }
1898   }
1899   return FALSE;
1900 }
1901
1902 static void findMemberLink(CodeOutputInterface &ol,char *symName)
1903 {
1904   //printf("Member reference: %s scope=%s member=%s\n",
1905   //    pycodeYYtext,
1906   //    g_currentDefinition?g_currentDefinition->name().data():"<none>",
1907   //    g_currentMemberDef?g_currentMemberDef->name().data():"<none>"
1908   //    );
1909   if (g_currentDefinition)
1910   {
1911     DefinitionIntf *di = Doxygen::symbolMap->find(symName);
1912     if (di)
1913     {
1914       if (di->definitionType()==DefinitionIntf::TypeSymbolList) // multiple symbols
1915       {
1916         DefinitionListIterator dli(*(DefinitionList*)di);
1917         Definition *sym;
1918         for (dli.toFirst();(sym=dli.current());++dli)
1919         {
1920           if (findMemberLink(ol,sym,symName)) return;
1921         }
1922       }
1923       else // single symbol
1924       {
1925         if (findMemberLink(ol,(Definition*)di,symName)) return;
1926       }
1927     }
1928   }
1929   //printf("sym %s not found\n",&pycodeYYtext[5]);
1930   codify(symName);
1931 }
1932
1933 static void startFontClass(const char *s)
1934 {
1935   endFontClass();
1936   g_code->startFontClass(s);
1937   g_currentFontClass=s;
1938 }
1939
1940 static void endFontClass()
1941 {
1942   if (g_currentFontClass)
1943   {
1944     g_code->endFontClass();
1945     g_currentFontClass=0;
1946   }
1947 }
1948
1949 #undef YY_INPUT
1950 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1951
1952 static int yyread(char *buf,int max_size)
1953 {
1954   int c=0;
1955   while( c < max_size && g_inputString[g_inputPosition] )
1956   {
1957     *buf = g_inputString[g_inputPosition++] ;
1958     c++; buf++;
1959   }
1960   return c;
1961 }
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977 #line 1978 "<stdout>"
1978
1979 #define INITIAL 0
1980 #define Body 1
1981 #define FunctionDec 2
1982 #define FunctionParams 3
1983 #define ClassDec 4
1984 #define ClassInheritance 5
1985 #define Suite 6
1986 #define SuiteCaptureIndent 7
1987 #define SuiteStart 8
1988 #define SuiteMaintain 9
1989 #define SuiteContinuing 10
1990 #define LongString 11
1991 #define SingleQuoteString 12
1992 #define DoubleQuoteString 13
1993 #define TripleString 14
1994
1995 #ifndef YY_NO_UNISTD_H
1996 /* Special case for "unistd.h", since it is non-ANSI. We include it way
1997  * down here because we want the user's section 1 to have been scanned first.
1998  * The user has a chance to override it with an option.
1999  */
2000 #include <unistd.h>
2001 #endif
2002
2003 #ifndef YY_EXTRA_TYPE
2004 #define YY_EXTRA_TYPE void *
2005 #endif
2006
2007 static int yy_init_globals (void );
2008
2009 /* Accessor methods to globals.
2010    These are made visible to non-reentrant scanners for convenience. */
2011
2012 int pycodeYYlex_destroy (void );
2013
2014 int pycodeYYget_debug (void );
2015
2016 void pycodeYYset_debug (int debug_flag  );
2017
2018 YY_EXTRA_TYPE pycodeYYget_extra (void );
2019
2020 void pycodeYYset_extra (YY_EXTRA_TYPE user_defined  );
2021
2022 FILE *pycodeYYget_in (void );
2023
2024 void pycodeYYset_in  (FILE * in_str  );
2025
2026 FILE *pycodeYYget_out (void );
2027
2028 void pycodeYYset_out  (FILE * out_str  );
2029
2030 yy_size_t pycodeYYget_leng (void );
2031
2032 char *pycodeYYget_text (void );
2033
2034 int pycodeYYget_lineno (void );
2035
2036 void pycodeYYset_lineno (int line_number  );
2037
2038 /* Macros after this point can all be overridden by user definitions in
2039  * section 1.
2040  */
2041
2042 #ifndef YY_SKIP_YYWRAP
2043 #ifdef __cplusplus
2044 extern "C" int pycodeYYwrap (void );
2045 #else
2046 extern int pycodeYYwrap (void );
2047 #endif
2048 #endif
2049
2050 #ifndef yytext_ptr
2051 static void yy_flex_strncpy (char *,yyconst char *,int );
2052 #endif
2053
2054 #ifdef YY_NEED_STRLEN
2055 static int yy_flex_strlen (yyconst char * );
2056 #endif
2057
2058 #ifndef YY_NO_INPUT
2059
2060 #ifdef __cplusplus
2061 static int yyinput (void );
2062 #else
2063 static int input (void );
2064 #endif
2065
2066 #endif
2067
2068 /* Amount of stuff to slurp up with each read. */
2069 #ifndef YY_READ_BUF_SIZE
2070 #define YY_READ_BUF_SIZE 262144
2071 #endif
2072
2073 /* Copy whatever the last rule matched to the standard output. */
2074 #ifndef ECHO
2075 /* This used to be an fputs(), but since the string might contain NUL's,
2076  * we now use fwrite().
2077  */
2078 #define ECHO fwrite( pycodeYYtext, pycodeYYleng, 1, pycodeYYout )
2079 #endif
2080
2081 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
2082  * is returned in "result".
2083  */
2084 #ifndef YY_INPUT
2085 #define YY_INPUT(buf,result,max_size) \
2086         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
2087                 { \
2088                 int c = '*'; \
2089                 yy_size_t n; \
2090                 for ( n = 0; n < max_size && \
2091                              (c = getc( pycodeYYin )) != EOF && c != '\n'; ++n ) \
2092                         buf[n] = (char) c; \
2093                 if ( c == '\n' ) \
2094                         buf[n++] = (char) c; \
2095                 if ( c == EOF && ferror( pycodeYYin ) ) \
2096                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
2097                 result = n; \
2098                 } \
2099         else \
2100                 { \
2101                 errno=0; \
2102                 while ( (result = fread(buf, 1, max_size, pycodeYYin))==0 && ferror(pycodeYYin)) \
2103                         { \
2104                         if( errno != EINTR) \
2105                                 { \
2106                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
2107                                 break; \
2108                                 } \
2109                         errno=0; \
2110                         clearerr(pycodeYYin); \
2111                         } \
2112                 }\
2113 \
2114
2115 #endif
2116
2117 /* No semi-colon after return; correct usage is to write "yyterminate();" -
2118  * we don't want an extra ';' after the "return" because that will cause
2119  * some compilers to complain about unreachable statements.
2120  */
2121 #ifndef yyterminate
2122 #define yyterminate() return YY_NULL
2123 #endif
2124
2125 /* Number of entries by which start-condition stack grows. */
2126 #ifndef YY_START_STACK_INCR
2127 #define YY_START_STACK_INCR 25
2128 #endif
2129
2130 /* Report a fatal error. */
2131 #ifndef YY_FATAL_ERROR
2132 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
2133 #endif
2134
2135 /* end tables serialization structures and prototypes */
2136
2137 /* Default declaration of generated scanner - a define so the user can
2138  * easily add parameters.
2139  */
2140 #ifndef YY_DECL
2141 #define YY_DECL_IS_OURS 1
2142
2143 extern int pycodeYYlex (void);
2144
2145 #define YY_DECL int pycodeYYlex (void)
2146 #endif /* !YY_DECL */
2147
2148 /* Code executed at the beginning of each rule, after pycodeYYtext and pycodeYYleng
2149  * have been set up.
2150  */
2151 #ifndef YY_USER_ACTION
2152 #define YY_USER_ACTION
2153 #endif
2154
2155 /* Code executed at the end of each rule. */
2156 #ifndef YY_BREAK
2157 #define YY_BREAK break;
2158 #endif
2159
2160 #define YY_RULE_SETUP \
2161         YY_USER_ACTION
2162
2163 /** The main scanner function which does all the work.
2164  */
2165 YY_DECL
2166 {
2167         register yy_state_type yy_current_state;
2168         register char *yy_cp, *yy_bp;
2169         register int yy_act;
2170     
2171 #line 969 "pycode.l"
2172
2173
2174 #line 2175 "<stdout>"
2175
2176         if ( !(yy_init) )
2177                 {
2178                 (yy_init) = 1;
2179
2180 #ifdef YY_USER_INIT
2181                 YY_USER_INIT;
2182 #endif
2183
2184         /* Create the reject buffer large enough to save one state per allowed character. */
2185         if ( ! (yy_state_buf) )
2186             (yy_state_buf) = (yy_state_type *)pycodeYYalloc(YY_STATE_BUF_SIZE  );
2187             if ( ! (yy_state_buf) )
2188                 YY_FATAL_ERROR( "out of dynamic memory in pycodeYYlex()" );
2189
2190                 if ( ! (yy_start) )
2191                         (yy_start) = 1; /* first start state */
2192
2193                 if ( ! pycodeYYin )
2194                         pycodeYYin = stdin;
2195
2196                 if ( ! pycodeYYout )
2197                         pycodeYYout = stdout;
2198
2199                 if ( ! YY_CURRENT_BUFFER ) {
2200                         pycodeYYensure_buffer_stack ();
2201                         YY_CURRENT_BUFFER_LVALUE =
2202                                 pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE );
2203                 }
2204
2205                 pycodeYY_load_buffer_state( );
2206                 }
2207
2208         while ( 1 )             /* loops until end-of-file is reached */
2209                 {
2210                 yy_cp = (yy_c_buf_p);
2211
2212                 /* Support of pycodeYYtext. */
2213                 *yy_cp = (yy_hold_char);
2214
2215                 /* yy_bp points to the position in yy_ch_buf of the start of
2216                  * the current run.
2217                  */
2218                 yy_bp = yy_cp;
2219
2220                 yy_current_state = (yy_start);
2221
2222                 (yy_state_ptr) = (yy_state_buf);
2223                 *(yy_state_ptr)++ = yy_current_state;
2224
2225 yy_match:
2226                 do
2227                         {
2228                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
2229                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2230                                 {
2231                                 yy_current_state = (int) yy_def[yy_current_state];
2232                                 if ( yy_current_state >= 505 )
2233                                         yy_c = yy_meta[(unsigned int) yy_c];
2234                                 }
2235                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2236                         *(yy_state_ptr)++ = yy_current_state;
2237                         ++yy_cp;
2238                         }
2239                 while ( yy_base[yy_current_state] != 1627 );
2240
2241 yy_find_action:
2242                 yy_current_state = *--(yy_state_ptr);
2243                 (yy_lp) = yy_accept[yy_current_state];
2244 goto find_rule; /* Shut up GCC warning -Wall */
2245 find_rule: /* we branch to this label when backing up */
2246                 for ( ; ; ) /* until we find what rule we matched */
2247                         {
2248                         if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
2249                                 {
2250                                 yy_act = yy_acclist[(yy_lp)];
2251                                 if ( yy_act & YY_TRAILING_HEAD_MASK ||
2252                                      (yy_looking_for_trail_begin) )
2253                                         {
2254                                         if ( yy_act == (yy_looking_for_trail_begin) )
2255                                                 {
2256                                                 (yy_looking_for_trail_begin) = 0;
2257                                                 yy_act &= ~YY_TRAILING_HEAD_MASK;
2258                                                 break;
2259                                                 }
2260                                         }
2261                                 else if ( yy_act & YY_TRAILING_MASK )
2262                                         {
2263                                         (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
2264                                         (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
2265                                         (yy_full_match) = yy_cp;
2266                                         (yy_full_state) = (yy_state_ptr);
2267                                         (yy_full_lp) = (yy_lp);
2268                                         }
2269                                 else
2270                                         {
2271                                         (yy_full_match) = yy_cp;
2272                                         (yy_full_state) = (yy_state_ptr);
2273                                         (yy_full_lp) = (yy_lp);
2274                                         break;
2275                                         }
2276                                 ++(yy_lp);
2277                                 goto find_rule;
2278                                 }
2279                         --yy_cp;
2280                         yy_current_state = *--(yy_state_ptr);
2281                         (yy_lp) = yy_accept[yy_current_state];
2282                         }
2283
2284                 YY_DO_BEFORE_ACTION;
2285
2286 do_action:      /* This label is used only to access EOF actions. */
2287
2288                 switch ( yy_act )
2289         { /* beginning of action switch */
2290
2291 case 1:
2292 YY_RULE_SETUP
2293 #line 972 "pycode.l"
2294 {
2295                                         startFontClass("keyword");
2296                                         codify(pycodeYYtext);
2297                                         endFontClass();
2298                                         BEGIN( FunctionDec );
2299                                     }
2300         YY_BREAK
2301 case 2:
2302 YY_RULE_SETUP
2303 #line 979 "pycode.l"
2304 {
2305                                         startFontClass("keyword");
2306                                         codify(pycodeYYtext);
2307                                         endFontClass();
2308                                         BEGIN( ClassDec );
2309                                     }
2310         YY_BREAK
2311 case 3:
2312 YY_RULE_SETUP
2313 #line 985 "pycode.l"
2314 {
2315                                         startFontClass("keywordtype");
2316                                         codify(pycodeYYtext);
2317                                         endFontClass();
2318                                     }
2319         YY_BREAK
2320 case 4:
2321 *yy_cp = (yy_hold_char); /* undo effects of setting up pycodeYYtext */
2322 (yy_c_buf_p) = yy_cp -= 1;
2323 YY_DO_BEFORE_ACTION; /* set up pycodeYYtext again */
2324 YY_RULE_SETUP
2325 #line 990 "pycode.l"
2326 {
2327                                         codify("self.");
2328                                         findMemberLink(*g_code,&pycodeYYtext[5]);
2329                                     }
2330         YY_BREAK
2331 case 5:
2332 YY_RULE_SETUP
2333 #line 994 "pycode.l"
2334 {
2335                                         codify("self.");
2336                                         findMemberLink(*g_code,&pycodeYYtext[5]);
2337                                     }
2338         YY_BREAK
2339
2340 case 6:
2341 YY_RULE_SETUP
2342 #line 1000 "pycode.l"
2343 {
2344
2345                                         generateClassOrGlobalLink(*g_code,pycodeYYtext);
2346                                         // codify(pycodeYYtext);
2347                                         g_curClassName = pycodeYYtext;
2348                                         g_curClassBases.clear();
2349                                         BEGIN( ClassInheritance );
2350                                     }
2351         YY_BREAK
2352
2353 case 7:
2354 YY_RULE_SETUP
2355 #line 1010 "pycode.l"
2356 {
2357                                         codify(pycodeYYtext);
2358                                     }
2359         YY_BREAK
2360 case 8:
2361 YY_RULE_SETUP
2362 #line 1014 "pycode.l"
2363 {
2364                                         // The parser
2365                                         // is assuming
2366                                         // that ALL identifiers
2367                                         // in this state
2368                                         // are base classes;
2369                                         // it doesn't check to see
2370                                         // that the first parenthesis
2371                                         // has been seen.
2372
2373                                         // This is bad - it should
2374                                         // probably be more strict
2375                                         // about what to accept.
2376
2377                                         g_curClassBases.inSort(pycodeYYtext);
2378                                         generateClassOrGlobalLink(*g_code,pycodeYYtext);
2379                                         // codify(pycodeYYtext);
2380                                     }
2381         YY_BREAK
2382 case 9:
2383 YY_RULE_SETUP
2384 #line 1033 "pycode.l"
2385 {
2386                                       codify(pycodeYYtext);
2387
2388                                       // Assume this will
2389                                       // be a one-line suite;
2390                                       // found counter-example
2391                                       // in SuiteStart.
2392
2393                                       // Push a class scope
2394
2395                                       ClassDef *classDefToAdd = new ClassDef("<code>",1,g_curClassName,ClassDef::Class,0,0,FALSE);
2396                                       g_codeClassSDict.append(g_curClassName,classDefToAdd);
2397                                       char *s=g_curClassBases.first();
2398                                       while (s) 
2399                                       {
2400                                         ClassDef *baseDefToAdd;
2401                                         baseDefToAdd=g_codeClassSDict[s];
2402
2403                                         // Try to find class in global
2404                                         // scope
2405                                         if (baseDefToAdd==0) 
2406                                         {
2407                                           baseDefToAdd=getResolvedClass(g_currentDefinition,g_sourceFileDef,s);
2408                                         }
2409
2410                                         if (baseDefToAdd && baseDefToAdd!=classDefToAdd) 
2411                                         {
2412                                           classDefToAdd->insertBaseClass(baseDefToAdd,s,Public,Normal);
2413                                         }
2414
2415                                         s=g_curClassBases.next();
2416                                       }
2417
2418                                       // Reset class-parsing variables.
2419                                       g_curClassName.resize(0);
2420                                       g_curClassBases.clear();
2421                                       
2422                                       g_noSuiteFound = TRUE;
2423                                       BEGIN( SuiteStart );
2424                                     }
2425         YY_BREAK
2426
2427
2428 case 10:
2429 YY_RULE_SETUP
2430 #line 1077 "pycode.l"
2431 {
2432                                         generateFunctionLink(*g_code,pycodeYYtext);
2433                                     }
2434         YY_BREAK
2435 case 11:
2436 YY_RULE_SETUP
2437 #line 1081 "pycode.l"
2438 {
2439                                         codify(pycodeYYtext);
2440                                         BEGIN( FunctionParams );
2441                                     }
2442         YY_BREAK
2443
2444
2445 case 12:
2446 YY_RULE_SETUP
2447 #line 1088 "pycode.l"
2448 {
2449                                          // Parses delimiters
2450                                          codify(pycodeYYtext);
2451                                     }
2452         YY_BREAK
2453 case 13:
2454 YY_RULE_SETUP
2455 #line 1093 "pycode.l"
2456 {
2457                                          codify(pycodeYYtext);
2458                                     }
2459         YY_BREAK
2460 case 14:
2461 YY_RULE_SETUP
2462 #line 1097 "pycode.l"
2463 {
2464                                          codify(pycodeYYtext);
2465                                     }
2466         YY_BREAK
2467 case 15:
2468 YY_RULE_SETUP
2469 #line 1101 "pycode.l"
2470 {
2471                                       codify(pycodeYYtext);
2472
2473                                       // Assume this will
2474                                       // be a one-line suite;
2475                                       // found counter-example
2476                                       // in SuiteStart.
2477                                       g_noSuiteFound = TRUE;
2478                                       BEGIN( SuiteStart );
2479                                     }
2480         YY_BREAK
2481
2482
2483 case 16:
2484 YY_RULE_SETUP
2485 #line 1115 "pycode.l"
2486 {
2487                                  // Position-sensitive rules!
2488                                  // Must come AFTER keyword-triggered rules
2489                                  // Must come BEFORE identifier NONEMPTY-like rules
2490                                  //   to syntax highlight.
2491
2492                                  startFontClass("keyword");
2493                                  codify(pycodeYYtext);
2494                                  endFontClass();
2495                                }
2496         YY_BREAK
2497 case 17:
2498 YY_RULE_SETUP
2499 #line 1126 "pycode.l"
2500 {
2501                                  startFontClass("keywordflow");
2502                                  codify(pycodeYYtext);
2503                                  endFontClass();
2504                                }
2505         YY_BREAK
2506 case 18:
2507 *yy_cp = (yy_hold_char); /* undo effects of setting up pycodeYYtext */
2508 (yy_c_buf_p) = yy_cp -= 1;
2509 YY_DO_BEFORE_ACTION; /* set up pycodeYYtext again */
2510 YY_RULE_SETUP
2511 #line 1131 "pycode.l"
2512 {
2513                                  generateClassOrGlobalLink(*g_code,pycodeYYtext);
2514                                }
2515         YY_BREAK
2516 case 19:
2517 YY_RULE_SETUP
2518 #line 1134 "pycode.l"
2519 {
2520                                  generateClassOrGlobalLink(*g_code,pycodeYYtext,TRUE);
2521                                }
2522         YY_BREAK
2523 case 20:
2524 YY_RULE_SETUP
2525 #line 1137 "pycode.l"
2526 { codify(pycodeYYtext); }
2527         YY_BREAK
2528
2529
2530 case 21:
2531 YY_RULE_SETUP
2532 #line 1145 "pycode.l"
2533 {
2534                                          codify(pycodeYYtext);
2535                                        }
2536         YY_BREAK
2537 case 22:
2538 YY_RULE_SETUP
2539 #line 1148 "pycode.l"
2540 {
2541                                           startFontClass("keyword");
2542                                           codifyLines(pycodeYYtext);
2543                                           endFontClass();
2544                                           BEGIN(Body);
2545                                        }
2546         YY_BREAK
2547 case 23:
2548 YY_RULE_SETUP
2549 #line 1154 "pycode.l"
2550 {
2551                                           startFontClass("keyword");
2552                                           codifyLines(pycodeYYtext);
2553                                           endFontClass();
2554
2555                                           // No indentation necesary
2556                                           g_noSuiteFound = FALSE;
2557                                        }
2558         YY_BREAK
2559 case 24:
2560 YY_RULE_SETUP
2561 #line 1163 "pycode.l"
2562 {
2563                                           startFontClass("keywordflow");
2564                                           codifyLines(pycodeYYtext);
2565                                           endFontClass();
2566
2567                                           // No indentation necesary
2568                                           g_noSuiteFound = FALSE;
2569                                        }
2570         YY_BREAK
2571 case 25:
2572 YY_RULE_SETUP
2573 #line 1171 "pycode.l"
2574 {
2575                                          codify(pycodeYYtext);
2576                                        } 
2577         YY_BREAK
2578 case 26:
2579 YY_RULE_SETUP
2580 #line 1176 "pycode.l"
2581 {
2582                                           // This eats EVERYTHING
2583                                           // except the newline
2584                                           startFontClass("comment");
2585                                           codifyLines(pycodeYYtext);
2586                                           endFontClass();
2587                                        }
2588         YY_BREAK
2589 case 27:
2590 /* rule 27 can match eol */
2591 YY_RULE_SETUP
2592 #line 1184 "pycode.l"
2593 {
2594                                           codifyLines(pycodeYYtext);
2595                                           if ( g_noSuiteFound ) 
2596                                           {
2597                                             // printf("New suite to capture! [%d]\n", g_yyLineNr);
2598                                             BEGIN ( SuiteCaptureIndent );
2599                                           }
2600                                        }
2601         YY_BREAK
2602
2603
2604 case 28:
2605 /* rule 28 can match eol */
2606 YY_RULE_SETUP
2607 #line 1195 "pycode.l"
2608 {
2609                                  // Blankline - ignore, keep looking for indentation.
2610                                  codifyLines(pycodeYYtext);
2611                                }
2612         YY_BREAK
2613 case 29:
2614 YY_RULE_SETUP
2615 #line 1200 "pycode.l"
2616 {
2617                                  // This state lasts momentarily,
2618                                  // to check the indentation
2619                                  // level that is about to be
2620                                  // used.
2621                                  codifyLines(pycodeYYtext);
2622                                  g_indents.push(pycodeYYleng);
2623                                  // printf("Captured indent of %d [line %d]\n", pycodeYYleng, g_yyLineNr);
2624                                  BEGIN( Suite );
2625                                }
2626         YY_BREAK
2627
2628
2629 case 30:
2630 YY_RULE_SETUP
2631 #line 1214 "pycode.l"
2632 {
2633                                  // This implements poor
2634                                  // indendation-tracking;
2635                                  // should be improved.
2636                                  // (translate tabs to space, etc)
2637                                  codifyLines(pycodeYYtext);
2638                                  adjustScopesAndSuites(pycodeYYleng);
2639                                }
2640         YY_BREAK
2641 case 31:
2642 /* rule 31 can match eol */
2643 YY_RULE_SETUP
2644 #line 1223 "pycode.l"
2645 {
2646                                  // If this ever succeeds,
2647                                  // it means that this is
2648                                  // a blank line, and
2649                                  // can be ignored.
2650                                  codifyLines(pycodeYYtext);
2651                                }
2652         YY_BREAK
2653 case 32:
2654 YY_RULE_SETUP
2655 #line 1231 "pycode.l"
2656 {
2657                                  // Default rule; matches
2658                                  // the empty string, assuming
2659                                  // real text starts here.
2660                                  // Just go straight to Body.
2661                                  adjustScopesAndSuites(0);
2662                                }
2663         YY_BREAK
2664
2665 case 33:
2666 /* rule 33 can match eol */
2667 YY_RULE_SETUP
2668 #line 1241 "pycode.l"
2669 {
2670                                  codifyLines(pycodeYYtext);
2671                                  BEGIN( SuiteMaintain );
2672                                }
2673         YY_BREAK
2674 case 34:
2675 YY_RULE_SETUP
2676 #line 1245 "pycode.l"
2677 {
2678                                  codify(pycodeYYtext);
2679                                }
2680         YY_BREAK
2681 case 35:
2682 /* rule 35 can match eol */
2683 YY_RULE_SETUP
2684 #line 1248 "pycode.l"
2685 {
2686                                  codifyLines(pycodeYYtext);
2687                                }
2688         YY_BREAK
2689 // Single quoted string like 'That\'s a """nice""" string!'
2690 case 36:
2691 /* rule 36 can match eol */
2692 YY_RULE_SETUP
2693 #line 1253 "pycode.l"
2694 { // line continuation
2695                                  codifyLines(pycodeYYtext);
2696                                }
2697         YY_BREAK
2698 case 37:
2699 YY_RULE_SETUP
2700 #line 1256 "pycode.l"
2701 { // espaced char
2702                                  codify(pycodeYYtext);
2703                                }
2704         YY_BREAK
2705 case 38:
2706 YY_RULE_SETUP
2707 #line 1259 "pycode.l"
2708 { // tripple double quotes
2709                                  codify(pycodeYYtext);
2710                                }
2711         YY_BREAK
2712 case 39:
2713 YY_RULE_SETUP
2714 #line 1262 "pycode.l"
2715 { // end of the string
2716                                  codify(pycodeYYtext);
2717                                  endFontClass();
2718                                  BEGIN(g_stringContext);
2719                                }
2720         YY_BREAK
2721 case 40:
2722 YY_RULE_SETUP
2723 #line 1267 "pycode.l"
2724 { // normal chars
2725                                  codify(pycodeYYtext);
2726                                }
2727         YY_BREAK
2728 case 41:
2729 YY_RULE_SETUP
2730 #line 1270 "pycode.l"
2731 { // normal char
2732                                  codify(pycodeYYtext);
2733                                }
2734         YY_BREAK
2735
2736 // Double quoted string like "That's \"a '''nice'''\" string!"
2737 case 42:
2738 /* rule 42 can match eol */
2739 YY_RULE_SETUP
2740 #line 1276 "pycode.l"
2741 { // line continuation
2742                                  codifyLines(pycodeYYtext);
2743                                }
2744         YY_BREAK
2745 case 43:
2746 YY_RULE_SETUP
2747 #line 1279 "pycode.l"
2748 { // espaced char
2749                                  codify(pycodeYYtext);
2750                                }
2751         YY_BREAK
2752 case 44:
2753 YY_RULE_SETUP
2754 #line 1282 "pycode.l"
2755 { // tripple single quotes
2756                                  codify(pycodeYYtext);
2757                                }
2758         YY_BREAK
2759 case 45:
2760 YY_RULE_SETUP
2761 #line 1285 "pycode.l"
2762 { // end of the string
2763                                  codify(pycodeYYtext);
2764                                  endFontClass();
2765                                  BEGIN(g_stringContext);
2766                                }
2767         YY_BREAK
2768 case 46:
2769 YY_RULE_SETUP
2770 #line 1290 "pycode.l"
2771 { // normal chars
2772                                  codify(pycodeYYtext);
2773                                }
2774         YY_BREAK
2775 case 47:
2776 YY_RULE_SETUP
2777 #line 1293 "pycode.l"
2778 { // normal char
2779                                  codify(pycodeYYtext);
2780                                }
2781         YY_BREAK
2782
2783
2784 case 48:
2785 #line 1300 "pycode.l"
2786 case 49:
2787 YY_RULE_SETUP
2788 #line 1300 "pycode.l"
2789 {
2790                           codify(pycodeYYtext);
2791                           if (g_doubleQuote==(pycodeYYtext[0]=='"')) 
2792                           {
2793                             endFontClass();
2794                             BEGIN(g_stringContext);
2795                           }
2796                        }
2797         YY_BREAK
2798 case 50:
2799 /* rule 50 can match eol */
2800 YY_RULE_SETUP
2801 #line 1308 "pycode.l"
2802 {
2803                          codifyLines(pycodeYYtext);
2804                        }
2805         YY_BREAK
2806 case 51:
2807 /* rule 51 can match eol */
2808 YY_RULE_SETUP
2809 #line 1311 "pycode.l"
2810 {
2811                          codifyLines(pycodeYYtext);
2812                        }
2813         YY_BREAK
2814 case 52:
2815 YY_RULE_SETUP
2816 #line 1314 "pycode.l"
2817 {
2818                          codify(pycodeYYtext);
2819                        }
2820         YY_BREAK
2821
2822 /*
2823 <*>({NONEMPTY}|{EXPCHAR}|{BB})           { // This should go one character at a time.
2824                                  codify(pycodeYYtext);
2825                                  // printf("[pycode] '%s' [ state %d ]  [line %d] no match\n",
2826                                  //       pycodeYYtext, YY_START, g_yyLineNr);
2827
2828                                  //endFontClass();
2829                                  BEGIN(Body);                                   
2830                                }
2831    */
2832 case 53:
2833 #line 1331 "pycode.l"
2834 case 54:
2835 YY_RULE_SETUP
2836 #line 1331 "pycode.l"
2837 {
2838                                  startFontClass("stringliteral");
2839                                  g_stringContext=YY_START;
2840                                  g_doubleQuote=pycodeYYtext[pycodeYYleng-1]=='"';
2841                                  codify(pycodeYYtext);
2842                                  BEGIN(TripleString);
2843                                }
2844         YY_BREAK
2845 case 55:
2846 YY_RULE_SETUP
2847 #line 1338 "pycode.l"
2848 { // single quoted string
2849                                  startFontClass("stringliteral");
2850                                  g_stringContext=YY_START;
2851                                  codify(pycodeYYtext);
2852                                  BEGIN(SingleQuoteString);
2853                                }
2854         YY_BREAK
2855 case 56:
2856 YY_RULE_SETUP
2857 #line 1344 "pycode.l"
2858 { // double quoted string
2859                                  startFontClass("stringliteral");
2860                                  g_stringContext=YY_START;
2861                                  codify(pycodeYYtext);
2862                                  BEGIN(DoubleQuoteString);
2863                                }
2864         YY_BREAK
2865 case 57:
2866 YY_RULE_SETUP
2867 #line 1350 "pycode.l"
2868 {
2869                                  if (YY_START==SingleQuoteString || 
2870                                      YY_START==DoubleQuoteString || 
2871                                      YY_START==TripleString
2872                                     )
2873                                  {
2874                                    REJECT;
2875                                  }
2876                                  // This eats EVERYTHING
2877                                  // except the newline
2878                                  startFontClass("comment");
2879                                  codifyLines(pycodeYYtext);
2880                                  endFontClass();
2881                                }
2882         YY_BREAK
2883 case 58:
2884 /* rule 58 can match eol */
2885 YY_RULE_SETUP
2886 #line 1364 "pycode.l"
2887 {
2888                                  codifyLines(pycodeYYtext);
2889                                  //printf("[pycode] %d NEWLINE [line %d] no match\n",
2890                                  //       YY_START, g_yyLineNr);
2891
2892                                  //endFontClass();
2893                                  BEGIN(Body);
2894                                }
2895         YY_BREAK
2896 case 59:
2897 YY_RULE_SETUP
2898 #line 1373 "pycode.l"
2899 {
2900                                  codify(pycodeYYtext);
2901                                  BEGIN(Body);                                   
2902                                }
2903         YY_BREAK
2904 case 60:
2905 YY_RULE_SETUP
2906 #line 1377 "pycode.l"
2907 {
2908                                  codify(pycodeYYtext);
2909                                  // printf("[pycode] '%s' [ state %d ]  [line %d] no match\n",
2910                                  //        pycodeYYtext, YY_START, g_yyLineNr);
2911
2912                                  //endFontClass();
2913                                  BEGIN(Body);                                   
2914                                }
2915         YY_BREAK
2916 case 61:
2917 YY_RULE_SETUP
2918 #line 1386 "pycode.l"
2919 ECHO;
2920         YY_BREAK
2921 #line 2922 "<stdout>"
2922                         case YY_STATE_EOF(INITIAL):
2923                         case YY_STATE_EOF(Body):
2924                         case YY_STATE_EOF(FunctionDec):
2925                         case YY_STATE_EOF(FunctionParams):
2926                         case YY_STATE_EOF(ClassDec):
2927                         case YY_STATE_EOF(ClassInheritance):
2928                         case YY_STATE_EOF(Suite):
2929                         case YY_STATE_EOF(SuiteCaptureIndent):
2930                         case YY_STATE_EOF(SuiteStart):
2931                         case YY_STATE_EOF(SuiteMaintain):
2932                         case YY_STATE_EOF(SuiteContinuing):
2933                         case YY_STATE_EOF(LongString):
2934                         case YY_STATE_EOF(SingleQuoteString):
2935                         case YY_STATE_EOF(DoubleQuoteString):
2936                         case YY_STATE_EOF(TripleString):
2937                                 yyterminate();
2938
2939         case YY_END_OF_BUFFER:
2940                 {
2941                 /* Amount of text matched not including the EOB char. */
2942                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2943
2944                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2945                 *yy_cp = (yy_hold_char);
2946                 YY_RESTORE_YY_MORE_OFFSET
2947
2948                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2949                         {
2950                         /* We're scanning a new file or input source.  It's
2951                          * possible that this happened because the user
2952                          * just pointed pycodeYYin at a new source and called
2953                          * pycodeYYlex().  If so, then we have to assure
2954                          * consistency between YY_CURRENT_BUFFER and our
2955                          * globals.  Here is the right place to do so, because
2956                          * this is the first action (other than possibly a
2957                          * back-up) that will match for the new input source.
2958                          */
2959                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2960                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = pycodeYYin;
2961                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2962                         }
2963
2964                 /* Note that here we test for yy_c_buf_p "<=" to the position
2965                  * of the first EOB in the buffer, since yy_c_buf_p will
2966                  * already have been incremented past the NUL character
2967                  * (since all states make transitions on EOB to the
2968                  * end-of-buffer state).  Contrast this with the test
2969                  * in input().
2970                  */
2971                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2972                         { /* This was really a NUL. */
2973                         yy_state_type yy_next_state;
2974
2975                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2976
2977                         yy_current_state = yy_get_previous_state(  );
2978
2979                         /* Okay, we're now positioned to make the NUL
2980                          * transition.  We couldn't have
2981                          * yy_get_previous_state() go ahead and do it
2982                          * for us because it doesn't know how to deal
2983                          * with the possibility of jamming (and we don't
2984                          * want to build jamming into it because then it
2985                          * will run more slowly).
2986                          */
2987
2988                         yy_next_state = yy_try_NUL_trans( yy_current_state );
2989
2990                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2991
2992                         if ( yy_next_state )
2993                                 {
2994                                 /* Consume the NUL. */
2995                                 yy_cp = ++(yy_c_buf_p);
2996                                 yy_current_state = yy_next_state;
2997                                 goto yy_match;
2998                                 }
2999
3000                         else
3001                                 {
3002                                 yy_cp = (yy_c_buf_p);
3003                                 goto yy_find_action;
3004                                 }
3005                         }
3006
3007                 else switch ( yy_get_next_buffer(  ) )
3008                         {
3009                         case EOB_ACT_END_OF_FILE:
3010                                 {
3011                                 (yy_did_buffer_switch_on_eof) = 0;
3012
3013                                 if ( pycodeYYwrap( ) )
3014                                         {
3015                                         /* Note: because we've taken care in
3016                                          * yy_get_next_buffer() to have set up
3017                                          * pycodeYYtext, we can now set up
3018                                          * yy_c_buf_p so that if some total
3019                                          * hoser (like flex itself) wants to
3020                                          * call the scanner after we return the
3021                                          * YY_NULL, it'll still work - another
3022                                          * YY_NULL will get returned.
3023                                          */
3024                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
3025
3026                                         yy_act = YY_STATE_EOF(YY_START);
3027                                         goto do_action;
3028                                         }
3029
3030                                 else
3031                                         {
3032                                         if ( ! (yy_did_buffer_switch_on_eof) )
3033                                                 YY_NEW_FILE;
3034                                         }
3035                                 break;
3036                                 }
3037
3038                         case EOB_ACT_CONTINUE_SCAN:
3039                                 (yy_c_buf_p) =
3040                                         (yytext_ptr) + yy_amount_of_matched_text;
3041
3042                                 yy_current_state = yy_get_previous_state(  );
3043
3044                                 yy_cp = (yy_c_buf_p);
3045                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3046                                 goto yy_match;
3047
3048                         case EOB_ACT_LAST_MATCH:
3049                                 (yy_c_buf_p) =
3050                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
3051
3052                                 yy_current_state = yy_get_previous_state(  );
3053
3054                                 yy_cp = (yy_c_buf_p);
3055                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3056                                 goto yy_find_action;
3057                         }
3058                 break;
3059                 }
3060
3061         default:
3062                 YY_FATAL_ERROR(
3063                         "fatal flex scanner internal error--no action found" );
3064         } /* end of action switch */
3065                 } /* end of scanning one token */
3066 } /* end of pycodeYYlex */
3067
3068 /* yy_get_next_buffer - try to read in a new buffer
3069  *
3070  * Returns a code representing an action:
3071  *      EOB_ACT_LAST_MATCH -
3072  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3073  *      EOB_ACT_END_OF_FILE - end of file
3074  */
3075 static int yy_get_next_buffer (void)
3076 {
3077         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
3078         register char *source = (yytext_ptr);
3079         register int number_to_move, i;
3080         int ret_val;
3081
3082         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
3083                 YY_FATAL_ERROR(
3084                 "fatal flex scanner internal error--end of buffer missed" );
3085
3086         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
3087                 { /* Don't try to fill the buffer, so this is an EOF. */
3088                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
3089                         {
3090                         /* We matched a single character, the EOB, so
3091                          * treat this as a final EOF.
3092                          */
3093                         return EOB_ACT_END_OF_FILE;
3094                         }
3095
3096                 else
3097                         {
3098                         /* We matched some text prior to the EOB, first
3099                          * process it.
3100                          */
3101                         return EOB_ACT_LAST_MATCH;
3102                         }
3103                 }
3104
3105         /* Try to read more data. */
3106
3107         /* First move last chars to start of buffer. */
3108         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
3109
3110         for ( i = 0; i < number_to_move; ++i )
3111                 *(dest++) = *(source++);
3112
3113         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3114                 /* don't do the read, it's not guaranteed to return an EOF,
3115                  * just force an EOF
3116                  */
3117                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
3118
3119         else
3120                 {
3121                         yy_size_t num_to_read =
3122                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3123
3124                 while ( num_to_read <= 0 )
3125                         { /* Not enough room in the buffer - grow it. */
3126
3127                         YY_FATAL_ERROR(
3128 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3129
3130                         }
3131
3132                 if ( num_to_read > YY_READ_BUF_SIZE )
3133                         num_to_read = YY_READ_BUF_SIZE;
3134
3135                 /* Read in more data. */
3136                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3137                         (yy_n_chars), num_to_read );
3138
3139                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3140                 }
3141
3142         if ( (yy_n_chars) == 0 )
3143                 {
3144                 if ( number_to_move == YY_MORE_ADJ )
3145                         {
3146                         ret_val = EOB_ACT_END_OF_FILE;
3147                         pycodeYYrestart(pycodeYYin  );
3148                         }
3149
3150                 else
3151                         {
3152                         ret_val = EOB_ACT_LAST_MATCH;
3153                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3154                                 YY_BUFFER_EOF_PENDING;
3155                         }
3156                 }
3157
3158         else
3159                 ret_val = EOB_ACT_CONTINUE_SCAN;
3160
3161         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3162                 /* Extend the array by 50%, plus the number we really need. */
3163                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
3164                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pycodeYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
3165                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3166                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3167         }
3168
3169         (yy_n_chars) += number_to_move;
3170         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
3171         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
3172
3173         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3174
3175         return ret_val;
3176 }
3177
3178 /* yy_get_previous_state - get the state just before the EOB char was reached */
3179
3180     static yy_state_type yy_get_previous_state (void)
3181 {
3182         register yy_state_type yy_current_state;
3183         register char *yy_cp;
3184     
3185         yy_current_state = (yy_start);
3186
3187         (yy_state_ptr) = (yy_state_buf);
3188         *(yy_state_ptr)++ = yy_current_state;
3189
3190         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
3191                 {
3192                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3193                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3194                         {
3195                         yy_current_state = (int) yy_def[yy_current_state];
3196                         if ( yy_current_state >= 505 )
3197                                 yy_c = yy_meta[(unsigned int) yy_c];
3198                         }
3199                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3200                 *(yy_state_ptr)++ = yy_current_state;
3201                 }
3202
3203         return yy_current_state;
3204 }
3205
3206 /* yy_try_NUL_trans - try to make a transition on the NUL character
3207  *
3208  * synopsis
3209  *      next_state = yy_try_NUL_trans( current_state );
3210  */
3211     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
3212 {
3213         register int yy_is_jam;
3214     
3215         register YY_CHAR yy_c = 1;
3216         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3217                 {
3218                 yy_current_state = (int) yy_def[yy_current_state];
3219                 if ( yy_current_state >= 505 )
3220                         yy_c = yy_meta[(unsigned int) yy_c];
3221                 }
3222         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3223         yy_is_jam = (yy_current_state == 504);
3224         if ( ! yy_is_jam )
3225                 *(yy_state_ptr)++ = yy_current_state;
3226
3227         return yy_is_jam ? 0 : yy_current_state;
3228 }
3229
3230 #ifndef YY_NO_INPUT
3231 #ifdef __cplusplus
3232     static int yyinput (void)
3233 #else
3234     static int input  (void)
3235 #endif
3236
3237 {
3238         int c;
3239     
3240         *(yy_c_buf_p) = (yy_hold_char);
3241
3242         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
3243                 {
3244                 /* yy_c_buf_p now points to the character we want to return.
3245                  * If this occurs *before* the EOB characters, then it's a
3246                  * valid NUL; if not, then we've hit the end of the buffer.
3247                  */
3248                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
3249                         /* This was really a NUL. */
3250                         *(yy_c_buf_p) = '\0';
3251
3252                 else
3253                         { /* need more input */
3254                         yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
3255                         ++(yy_c_buf_p);
3256
3257                         switch ( yy_get_next_buffer(  ) )
3258                                 {
3259                                 case EOB_ACT_LAST_MATCH:
3260                                         /* This happens because yy_g_n_b()
3261                                          * sees that we've accumulated a
3262                                          * token and flags that we need to
3263                                          * try matching the token before
3264                                          * proceeding.  But for input(),
3265                                          * there's no matching to consider.
3266                                          * So convert the EOB_ACT_LAST_MATCH
3267                                          * to EOB_ACT_END_OF_FILE.
3268                                          */
3269
3270                                         /* Reset buffer status. */
3271                                         pycodeYYrestart(pycodeYYin );
3272
3273                                         /*FALLTHROUGH*/
3274
3275                                 case EOB_ACT_END_OF_FILE:
3276                                         {
3277                                         if ( pycodeYYwrap( ) )
3278                                                 return 0;
3279
3280                                         if ( ! (yy_did_buffer_switch_on_eof) )
3281                                                 YY_NEW_FILE;
3282 #ifdef __cplusplus
3283                                         return yyinput();
3284 #else
3285                                         return input();
3286 #endif
3287                                         }
3288
3289                                 case EOB_ACT_CONTINUE_SCAN:
3290                                         (yy_c_buf_p) = (yytext_ptr) + offset;
3291                                         break;
3292                                 }
3293                         }
3294                 }
3295
3296         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
3297         *(yy_c_buf_p) = '\0';   /* preserve pycodeYYtext */
3298         (yy_hold_char) = *++(yy_c_buf_p);
3299
3300         return c;
3301 }
3302 #endif  /* ifndef YY_NO_INPUT */
3303
3304 /** Immediately switch to a different input stream.
3305  * @param input_file A readable stream.
3306  * 
3307  * @note This function does not reset the start condition to @c INITIAL .
3308  */
3309     void pycodeYYrestart  (FILE * input_file )
3310 {
3311     
3312         if ( ! YY_CURRENT_BUFFER ){
3313         pycodeYYensure_buffer_stack ();
3314                 YY_CURRENT_BUFFER_LVALUE =
3315             pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE );
3316         }
3317
3318         pycodeYY_init_buffer(YY_CURRENT_BUFFER,input_file );
3319         pycodeYY_load_buffer_state( );
3320 }
3321
3322 /** Switch to a different input buffer.
3323  * @param new_buffer The new input buffer.
3324  * 
3325  */
3326     void pycodeYY_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
3327 {
3328     
3329         /* TODO. We should be able to replace this entire function body
3330          * with
3331          *              pycodeYYpop_buffer_state();
3332          *              pycodeYYpush_buffer_state(new_buffer);
3333      */
3334         pycodeYYensure_buffer_stack ();
3335         if ( YY_CURRENT_BUFFER == new_buffer )
3336                 return;
3337
3338         if ( YY_CURRENT_BUFFER )
3339                 {
3340                 /* Flush out information for old buffer. */
3341                 *(yy_c_buf_p) = (yy_hold_char);
3342                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3343                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3344                 }
3345
3346         YY_CURRENT_BUFFER_LVALUE = new_buffer;
3347         pycodeYY_load_buffer_state( );
3348
3349         /* We don't actually know whether we did this switch during
3350          * EOF (pycodeYYwrap()) processing, but the only time this flag
3351          * is looked at is after pycodeYYwrap() is called, so it's safe
3352          * to go ahead and always set it.
3353          */
3354         (yy_did_buffer_switch_on_eof) = 1;
3355 }
3356
3357 static void pycodeYY_load_buffer_state  (void)
3358 {
3359         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3360         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3361         pycodeYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3362         (yy_hold_char) = *(yy_c_buf_p);
3363 }
3364
3365 /** Allocate and initialize an input buffer state.
3366  * @param file A readable stream.
3367  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3368  * 
3369  * @return the allocated buffer state.
3370  */
3371     YY_BUFFER_STATE pycodeYY_create_buffer  (FILE * file, int  size )
3372 {
3373         YY_BUFFER_STATE b;
3374     
3375         b = (YY_BUFFER_STATE) pycodeYYalloc(sizeof( struct yy_buffer_state )  );
3376         if ( ! b )
3377                 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_create_buffer()" );
3378
3379         b->yy_buf_size = size;
3380
3381         /* yy_ch_buf has to be 2 characters longer than the size given because
3382          * we need to put in 2 end-of-buffer characters.
3383          */
3384         b->yy_ch_buf = (char *) pycodeYYalloc(b->yy_buf_size + 2  );
3385         if ( ! b->yy_ch_buf )
3386                 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_create_buffer()" );
3387
3388         b->yy_is_our_buffer = 1;
3389
3390         pycodeYY_init_buffer(b,file );
3391
3392         return b;
3393 }
3394
3395 /** Destroy the buffer.
3396  * @param b a buffer created with pycodeYY_create_buffer()
3397  * 
3398  */
3399     void pycodeYY_delete_buffer (YY_BUFFER_STATE  b )
3400 {
3401     
3402         if ( ! b )
3403                 return;
3404
3405         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3406                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3407
3408         if ( b->yy_is_our_buffer )
3409                 pycodeYYfree((void *) b->yy_ch_buf  );
3410
3411         pycodeYYfree((void *) b  );
3412 }
3413
3414 #ifndef __cplusplus
3415 extern int isatty (int );
3416 #endif /* __cplusplus */
3417     
3418 /* Initializes or reinitializes a buffer.
3419  * This function is sometimes called more than once on the same buffer,
3420  * such as during a pycodeYYrestart() or at EOF.
3421  */
3422     static void pycodeYY_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
3423
3424 {
3425         int oerrno = errno;
3426     
3427         pycodeYY_flush_buffer(b );
3428
3429         b->yy_input_file = file;
3430         b->yy_fill_buffer = 1;
3431
3432     /* If b is the current buffer, then pycodeYY_init_buffer was _probably_
3433      * called from pycodeYYrestart() or through yy_get_next_buffer.
3434      * In that case, we don't want to reset the lineno or column.
3435      */
3436     if (b != YY_CURRENT_BUFFER){
3437         b->yy_bs_lineno = 1;
3438         b->yy_bs_column = 0;
3439     }
3440
3441         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3442     
3443         errno = oerrno;
3444 }
3445
3446 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3447  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3448  * 
3449  */
3450     void pycodeYY_flush_buffer (YY_BUFFER_STATE  b )
3451 {
3452         if ( ! b )
3453                 return;
3454
3455         b->yy_n_chars = 0;
3456
3457         /* We always need two end-of-buffer characters.  The first causes
3458          * a transition to the end-of-buffer state.  The second causes
3459          * a jam in that state.
3460          */
3461         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3462         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3463
3464         b->yy_buf_pos = &b->yy_ch_buf[0];
3465
3466         b->yy_at_bol = 1;
3467         b->yy_buffer_status = YY_BUFFER_NEW;
3468
3469         if ( b == YY_CURRENT_BUFFER )
3470                 pycodeYY_load_buffer_state( );
3471 }
3472
3473 /** Pushes the new state onto the stack. The new state becomes
3474  *  the current state. This function will allocate the stack
3475  *  if necessary.
3476  *  @param new_buffer The new state.
3477  *  
3478  */
3479 void pycodeYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
3480 {
3481         if (new_buffer == NULL)
3482                 return;
3483
3484         pycodeYYensure_buffer_stack();
3485
3486         /* This block is copied from pycodeYY_switch_to_buffer. */
3487         if ( YY_CURRENT_BUFFER )
3488                 {
3489                 /* Flush out information for old buffer. */
3490                 *(yy_c_buf_p) = (yy_hold_char);
3491                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3492                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3493                 }
3494
3495         /* Only push if top exists. Otherwise, replace top. */
3496         if (YY_CURRENT_BUFFER)
3497                 (yy_buffer_stack_top)++;
3498         YY_CURRENT_BUFFER_LVALUE = new_buffer;
3499
3500         /* copied from pycodeYY_switch_to_buffer. */
3501         pycodeYY_load_buffer_state( );
3502         (yy_did_buffer_switch_on_eof) = 1;
3503 }
3504
3505 /** Removes and deletes the top of the stack, if present.
3506  *  The next element becomes the new top.
3507  *  
3508  */
3509 void pycodeYYpop_buffer_state (void)
3510 {
3511         if (!YY_CURRENT_BUFFER)
3512                 return;
3513
3514         pycodeYY_delete_buffer(YY_CURRENT_BUFFER );
3515         YY_CURRENT_BUFFER_LVALUE = NULL;
3516         if ((yy_buffer_stack_top) > 0)
3517                 --(yy_buffer_stack_top);
3518
3519         if (YY_CURRENT_BUFFER) {
3520                 pycodeYY_load_buffer_state( );
3521                 (yy_did_buffer_switch_on_eof) = 1;
3522         }
3523 }
3524
3525 /* Allocates the stack if it does not exist.
3526  *  Guarantees space for at least one push.
3527  */
3528 static void pycodeYYensure_buffer_stack (void)
3529 {
3530         yy_size_t num_to_alloc;
3531     
3532         if (!(yy_buffer_stack)) {
3533
3534                 /* First allocation is just for 2 elements, since we don't know if this
3535                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3536                  * immediate realloc on the next call.
3537          */
3538                 num_to_alloc = 1;
3539                 (yy_buffer_stack) = (struct yy_buffer_state**)pycodeYYalloc
3540                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
3541                                                                 );
3542                 if ( ! (yy_buffer_stack) )
3543                         YY_FATAL_ERROR( "out of dynamic memory in pycodeYYensure_buffer_stack()" );
3544                                                                   
3545                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3546                                 
3547                 (yy_buffer_stack_max) = num_to_alloc;
3548                 (yy_buffer_stack_top) = 0;
3549                 return;
3550         }
3551
3552         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3553
3554                 /* Increase the buffer to prepare for a possible push. */
3555                 int grow_size = 8 /* arbitrary grow size */;
3556
3557                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3558                 (yy_buffer_stack) = (struct yy_buffer_state**)pycodeYYrealloc
3559                                                                 ((yy_buffer_stack),
3560                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
3561                                                                 );
3562                 if ( ! (yy_buffer_stack) )
3563                         YY_FATAL_ERROR( "out of dynamic memory in pycodeYYensure_buffer_stack()" );
3564
3565                 /* zero only the new slots.*/
3566                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3567                 (yy_buffer_stack_max) = num_to_alloc;
3568         }
3569 }
3570
3571 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3572  * @param base the character buffer
3573  * @param size the size in bytes of the character buffer
3574  * 
3575  * @return the newly allocated buffer state object. 
3576  */
3577 YY_BUFFER_STATE pycodeYY_scan_buffer  (char * base, yy_size_t  size )
3578 {
3579         YY_BUFFER_STATE b;
3580     
3581         if ( size < 2 ||
3582              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3583              base[size-1] != YY_END_OF_BUFFER_CHAR )
3584                 /* They forgot to leave room for the EOB's. */
3585                 return 0;
3586
3587         b = (YY_BUFFER_STATE) pycodeYYalloc(sizeof( struct yy_buffer_state )  );
3588         if ( ! b )
3589                 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_scan_buffer()" );
3590
3591         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3592         b->yy_buf_pos = b->yy_ch_buf = base;
3593         b->yy_is_our_buffer = 0;
3594         b->yy_input_file = 0;
3595         b->yy_n_chars = b->yy_buf_size;
3596         b->yy_is_interactive = 0;
3597         b->yy_at_bol = 1;
3598         b->yy_fill_buffer = 0;
3599         b->yy_buffer_status = YY_BUFFER_NEW;
3600
3601         pycodeYY_switch_to_buffer(b  );
3602
3603         return b;
3604 }
3605
3606 /** Setup the input buffer state to scan a string. The next call to pycodeYYlex() will
3607  * scan from a @e copy of @a str.
3608  * @param yystr a NUL-terminated string to scan
3609  * 
3610  * @return the newly allocated buffer state object.
3611  * @note If you want to scan bytes that may contain NUL values, then use
3612  *       pycodeYY_scan_bytes() instead.
3613  */
3614 YY_BUFFER_STATE pycodeYY_scan_string (yyconst char * yystr )
3615 {
3616     
3617         return pycodeYY_scan_bytes(yystr,strlen(yystr) );
3618 }
3619
3620 /** Setup the input buffer state to scan the given bytes. The next call to pycodeYYlex() will
3621  * scan from a @e copy of @a bytes.
3622  * @param bytes the byte buffer to scan
3623  * @param len the number of bytes in the buffer pointed to by @a bytes.
3624  * 
3625  * @return the newly allocated buffer state object.
3626  */
3627 YY_BUFFER_STATE pycodeYY_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
3628 {
3629         YY_BUFFER_STATE b;
3630         char *buf;
3631         yy_size_t n, i;
3632     
3633         /* Get memory for full buffer, including space for trailing EOB's. */
3634         n = _yybytes_len + 2;
3635         buf = (char *) pycodeYYalloc(n  );
3636         if ( ! buf )
3637                 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_scan_bytes()" );
3638
3639         for ( i = 0; i < _yybytes_len; ++i )
3640                 buf[i] = yybytes[i];
3641
3642         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3643
3644         b = pycodeYY_scan_buffer(buf,n );
3645         if ( ! b )
3646                 YY_FATAL_ERROR( "bad buffer in pycodeYY_scan_bytes()" );
3647
3648         /* It's okay to grow etc. this buffer, and we should throw it
3649          * away when we're done.
3650          */
3651         b->yy_is_our_buffer = 1;
3652
3653         return b;
3654 }
3655
3656 #ifndef YY_EXIT_FAILURE
3657 #define YY_EXIT_FAILURE 2
3658 #endif
3659
3660 static void yy_fatal_error (yyconst char* msg )
3661 {
3662         (void) fprintf( stderr, "%s\n", msg );
3663         exit( YY_EXIT_FAILURE );
3664 }
3665
3666 /* Redefine yyless() so it works in section 3 code. */
3667
3668 #undef yyless
3669 #define yyless(n) \
3670         do \
3671                 { \
3672                 /* Undo effects of setting up pycodeYYtext. */ \
3673         int yyless_macro_arg = (n); \
3674         YY_LESS_LINENO(yyless_macro_arg);\
3675                 pycodeYYtext[pycodeYYleng] = (yy_hold_char); \
3676                 (yy_c_buf_p) = pycodeYYtext + yyless_macro_arg; \
3677                 (yy_hold_char) = *(yy_c_buf_p); \
3678                 *(yy_c_buf_p) = '\0'; \
3679                 pycodeYYleng = yyless_macro_arg; \
3680                 } \
3681         while ( 0 )
3682
3683 /* Accessor  methods (get/set functions) to struct members. */
3684
3685 /** Get the current line number.
3686  * 
3687  */
3688 int pycodeYYget_lineno  (void)
3689 {
3690         
3691     return pycodeYYlineno;
3692 }
3693
3694 /** Get the input stream.
3695  * 
3696  */
3697 FILE *pycodeYYget_in  (void)
3698 {
3699         return pycodeYYin;
3700 }
3701
3702 /** Get the output stream.
3703  * 
3704  */
3705 FILE *pycodeYYget_out  (void)
3706 {
3707         return pycodeYYout;
3708 }
3709
3710 /** Get the length of the current token.
3711  * 
3712  */
3713 yy_size_t pycodeYYget_leng  (void)
3714 {
3715         return pycodeYYleng;
3716 }
3717
3718 /** Get the current token.
3719  * 
3720  */
3721
3722 char *pycodeYYget_text  (void)
3723 {
3724         return pycodeYYtext;
3725 }
3726
3727 /** Set the current line number.
3728  * @param line_number
3729  * 
3730  */
3731 void pycodeYYset_lineno (int  line_number )
3732 {
3733     
3734     pycodeYYlineno = line_number;
3735 }
3736
3737 /** Set the input stream. This does not discard the current
3738  * input buffer.
3739  * @param in_str A readable stream.
3740  * 
3741  * @see pycodeYY_switch_to_buffer
3742  */
3743 void pycodeYYset_in (FILE *  in_str )
3744 {
3745         pycodeYYin = in_str ;
3746 }
3747
3748 void pycodeYYset_out (FILE *  out_str )
3749 {
3750         pycodeYYout = out_str ;
3751 }
3752
3753 int pycodeYYget_debug  (void)
3754 {
3755         return pycodeYY_flex_debug;
3756 }
3757
3758 void pycodeYYset_debug (int  bdebug )
3759 {
3760         pycodeYY_flex_debug = bdebug ;
3761 }
3762
3763 static int yy_init_globals (void)
3764 {
3765         /* Initialization is the same as for the non-reentrant scanner.
3766      * This function is called from pycodeYYlex_destroy(), so don't allocate here.
3767      */
3768
3769     (yy_buffer_stack) = 0;
3770     (yy_buffer_stack_top) = 0;
3771     (yy_buffer_stack_max) = 0;
3772     (yy_c_buf_p) = (char *) 0;
3773     (yy_init) = 0;
3774     (yy_start) = 0;
3775
3776     (yy_state_buf) = 0;
3777     (yy_state_ptr) = 0;
3778     (yy_full_match) = 0;
3779     (yy_lp) = 0;
3780
3781 /* Defined in main.c */
3782 #ifdef YY_STDINIT
3783     pycodeYYin = stdin;
3784     pycodeYYout = stdout;
3785 #else
3786     pycodeYYin = (FILE *) 0;
3787     pycodeYYout = (FILE *) 0;
3788 #endif
3789
3790     /* For future reference: Set errno on error, since we are called by
3791      * pycodeYYlex_init()
3792      */
3793     return 0;
3794 }
3795
3796 /* pycodeYYlex_destroy is for both reentrant and non-reentrant scanners. */
3797 int pycodeYYlex_destroy  (void)
3798 {
3799     
3800     /* Pop the buffer stack, destroying each element. */
3801         while(YY_CURRENT_BUFFER){
3802                 pycodeYY_delete_buffer(YY_CURRENT_BUFFER  );
3803                 YY_CURRENT_BUFFER_LVALUE = NULL;
3804                 pycodeYYpop_buffer_state();
3805         }
3806
3807         /* Destroy the stack itself. */
3808         pycodeYYfree((yy_buffer_stack) );
3809         (yy_buffer_stack) = NULL;
3810
3811     pycodeYYfree ( (yy_state_buf) );
3812     (yy_state_buf)  = NULL;
3813
3814     /* Reset the globals. This is important in a non-reentrant scanner so the next time
3815      * pycodeYYlex() is called, initialization will occur. */
3816     yy_init_globals( );
3817
3818     return 0;
3819 }
3820
3821 /*
3822  * Internal utility routines.
3823  */
3824
3825 #ifndef yytext_ptr
3826 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3827 {
3828         register int i;
3829         for ( i = 0; i < n; ++i )
3830                 s1[i] = s2[i];
3831 }
3832 #endif
3833
3834 #ifdef YY_NEED_STRLEN
3835 static int yy_flex_strlen (yyconst char * s )
3836 {
3837         register int n;
3838         for ( n = 0; s[n]; ++n )
3839                 ;
3840
3841         return n;
3842 }
3843 #endif
3844
3845 void *pycodeYYalloc (yy_size_t  size )
3846 {
3847         return (void *) malloc( size );
3848 }
3849
3850 void *pycodeYYrealloc  (void * ptr, yy_size_t  size )
3851 {
3852         /* The cast to (char *) in the following accommodates both
3853          * implementations that use char* generic pointers, and those
3854          * that use void* generic pointers.  It works with the latter
3855          * because both ANSI C and C++ allow castless assignment from
3856          * any pointer type to void*, and deal with argument conversions
3857          * as though doing an assignment.
3858          */
3859         return (void *) realloc( (char *) ptr, size );
3860 }
3861
3862 void pycodeYYfree (void * ptr )
3863 {
3864         free( (char *) ptr );   /* see pycodeYYrealloc() for (char *) cast */
3865 }
3866
3867 #define YYTABLES_NAME "yytables"
3868
3869 #line 1386 "pycode.l"
3870
3871
3872
3873 /*@ ----------------------------------------------------------------------------
3874  */
3875
3876 void resetPythonCodeParserState() 
3877 {
3878   g_currentDefinition = 0;
3879   g_currentMemberDef = 0;
3880   g_doubleStringIsDoc = FALSE;
3881   g_paramParens = 0;
3882   g_indents.clear();
3883   BEGIN( Body );
3884 }
3885
3886 /*!
3887   Examines current stack of white-space indentations;
3888   re-syncs the parser with the correct scope.
3889 */
3890 static void adjustScopesAndSuites(unsigned indentLength) 
3891 {
3892   // States to pop
3893   if (!g_indents.isEmpty() && indentLength < g_indents.top()) 
3894   {
3895     while (!g_indents.isEmpty() && indentLength < g_indents.top()) 
3896     {
3897       // printf("Exited scope indent of [%d]\n", g_indents.top());
3898       g_indents.pop(); // Pop the old suite's indentation
3899
3900       g_currentMemberDef=0;
3901       if (g_currentDefinition) 
3902         g_currentDefinition=g_currentDefinition->getOuterScope();
3903     }
3904   }
3905
3906   // Are there any remaining indentation levels for suites?
3907   if (!g_indents.isEmpty()) 
3908   {
3909     BEGIN( Suite );
3910   }
3911   else 
3912   {
3913     BEGIN( Body );
3914   }
3915 }
3916
3917 void parsePythonCode(CodeOutputInterface &od,const char * /*className*/,
3918                  const QCString &s,bool exBlock, const char *exName,
3919                  FileDef *fd,int startLine,int endLine,bool /*inlineFragment*/,
3920                  MemberDef *,bool,Definition *searchCtx) 
3921 {
3922
3923   //printf("***parseCode()\n");
3924   
3925   //--------------------------------------
3926   if (s.isEmpty()) return;
3927   g_code = &od;
3928   g_inputString   = s;
3929   g_inputPosition = 0;
3930   g_currentFontClass = 0;
3931   g_needsTermination = FALSE;
3932   g_searchCtx=searchCtx;
3933   if (endLine!=-1)
3934     g_inputLines  = endLine+1;
3935   else
3936     g_inputLines  = countLines();
3937   
3938   if (startLine!=-1)
3939     g_yyLineNr    = startLine;
3940   else
3941     g_yyLineNr    = 1;
3942   
3943   g_exampleBlock  = exBlock; 
3944   g_exampleName   = exName;
3945   g_sourceFileDef = fd;
3946
3947   bool cleanupSourceDef = FALSE;
3948   if (fd==0)
3949   {
3950     // create a dummy filedef for the example
3951     g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
3952     cleanupSourceDef = TRUE;
3953   }
3954   if (g_sourceFileDef) 
3955   {
3956     setCurrentDoc("l00001");
3957   }
3958
3959   // Starts line 1 on the output  
3960   startCodeLine();
3961
3962   pycodeYYrestart( pycodeYYin );
3963
3964   pycodeYYlex();
3965
3966   if (!g_indents.isEmpty()) 
3967   {
3968     // printf("Exited pysourceparser in inconsistent state!\n");
3969   }
3970
3971   if (g_needsTermination)
3972   {
3973     endCodeLine();
3974   }
3975   if (cleanupSourceDef)
3976   {
3977     // delete the temporary file definition used for this example
3978     delete g_sourceFileDef;
3979     g_sourceFileDef=0;
3980   }
3981   return;
3982 }
3983
3984
3985 #if !defined(YY_FLEX_SUBMINOR_VERSION) 
3986 extern "C" { // some bogus code to keep the compiler happy
3987   void pycodeYYdummy() { yy_flex_realloc(0,0); } 
3988 }
3989 #elif YY_FLEX_SUBMINOR_VERSION<33
3990 #error "You seem to be using a version of flex newer than 2.5.4. These are currently incompatible with 2.5.4, and do NOT work with doxygen! Please use version 2.5.4 or expect things to be parsed wrongly! A bug report has been submitted (#732132)."
3991 #endif
3992
3993