4 #define YY_INT_ALIGNED short int
6 /* A lexical scanner generated by flex */
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
28 #define YY_FLEX_MAJOR_VERSION 2
29 #define YY_FLEX_MINOR_VERSION 5
30 #define YY_FLEX_SUBMINOR_VERSION 35
31 #if YY_FLEX_SUBMINOR_VERSION > 0
35 /* First, we deal with platform-specific or compiler-specific issues. */
37 /* begin standard C headers. */
43 /* end standard C headers. */
45 /* flex integer type definitions */
50 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
52 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
54 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
57 #ifndef __STDC_LIMIT_MACROS
58 #define __STDC_LIMIT_MACROS 1
62 typedef int8_t flex_int8_t;
63 typedef uint8_t flex_uint8_t;
64 typedef int16_t flex_int16_t;
65 typedef uint16_t flex_uint16_t;
66 typedef int32_t flex_int32_t;
67 typedef uint32_t flex_uint32_t;
68 typedef uint64_t flex_uint64_t;
70 typedef signed char flex_int8_t;
71 typedef short int flex_int16_t;
72 typedef int flex_int32_t;
73 typedef unsigned char flex_uint8_t;
74 typedef unsigned short int flex_uint16_t;
75 typedef unsigned int flex_uint32_t;
78 /* Limits of integral types. */
80 #define INT8_MIN (-128)
83 #define INT16_MIN (-32767-1)
86 #define INT32_MIN (-2147483647-1)
89 #define INT8_MAX (127)
92 #define INT16_MAX (32767)
95 #define INT32_MAX (2147483647)
98 #define UINT8_MAX (255U)
101 #define UINT16_MAX (65535U)
104 #define UINT32_MAX (4294967295U)
107 #endif /* ! FLEXINT_H */
111 /* The "const" storage-class-modifier is valid. */
114 #else /* ! __cplusplus */
116 /* C99 requires __STDC__ to be defined as 1. */
117 #if defined (__STDC__)
121 #endif /* defined (__STDC__) */
122 #endif /* ! __cplusplus */
125 #define yyconst const
130 /* Returned upon end-of-file. */
133 /* Promotes a possibly negative, possibly signed char to an unsigned
134 * integer for use as an array index. If the signed char is negative,
135 * we want to instead treat it as an 8-bit unsigned char, hence the
138 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
140 /* Enter a start condition. This macro really ought to take a parameter,
141 * but we do it the disgusting crufty way forced on us by the ()-less
142 * definition of BEGIN.
144 #define BEGIN (yy_start) = 1 + 2 *
146 /* Translate the current start state into a value that can be later handed
147 * to BEGIN to return to the state. The YYSTATE alias is for lex
150 #define YY_START (((yy_start) - 1) / 2)
151 #define YYSTATE YY_START
153 /* Action number for EOF rule of a given start state. */
154 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
156 /* Special action meaning "start processing a new file". */
157 #define YY_NEW_FILE pycodeYYrestart(pycodeYYin )
159 #define YY_END_OF_BUFFER_CHAR 0
161 /* Size of default input buffer. */
163 #define YY_BUF_SIZE 262144
166 /* The state buf must be large enough to hold one state per character in the main buffer.
168 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
170 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
171 #define YY_TYPEDEF_YY_BUFFER_STATE
172 typedef struct yy_buffer_state *YY_BUFFER_STATE;
175 #ifndef YY_TYPEDEF_YY_SIZE_T
176 #define YY_TYPEDEF_YY_SIZE_T
177 typedef size_t yy_size_t;
180 extern yy_size_t pycodeYYleng;
182 extern FILE *pycodeYYin, *pycodeYYout;
184 #define EOB_ACT_CONTINUE_SCAN 0
185 #define EOB_ACT_END_OF_FILE 1
186 #define EOB_ACT_LAST_MATCH 2
188 #define YY_LESS_LINENO(n)
190 /* Return all but the first "n" matched characters back to the input stream. */
194 /* Undo effects of setting up 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 */ \
204 #define unput(c) yyunput( c, (yytext_ptr) )
206 #ifndef YY_STRUCT_YY_BUFFER_STATE
207 #define YY_STRUCT_YY_BUFFER_STATE
208 struct yy_buffer_state
212 char *yy_ch_buf; /* input buffer */
213 char *yy_buf_pos; /* current position in input buffer */
215 /* Size of input buffer in bytes, not including room for EOB
218 yy_size_t yy_buf_size;
220 /* Number of characters read into yy_ch_buf, not including EOB
223 yy_size_t yy_n_chars;
225 /* Whether we "own" the buffer - i.e., we know we created it,
226 * and can realloc() it to grow it, and should free() it to
229 int yy_is_our_buffer;
231 /* Whether this is an "interactive" input source; if so, and
232 * if we're using stdio for input, then we want to use getc()
233 * instead of fread(), to make sure we stop fetching input after
236 int yy_is_interactive;
238 /* Whether we're considered to be at the beginning of a line.
239 * If so, '^' rules will be active on the next match, otherwise
244 int yy_bs_lineno; /**< The line count. */
245 int yy_bs_column; /**< The column count. */
247 /* Whether to try to fill the input buffer when we reach the
252 int yy_buffer_status;
254 #define YY_BUFFER_NEW 0
255 #define YY_BUFFER_NORMAL 1
256 /* When an EOF's been seen but there's still some text to process
257 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
258 * shouldn't try reading from the input source any more. We might
259 * still have a bunch of tokens to match, though, because of
260 * possible backing-up.
262 * When we actually see the EOF, we change the status to "new"
263 * (via pycodeYYrestart()), so that the user can continue scanning by
264 * just pointing pycodeYYin at a new input file.
266 #define YY_BUFFER_EOF_PENDING 2
269 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271 /* Stack of input buffers. */
272 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
273 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
274 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
276 /* We provide macros for accessing buffer states in case in the
277 * future we want to put the buffer states in a more general
280 * Returns the top of the stack, or NULL.
282 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
283 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
286 /* Same as previous macro, but useful when we know that the buffer stack is not
287 * NULL or when we need an lvalue. For internal use only.
289 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
291 /* yy_hold_char holds the character lost when 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;
296 /* Points to current character in buffer. */
297 static char *yy_c_buf_p = (char *) 0;
298 static int yy_init = 0; /* whether we need to initialize */
299 static int yy_start = 0; /* start state number */
301 /* Flag which is used to allow pycodeYYwrap()'s to do buffer switches
302 * instead of setting up a fresh pycodeYYin. A bit of a hack ...
304 static int yy_did_buffer_switch_on_eof;
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 );
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 );
318 #define YY_FLUSH_BUFFER pycodeYY_flush_buffer(YY_CURRENT_BUFFER )
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 );
324 void *pycodeYYalloc (yy_size_t );
325 void *pycodeYYrealloc (void *,yy_size_t );
326 void pycodeYYfree (void * );
328 #define yy_new_buffer pycodeYY_create_buffer
330 #define yy_set_interactive(is_interactive) \
332 if ( ! YY_CURRENT_BUFFER ){ \
333 pycodeYYensure_buffer_stack (); \
334 YY_CURRENT_BUFFER_LVALUE = \
335 pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE ); \
337 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
340 #define yy_set_bol(at_bol) \
342 if ( ! YY_CURRENT_BUFFER ){\
343 pycodeYYensure_buffer_stack (); \
344 YY_CURRENT_BUFFER_LVALUE = \
345 pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE ); \
347 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
350 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
352 /* Begin user sect3 */
354 #define pycodeYYwrap(n) 1
355 #define YY_SKIP_YYWRAP
357 typedef unsigned char YY_CHAR;
359 FILE *pycodeYYin = (FILE *) 0, *pycodeYYout = (FILE *) 0;
361 typedef int yy_state_type;
363 extern int pycodeYYlineno;
365 int pycodeYYlineno = 1;
367 extern char *pycodeYYtext;
368 #define yytext_ptr pycodeYYtext
370 static yy_state_type yy_get_previous_state (void );
371 static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
372 static int yy_get_next_buffer (void );
373 static void yy_fatal_error (yyconst char msg[] );
375 /* Done after the current pattern has been matched and before the
376 * corresponding action - sets up pycodeYYtext.
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; \
383 (yy_c_buf_p) = yy_cp;
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. */
391 flex_int32_t yy_verify;
394 static yyconst flex_int16_t yy_acclist[957] =
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
503 static yyconst flex_int16_t yy_accept[506] =
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,
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,
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,
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,
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,
560 953, 955, 956, 957, 957
563 static yyconst flex_int32_t yy_ec[256] =
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,
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,
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,
595 static yyconst flex_int32_t yy_meta[44] =
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,
604 static yyconst flex_int16_t yy_base[535] =
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,
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,
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,
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,
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,
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,
667 static yyconst flex_int16_t yy_def[535] =
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,
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,
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,
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,
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,
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,
730 static yyconst flex_int16_t yy_nxt[1671] =
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
917 static yyconst flex_int16_t yy_chk[1671] =
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
1104 extern int pycodeYY_flex_debug;
1105 int pycodeYY_flex_debug = 0;
1107 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
1108 static char *yy_full_match;
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
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 */ \
1126 #define yymore() yymore_used_but_not_detected
1127 #define YY_MORE_ADJ 0
1128 #define YY_RESTORE_YY_MORE_OFFSET
1131 /******************************************************************************
1133 * $Id: pycode.h,v 1.9 2001/03/19 19:27:39 root Exp $
1135 * Copyright (C) 1997-2012 by Dimitri van Heesch.
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.
1143 * Documents produced by Doxygen are derivative works derived from the
1144 * input used in their production; they are not affected by this license.
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>.
1156 #include <qvaluestack.h>
1159 #include "message.h"
1161 #include "scanner.h"
1163 #include "doxygen.h"
1164 #include "outputlist.h"
1166 #include "membername.h"
1167 #include "searchindex.h"
1169 #define YY_NEVER_INTERACTIVE 1
1170 #define YY_NO_INPUT 1
1172 static ClassSDict g_codeClassSDict(17);
1173 static QCString g_curClassName;
1174 static QStrList g_curClassBases;
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;
1197 static bool g_exampleBlock;
1198 static QCString g_exampleName;
1199 static QCString g_exampleFile;
1201 static QCString g_type;
1202 static QCString g_name;
1204 static bool g_doubleStringIsDoc;
1205 static bool g_doubleQuote;
1206 static bool g_noSuiteFound;
1207 static int g_stringContext;
1209 static QValueStack<uint> g_indents; //!< Tracks indentation levels for scoping in python
1211 static void endFontClass();
1212 static void adjustScopesAndSuites(unsigned indentLength);
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().
1220 class PyVariableContext
1223 static const ClassDef *dummyContext;
1224 class Scope : public SDict<ClassDef>
1227 Scope() : SDict<ClassDef>(17) {}
1232 m_scopes.setAutoDelete(TRUE);
1235 virtual ~PyVariableContext()
1241 m_scopes.append(new Scope);
1246 if (m_scopes.count()>0)
1248 m_scopes.remove(m_scopes.count()-1);
1255 m_globalScope.clear();
1258 void clearExceptGlobal()
1263 void addVariable(const QCString &type,const QCString &name);
1264 ClassDef *findVariable(const QCString &name);
1267 Scope m_globalScope;
1268 QList<Scope> m_scopes;
1271 void PyVariableContext::addVariable(const QCString &type,const QCString &name)
1273 //printf("PyVariableContext::addVariable(%s,%s)\n",type.data(),name.data());
1274 QCString ltype = type.simplifyWhiteSpace();
1275 QCString lname = name.simplifyWhiteSpace();
1277 Scope *scope = m_scopes.count()==0 ? &m_globalScope : m_scopes.getLast();
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
1284 scope->append(lname,varType); // add it to a list
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!
1292 scope->append(lname,dummyContext);
1297 ClassDef *PyVariableContext::findVariable(const QCString &name)
1299 if (name.isEmpty()) return 0;
1300 ClassDef *result = 0;
1301 QListIterator<Scope> sli(m_scopes);
1303 // search from inner to outer scope
1304 for (sli.toLast();(scope=sli.current());--sli)
1306 result = scope->find(name);
1312 // nothing found -> also try the global scope
1313 result=m_globalScope.find(name);
1317 static PyVariableContext g_theVarContext;
1318 const ClassDef *PyVariableContext::dummyContext = (ClassDef*)0x8;
1325 Ctx() : name(g_name), type(g_type), cd(0) {}
1333 m_classList.append(new Ctx);
1334 m_classList.setAutoDelete(TRUE);
1337 virtual ~PyCallContext() {}
1339 void setClass(ClassDef *cd)
1341 Ctx *ctx = m_classList.getLast();
1349 m_classList.append(new Ctx);
1354 if (m_classList.count()>1)
1356 Ctx *ctx = m_classList.getLast();
1362 m_classList.removeLast();
1371 m_classList.clear();
1372 m_classList.append(new Ctx);
1375 ClassDef *getClass() const
1377 Ctx *ctx = m_classList.getLast();
1386 QList<Ctx> m_classList;
1389 static PyCallContext g_theCallContext;
1392 /*! counts the number of lines in the input */
1393 static int countLines()
1395 const char *p=g_inputString;
1401 if (c=='\n') count++;
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.
1407 g_needsTermination=TRUE;
1412 static void setCurrentDoc(const QCString &anchor)
1414 if (Doxygen::searchIndex)
1418 Doxygen::searchIndex->setCurrentDoc(g_searchCtx,g_searchCtx->anchor(),FALSE);
1422 Doxygen::searchIndex->setCurrentDoc(g_sourceFileDef,anchor,TRUE);
1427 static void addToSearchIndex(const char *text)
1429 if (Doxygen::searchIndex)
1431 Doxygen::searchIndex->addWord(text,FALSE);
1436 static ClassDef *stripClassName(const char *s,Definition *d=g_currentDefinition)
1442 while (extractClassNameFromType(type,pos,className,templSpec)!=-1)
1444 QCString clName=className+templSpec;
1447 if (!g_classScope.isEmpty())
1449 cd=getResolvedClass(d,g_sourceFileDef,g_classScope+"::"+clName);
1453 cd=getResolvedClass(d,g_sourceFileDef,clName);
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.
1470 static void startCodeLine()
1472 //if (g_currentFontClass) { g_code->endFontClass(); }
1473 if (g_sourceFileDef)
1475 //QCString lineNumber,lineAnchor;
1476 //lineNumber.sprintf("%05d",g_yyLineNr);
1477 //lineAnchor.sprintf("l%05d",g_yyLineNr);
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())
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)
1496 g_code->writeLineNumber(g_currentMemberDef->getReference(),
1497 g_currentMemberDef->getOutputFileBase(),
1498 g_currentMemberDef->anchor(),g_yyLineNr);
1499 setCurrentDoc(lineAnchor);
1503 g_code->writeLineNumber(d->getReference(),
1504 d->getOutputFileBase(),
1506 setCurrentDoc(lineAnchor);
1511 //g_code->codify(lineNumber);
1512 g_code->writeLineNumber(0,0,0,g_yyLineNr);
1514 //g_code->endLineNumber();
1516 g_code->startCodeLine(g_sourceFileDef);
1517 if (g_currentFontClass)
1519 g_code->startFontClass(g_currentFontClass);
1523 static void codify(const char* text)
1525 g_code->codify(text);
1528 static void endCodeLine()
1531 g_code->endCodeLine();
1534 static void nextCodeLine()
1536 const char *fc = g_currentFontClass;
1538 if (g_yyLineNr<g_inputLines)
1540 g_currentFontClass = fc;
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.
1550 static void writeMultiLineCodeLink(CodeOutputInterface &ol,
1551 const char *ref,const char *file,
1552 const char *anchor,const char *text,
1553 const char *tooltip)
1556 char *p=(char *)text;
1561 while ((c=*p++) && c!='\n') { }
1566 //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
1567 ol.writeCodeLink(ref,file,anchor,sp,tooltip);
1572 //printf("writeCodeLink(%s,%s,%s,%s)\n",ref,file,anchor,sp);
1573 ol.writeCodeLink(ref,file,anchor,sp,tooltip);
1580 static void codifyLines(char *text)
1582 //printf("codifyLines(%d,\"%s\")\n",g_yyLineNr,text);
1589 while ((c=*p++) && c!='\n') { }
1605 static void addDocCrossReference(MemberDef *src,MemberDef *dst)
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()))
1615 dst->addSourceReferencedBy(src);
1617 if ((referencesRelation || callGraph) && (src->isFunction() || src->isSlot()))
1619 src->addSourceReferences(dst);
1625 static bool getLinkInScope(const QCString &c, // scope
1626 const QCString &m, // member
1627 const char *memberText, // exact text
1628 CodeOutputInterface &ol,
1637 //printf("Trying `%s'::`%s'\n",c.data(),m.data());
1638 if (getDefs(c,m,"()",md,cd,fd,nd,gd,FALSE,g_sourceFileDef) &&
1642 //if (cd) d=cd; else if (nd) d=nd; else if (fd) d=fd; else d=gd;
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())
1650 g_theCallContext.setClass(stripClassName(md->typeString(),md->getOuterScope()));
1651 //printf("g_currentDefinition=%p g_currentMemberDef=%p\n",
1652 // g_currentDefinition,g_currentMemberDef);
1654 if (g_currentDefinition && g_currentMemberDef &&
1655 md!=g_currentMemberDef)
1657 addDocCrossReference(g_currentMemberDef,md);
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());
1661 writeMultiLineCodeLink(ol,md->getReference(),
1662 md->getOutputFileBase(),
1664 text ? text : memberText,
1665 md->briefDescriptionAsTooltip());
1666 addToSearchIndex(text ? text : memberText);
1673 static bool getLink(const char *className,
1674 const char *memberName,
1675 CodeOutputInterface &ol,
1678 QCString m=removeRedundantWhiteSpace(memberName);
1679 QCString c=className;
1680 if (!getLinkInScope(c,m,memberName,ol,text))
1682 if (!g_curClassName.isEmpty())
1684 if (!c.isEmpty()) c.prepend("::");
1685 c.prepend(g_curClassName);
1686 return getLinkInScope(c,m,memberName,ol,text);
1695 For a given string in the source code,
1696 finds its class or global id and links to it.
1698 static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
1699 bool typeOnly=FALSE)
1701 QCString className=clName;
1703 // Don't do anything for empty text
1704 if (className.isEmpty()) return;
1706 //fprintf(stderr,"generateClassOrGlobalLink(className=%s)\n",className.data());
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;
1712 if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable
1714 Definition *d = g_currentDefinition;
1715 QCString scope = substitute(className,".","::");
1717 cd = getResolvedClass(d,g_sourceFileDef,substitute(className,".","::"),&md);
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>");
1724 if (cd==0 && md==0) // also see if it is variable or enum or enum value
1726 NamespaceDef *nd = getResolvedNamespace(scope);
1729 writeMultiLineCodeLink(ol,nd->getReference(),nd->getOutputFileBase(),nd->anchor(),clName,nd->briefDescriptionAsTooltip());
1730 addToSearchIndex(className);
1733 else if (getLink(g_classScope,clName,ol,clName))
1741 if (lcd!=PyVariableContext::dummyContext)
1743 g_theCallContext.setClass(lcd);
1746 //fprintf(stderr,"is a local variable cd=%p!\n",cd);
1749 if (cd && cd->isLinkable()) // is it a linkable class
1751 writeMultiLineCodeLink(ol,cd->getReference(),cd->getOutputFileBase(),cd->anchor(),clName,cd->briefDescriptionAsTooltip());
1752 addToSearchIndex(className);
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)
1760 addDocCrossReference(g_currentMemberDef,md);
1764 else // not a class, maybe a global member
1766 int scopeEnd = className.findRev(".");
1767 if (scopeEnd!=-1 && !typeOnly) // name with explicit scope
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);
1775 MemberDef *md = mcd->getMemberByName(locName);
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)
1786 addDocCrossReference(g_currentMemberDef,md);
1791 else // check namespace as well
1793 NamespaceDef *mnd = getResolvedNamespace(scope);
1796 MemberDef *md=mnd->getMemberByName(locName);
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)
1808 addDocCrossReference(g_currentMemberDef,md);
1816 // nothing found, just write out the word
1817 codifyLines(clName);
1818 addToSearchIndex(clName);
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.
1829 static void generateFunctionLink(CodeOutputInterface &ol,char *funcName)
1831 //CodeClassDef *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("::");
1839 locScope=locFunc.left(i);
1840 locFunc=locFunc.right(locFunc.length()-i-2).stripWhiteSpace();
1842 //printf("generateFunctionLink(%s) classScope=`%s'\n",locFunc.data(),locScope.data());
1843 if (!locScope.isEmpty() && (ccd=g_codeClassSDict[locScope]))
1845 //printf("using classScope %s\n",g_classScope.data());
1846 if (ccd->baseClasses())
1848 BaseClassListIterator bcli(*ccd->baseClasses());
1849 for ( ; bcli.current() ; ++bcli)
1851 if (getLink(bcli.current()->classDef->name(),locFunc,ol,funcName))
1858 if (!getLink(locScope,locFunc,ol,funcName))
1860 generateClassOrGlobalLink(ol,funcName);
1865 static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *symName)
1867 //printf("sym %s outerScope=%s equal=%d\n",
1868 // sym->name().data(),sym->getOuterScope()->name().data(),
1869 // sym->getOuterScope()==g_currentDefinition);
1871 if (sym->getOuterScope() &&
1872 sym->getOuterScope()->definitionType()==Definition::TypeClass &&
1873 g_currentDefinition->definitionType()==Definition::TypeClass)
1875 ClassDef *cd = (ClassDef*)sym->getOuterScope();
1876 ClassDef *thisCd = (ClassDef *)g_currentDefinition;
1877 QCString anchor=sym->anchor();
1878 if (sym->definitionType()==Definition::TypeMember)
1880 if (g_currentMemberDef)
1882 addDocCrossReference(g_currentMemberDef,(MemberDef*)sym);
1885 //fprintf(stderr,"cd=%s thisCd=%s\n",cd?cd->name().data():"<none>",thisCd?thisCd->name().data():"<none>");
1887 // TODO: find the nearest base class in case cd is a base class of
1889 if (cd==thisCd || (thisCd && thisCd->isBaseClass(cd,TRUE)))
1891 writeMultiLineCodeLink(ol,sym->getReference(),
1892 sym->getOutputFileBase(),
1895 sym->briefDescriptionAsTooltip());
1902 static void findMemberLink(CodeOutputInterface &ol,char *symName)
1904 //printf("Member reference: %s scope=%s member=%s\n",
1906 // g_currentDefinition?g_currentDefinition->name().data():"<none>",
1907 // g_currentMemberDef?g_currentMemberDef->name().data():"<none>"
1909 if (g_currentDefinition)
1911 DefinitionIntf *di = Doxygen::symbolMap->find(symName);
1914 if (di->definitionType()==DefinitionIntf::TypeSymbolList) // multiple symbols
1916 DefinitionListIterator dli(*(DefinitionList*)di);
1918 for (dli.toFirst();(sym=dli.current());++dli)
1920 if (findMemberLink(ol,sym,symName)) return;
1923 else // single symbol
1925 if (findMemberLink(ol,(Definition*)di,symName)) return;
1929 //printf("sym %s not found\n",&pycodeYYtext[5]);
1933 static void startFontClass(const char *s)
1936 g_code->startFontClass(s);
1937 g_currentFontClass=s;
1940 static void endFontClass()
1942 if (g_currentFontClass)
1944 g_code->endFontClass();
1945 g_currentFontClass=0;
1950 #define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
1952 static int yyread(char *buf,int max_size)
1955 while( c < max_size && g_inputString[g_inputPosition] )
1957 *buf = g_inputString[g_inputPosition++] ;
1977 #line 1978 "<stdout>"
1981 #define FunctionDec 2
1982 #define FunctionParams 3
1984 #define ClassInheritance 5
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
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.
2003 #ifndef YY_EXTRA_TYPE
2004 #define YY_EXTRA_TYPE void *
2007 static int yy_init_globals (void );
2009 /* Accessor methods to globals.
2010 These are made visible to non-reentrant scanners for convenience. */
2012 int pycodeYYlex_destroy (void );
2014 int pycodeYYget_debug (void );
2016 void pycodeYYset_debug (int debug_flag );
2018 YY_EXTRA_TYPE pycodeYYget_extra (void );
2020 void pycodeYYset_extra (YY_EXTRA_TYPE user_defined );
2022 FILE *pycodeYYget_in (void );
2024 void pycodeYYset_in (FILE * in_str );
2026 FILE *pycodeYYget_out (void );
2028 void pycodeYYset_out (FILE * out_str );
2030 yy_size_t pycodeYYget_leng (void );
2032 char *pycodeYYget_text (void );
2034 int pycodeYYget_lineno (void );
2036 void pycodeYYset_lineno (int line_number );
2038 /* Macros after this point can all be overridden by user definitions in
2042 #ifndef YY_SKIP_YYWRAP
2044 extern "C" int pycodeYYwrap (void );
2046 extern int pycodeYYwrap (void );
2051 static void yy_flex_strncpy (char *,yyconst char *,int );
2054 #ifdef YY_NEED_STRLEN
2055 static int yy_flex_strlen (yyconst char * );
2061 static int yyinput (void );
2063 static int input (void );
2068 /* Amount of stuff to slurp up with each read. */
2069 #ifndef YY_READ_BUF_SIZE
2070 #define YY_READ_BUF_SIZE 262144
2073 /* Copy whatever the last rule matched to the standard output. */
2075 /* This used to be an fputs(), but since the string might contain NUL's,
2076 * we now use fwrite().
2078 #define ECHO fwrite( pycodeYYtext, pycodeYYleng, 1, pycodeYYout )
2081 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
2082 * is returned in "result".
2085 #define YY_INPUT(buf,result,max_size) \
2086 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
2090 for ( n = 0; n < max_size && \
2091 (c = getc( pycodeYYin )) != EOF && c != '\n'; ++n ) \
2092 buf[n] = (char) c; \
2094 buf[n++] = (char) c; \
2095 if ( c == EOF && ferror( pycodeYYin ) ) \
2096 YY_FATAL_ERROR( "input in flex scanner failed" ); \
2102 while ( (result = fread(buf, 1, max_size, pycodeYYin))==0 && ferror(pycodeYYin)) \
2104 if( errno != EINTR) \
2106 YY_FATAL_ERROR( "input in flex scanner failed" ); \
2110 clearerr(pycodeYYin); \
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.
2122 #define yyterminate() return YY_NULL
2125 /* Number of entries by which start-condition stack grows. */
2126 #ifndef YY_START_STACK_INCR
2127 #define YY_START_STACK_INCR 25
2130 /* Report a fatal error. */
2131 #ifndef YY_FATAL_ERROR
2132 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
2135 /* end tables serialization structures and prototypes */
2137 /* Default declaration of generated scanner - a define so the user can
2138 * easily add parameters.
2141 #define YY_DECL_IS_OURS 1
2143 extern int pycodeYYlex (void);
2145 #define YY_DECL int pycodeYYlex (void)
2146 #endif /* !YY_DECL */
2148 /* Code executed at the beginning of each rule, after pycodeYYtext and pycodeYYleng
2151 #ifndef YY_USER_ACTION
2152 #define YY_USER_ACTION
2155 /* Code executed at the end of each rule. */
2157 #define YY_BREAK break;
2160 #define YY_RULE_SETUP \
2163 /** The main scanner function which does all the work.
2167 register yy_state_type yy_current_state;
2168 register char *yy_cp, *yy_bp;
2169 register int yy_act;
2171 #line 969 "pycode.l"
2174 #line 2175 "<stdout>"
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()" );
2191 (yy_start) = 1; /* first start state */
2196 if ( ! pycodeYYout )
2197 pycodeYYout = stdout;
2199 if ( ! YY_CURRENT_BUFFER ) {
2200 pycodeYYensure_buffer_stack ();
2201 YY_CURRENT_BUFFER_LVALUE =
2202 pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE );
2205 pycodeYY_load_buffer_state( );
2208 while ( 1 ) /* loops until end-of-file is reached */
2210 yy_cp = (yy_c_buf_p);
2212 /* Support of pycodeYYtext. */
2213 *yy_cp = (yy_hold_char);
2215 /* yy_bp points to the position in yy_ch_buf of the start of
2220 yy_current_state = (yy_start);
2222 (yy_state_ptr) = (yy_state_buf);
2223 *(yy_state_ptr)++ = yy_current_state;
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 )
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];
2235 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2236 *(yy_state_ptr)++ = yy_current_state;
2239 while ( yy_base[yy_current_state] != 1627 );
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 */
2248 if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
2250 yy_act = yy_acclist[(yy_lp)];
2251 if ( yy_act & YY_TRAILING_HEAD_MASK ||
2252 (yy_looking_for_trail_begin) )
2254 if ( yy_act == (yy_looking_for_trail_begin) )
2256 (yy_looking_for_trail_begin) = 0;
2257 yy_act &= ~YY_TRAILING_HEAD_MASK;
2261 else if ( yy_act & YY_TRAILING_MASK )
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);
2271 (yy_full_match) = yy_cp;
2272 (yy_full_state) = (yy_state_ptr);
2273 (yy_full_lp) = (yy_lp);
2280 yy_current_state = *--(yy_state_ptr);
2281 (yy_lp) = yy_accept[yy_current_state];
2284 YY_DO_BEFORE_ACTION;
2286 do_action: /* This label is used only to access EOF actions. */
2289 { /* beginning of action switch */
2293 #line 972 "pycode.l"
2295 startFontClass("keyword");
2296 codify(pycodeYYtext);
2298 BEGIN( FunctionDec );
2303 #line 979 "pycode.l"
2305 startFontClass("keyword");
2306 codify(pycodeYYtext);
2313 #line 985 "pycode.l"
2315 startFontClass("keywordtype");
2316 codify(pycodeYYtext);
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 */
2325 #line 990 "pycode.l"
2328 findMemberLink(*g_code,&pycodeYYtext[5]);
2333 #line 994 "pycode.l"
2336 findMemberLink(*g_code,&pycodeYYtext[5]);
2342 #line 1000 "pycode.l"
2345 generateClassOrGlobalLink(*g_code,pycodeYYtext);
2346 // codify(pycodeYYtext);
2347 g_curClassName = pycodeYYtext;
2348 g_curClassBases.clear();
2349 BEGIN( ClassInheritance );
2355 #line 1010 "pycode.l"
2357 codify(pycodeYYtext);
2362 #line 1014 "pycode.l"
2366 // that ALL identifiers
2368 // are base classes;
2369 // it doesn't check to see
2370 // that the first parenthesis
2373 // This is bad - it should
2374 // probably be more strict
2375 // about what to accept.
2377 g_curClassBases.inSort(pycodeYYtext);
2378 generateClassOrGlobalLink(*g_code,pycodeYYtext);
2379 // codify(pycodeYYtext);
2384 #line 1033 "pycode.l"
2386 codify(pycodeYYtext);
2389 // be a one-line suite;
2390 // found counter-example
2393 // Push a class scope
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();
2400 ClassDef *baseDefToAdd;
2401 baseDefToAdd=g_codeClassSDict[s];
2403 // Try to find class in global
2405 if (baseDefToAdd==0)
2407 baseDefToAdd=getResolvedClass(g_currentDefinition,g_sourceFileDef,s);
2410 if (baseDefToAdd && baseDefToAdd!=classDefToAdd)
2412 classDefToAdd->insertBaseClass(baseDefToAdd,s,Public,Normal);
2415 s=g_curClassBases.next();
2418 // Reset class-parsing variables.
2419 g_curClassName.resize(0);
2420 g_curClassBases.clear();
2422 g_noSuiteFound = TRUE;
2423 BEGIN( SuiteStart );
2430 #line 1077 "pycode.l"
2432 generateFunctionLink(*g_code,pycodeYYtext);
2437 #line 1081 "pycode.l"
2439 codify(pycodeYYtext);
2440 BEGIN( FunctionParams );
2447 #line 1088 "pycode.l"
2449 // Parses delimiters
2450 codify(pycodeYYtext);
2455 #line 1093 "pycode.l"
2457 codify(pycodeYYtext);
2462 #line 1097 "pycode.l"
2464 codify(pycodeYYtext);
2469 #line 1101 "pycode.l"
2471 codify(pycodeYYtext);
2474 // be a one-line suite;
2475 // found counter-example
2477 g_noSuiteFound = TRUE;
2478 BEGIN( SuiteStart );
2485 #line 1115 "pycode.l"
2487 // Position-sensitive rules!
2488 // Must come AFTER keyword-triggered rules
2489 // Must come BEFORE identifier NONEMPTY-like rules
2490 // to syntax highlight.
2492 startFontClass("keyword");
2493 codify(pycodeYYtext);
2499 #line 1126 "pycode.l"
2501 startFontClass("keywordflow");
2502 codify(pycodeYYtext);
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 */
2511 #line 1131 "pycode.l"
2513 generateClassOrGlobalLink(*g_code,pycodeYYtext);
2518 #line 1134 "pycode.l"
2520 generateClassOrGlobalLink(*g_code,pycodeYYtext,TRUE);
2525 #line 1137 "pycode.l"
2526 { codify(pycodeYYtext); }
2532 #line 1145 "pycode.l"
2534 codify(pycodeYYtext);
2539 #line 1148 "pycode.l"
2541 startFontClass("keyword");
2542 codifyLines(pycodeYYtext);
2549 #line 1154 "pycode.l"
2551 startFontClass("keyword");
2552 codifyLines(pycodeYYtext);
2555 // No indentation necesary
2556 g_noSuiteFound = FALSE;
2561 #line 1163 "pycode.l"
2563 startFontClass("keywordflow");
2564 codifyLines(pycodeYYtext);
2567 // No indentation necesary
2568 g_noSuiteFound = FALSE;
2573 #line 1171 "pycode.l"
2575 codify(pycodeYYtext);
2580 #line 1176 "pycode.l"
2582 // This eats EVERYTHING
2583 // except the newline
2584 startFontClass("comment");
2585 codifyLines(pycodeYYtext);
2590 /* rule 27 can match eol */
2592 #line 1184 "pycode.l"
2594 codifyLines(pycodeYYtext);
2595 if ( g_noSuiteFound )
2597 // printf("New suite to capture! [%d]\n", g_yyLineNr);
2598 BEGIN ( SuiteCaptureIndent );
2605 /* rule 28 can match eol */
2607 #line 1195 "pycode.l"
2609 // Blankline - ignore, keep looking for indentation.
2610 codifyLines(pycodeYYtext);
2615 #line 1200 "pycode.l"
2617 // This state lasts momentarily,
2618 // to check the indentation
2619 // level that is about to be
2621 codifyLines(pycodeYYtext);
2622 g_indents.push(pycodeYYleng);
2623 // printf("Captured indent of %d [line %d]\n", pycodeYYleng, g_yyLineNr);
2631 #line 1214 "pycode.l"
2633 // This implements poor
2634 // indendation-tracking;
2635 // should be improved.
2636 // (translate tabs to space, etc)
2637 codifyLines(pycodeYYtext);
2638 adjustScopesAndSuites(pycodeYYleng);
2642 /* rule 31 can match eol */
2644 #line 1223 "pycode.l"
2646 // If this ever succeeds,
2647 // it means that this is
2648 // a blank line, and
2650 codifyLines(pycodeYYtext);
2655 #line 1231 "pycode.l"
2657 // Default rule; matches
2658 // the empty string, assuming
2659 // real text starts here.
2660 // Just go straight to Body.
2661 adjustScopesAndSuites(0);
2666 /* rule 33 can match eol */
2668 #line 1241 "pycode.l"
2670 codifyLines(pycodeYYtext);
2671 BEGIN( SuiteMaintain );
2676 #line 1245 "pycode.l"
2678 codify(pycodeYYtext);
2682 /* rule 35 can match eol */
2684 #line 1248 "pycode.l"
2686 codifyLines(pycodeYYtext);
2689 // Single quoted string like 'That\'s a """nice""" string!'
2691 /* rule 36 can match eol */
2693 #line 1253 "pycode.l"
2694 { // line continuation
2695 codifyLines(pycodeYYtext);
2700 #line 1256 "pycode.l"
2702 codify(pycodeYYtext);
2707 #line 1259 "pycode.l"
2708 { // tripple double quotes
2709 codify(pycodeYYtext);
2714 #line 1262 "pycode.l"
2715 { // end of the string
2716 codify(pycodeYYtext);
2718 BEGIN(g_stringContext);
2723 #line 1267 "pycode.l"
2725 codify(pycodeYYtext);
2730 #line 1270 "pycode.l"
2732 codify(pycodeYYtext);
2736 // Double quoted string like "That's \"a '''nice'''\" string!"
2738 /* rule 42 can match eol */
2740 #line 1276 "pycode.l"
2741 { // line continuation
2742 codifyLines(pycodeYYtext);
2747 #line 1279 "pycode.l"
2749 codify(pycodeYYtext);
2754 #line 1282 "pycode.l"
2755 { // tripple single quotes
2756 codify(pycodeYYtext);
2761 #line 1285 "pycode.l"
2762 { // end of the string
2763 codify(pycodeYYtext);
2765 BEGIN(g_stringContext);
2770 #line 1290 "pycode.l"
2772 codify(pycodeYYtext);
2777 #line 1293 "pycode.l"
2779 codify(pycodeYYtext);
2785 #line 1300 "pycode.l"
2788 #line 1300 "pycode.l"
2790 codify(pycodeYYtext);
2791 if (g_doubleQuote==(pycodeYYtext[0]=='"'))
2794 BEGIN(g_stringContext);
2799 /* rule 50 can match eol */
2801 #line 1308 "pycode.l"
2803 codifyLines(pycodeYYtext);
2807 /* rule 51 can match eol */
2809 #line 1311 "pycode.l"
2811 codifyLines(pycodeYYtext);
2816 #line 1314 "pycode.l"
2818 codify(pycodeYYtext);
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);
2833 #line 1331 "pycode.l"
2836 #line 1331 "pycode.l"
2838 startFontClass("stringliteral");
2839 g_stringContext=YY_START;
2840 g_doubleQuote=pycodeYYtext[pycodeYYleng-1]=='"';
2841 codify(pycodeYYtext);
2842 BEGIN(TripleString);
2847 #line 1338 "pycode.l"
2848 { // single quoted string
2849 startFontClass("stringliteral");
2850 g_stringContext=YY_START;
2851 codify(pycodeYYtext);
2852 BEGIN(SingleQuoteString);
2857 #line 1344 "pycode.l"
2858 { // double quoted string
2859 startFontClass("stringliteral");
2860 g_stringContext=YY_START;
2861 codify(pycodeYYtext);
2862 BEGIN(DoubleQuoteString);
2867 #line 1350 "pycode.l"
2869 if (YY_START==SingleQuoteString ||
2870 YY_START==DoubleQuoteString ||
2871 YY_START==TripleString
2876 // This eats EVERYTHING
2877 // except the newline
2878 startFontClass("comment");
2879 codifyLines(pycodeYYtext);
2884 /* rule 58 can match eol */
2886 #line 1364 "pycode.l"
2888 codifyLines(pycodeYYtext);
2889 //printf("[pycode] %d NEWLINE [line %d] no match\n",
2890 // YY_START, g_yyLineNr);
2898 #line 1373 "pycode.l"
2900 codify(pycodeYYtext);
2906 #line 1377 "pycode.l"
2908 codify(pycodeYYtext);
2909 // printf("[pycode] '%s' [ state %d ] [line %d] no match\n",
2910 // pycodeYYtext, YY_START, g_yyLineNr);
2918 #line 1386 "pycode.l"
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):
2939 case YY_END_OF_BUFFER:
2941 /* Amount of text matched not including the EOB char. */
2942 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
2944 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2945 *yy_cp = (yy_hold_char);
2946 YY_RESTORE_YY_MORE_OFFSET
2948 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
2975 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
2977 yy_current_state = yy_get_previous_state( );
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).
2988 yy_next_state = yy_try_NUL_trans( yy_current_state );
2990 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
2992 if ( yy_next_state )
2994 /* Consume the NUL. */
2995 yy_cp = ++(yy_c_buf_p);
2996 yy_current_state = yy_next_state;
3002 yy_cp = (yy_c_buf_p);
3003 goto yy_find_action;
3007 else switch ( yy_get_next_buffer( ) )
3009 case EOB_ACT_END_OF_FILE:
3011 (yy_did_buffer_switch_on_eof) = 0;
3013 if ( pycodeYYwrap( ) )
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.
3024 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
3026 yy_act = YY_STATE_EOF(YY_START);
3032 if ( ! (yy_did_buffer_switch_on_eof) )
3038 case EOB_ACT_CONTINUE_SCAN:
3040 (yytext_ptr) + yy_amount_of_matched_text;
3042 yy_current_state = yy_get_previous_state( );
3044 yy_cp = (yy_c_buf_p);
3045 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3048 case EOB_ACT_LAST_MATCH:
3050 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
3052 yy_current_state = yy_get_previous_state( );
3054 yy_cp = (yy_c_buf_p);
3055 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3056 goto yy_find_action;
3063 "fatal flex scanner internal error--no action found" );
3064 } /* end of action switch */
3065 } /* end of scanning one token */
3066 } /* end of pycodeYYlex */
3068 /* yy_get_next_buffer - try to read in a new buffer
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
3075 static int yy_get_next_buffer (void)
3077 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
3078 register char *source = (yytext_ptr);
3079 register int number_to_move, i;
3082 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
3084 "fatal flex scanner internal error--end of buffer missed" );
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 )
3090 /* We matched a single character, the EOB, so
3091 * treat this as a final EOF.
3093 return EOB_ACT_END_OF_FILE;
3098 /* We matched some text prior to the EOB, first
3101 return EOB_ACT_LAST_MATCH;
3105 /* Try to read more data. */
3107 /* First move last chars to start of buffer. */
3108 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
3110 for ( i = 0; i < number_to_move; ++i )
3111 *(dest++) = *(source++);
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,
3117 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
3121 yy_size_t num_to_read =
3122 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3124 while ( num_to_read <= 0 )
3125 { /* Not enough room in the buffer - grow it. */
3128 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3132 if ( num_to_read > YY_READ_BUF_SIZE )
3133 num_to_read = YY_READ_BUF_SIZE;
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 );
3139 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3142 if ( (yy_n_chars) == 0 )
3144 if ( number_to_move == YY_MORE_ADJ )
3146 ret_val = EOB_ACT_END_OF_FILE;
3147 pycodeYYrestart(pycodeYYin );
3152 ret_val = EOB_ACT_LAST_MATCH;
3153 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3154 YY_BUFFER_EOF_PENDING;
3159 ret_val = EOB_ACT_CONTINUE_SCAN;
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()" );
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;
3173 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3178 /* yy_get_previous_state - get the state just before the EOB char was reached */
3180 static yy_state_type yy_get_previous_state (void)
3182 register yy_state_type yy_current_state;
3183 register char *yy_cp;
3185 yy_current_state = (yy_start);
3187 (yy_state_ptr) = (yy_state_buf);
3188 *(yy_state_ptr)++ = yy_current_state;
3190 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
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 )
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];
3199 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3200 *(yy_state_ptr)++ = yy_current_state;
3203 return yy_current_state;
3206 /* yy_try_NUL_trans - try to make a transition on the NUL character
3209 * next_state = yy_try_NUL_trans( current_state );
3211 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
3213 register int yy_is_jam;
3215 register YY_CHAR yy_c = 1;
3216 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
3222 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3223 yy_is_jam = (yy_current_state == 504);
3225 *(yy_state_ptr)++ = yy_current_state;
3227 return yy_is_jam ? 0 : yy_current_state;
3232 static int yyinput (void)
3234 static int input (void)
3240 *(yy_c_buf_p) = (yy_hold_char);
3242 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
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.
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';
3253 { /* need more input */
3254 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
3257 switch ( yy_get_next_buffer( ) )
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.
3270 /* Reset buffer status. */
3271 pycodeYYrestart(pycodeYYin );
3275 case EOB_ACT_END_OF_FILE:
3277 if ( pycodeYYwrap( ) )
3280 if ( ! (yy_did_buffer_switch_on_eof) )
3289 case EOB_ACT_CONTINUE_SCAN:
3290 (yy_c_buf_p) = (yytext_ptr) + offset;
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);
3302 #endif /* ifndef YY_NO_INPUT */
3304 /** Immediately switch to a different input stream.
3305 * @param input_file A readable stream.
3307 * @note This function does not reset the start condition to @c INITIAL .
3309 void pycodeYYrestart (FILE * input_file )
3312 if ( ! YY_CURRENT_BUFFER ){
3313 pycodeYYensure_buffer_stack ();
3314 YY_CURRENT_BUFFER_LVALUE =
3315 pycodeYY_create_buffer(pycodeYYin,YY_BUF_SIZE );
3318 pycodeYY_init_buffer(YY_CURRENT_BUFFER,input_file );
3319 pycodeYY_load_buffer_state( );
3322 /** Switch to a different input buffer.
3323 * @param new_buffer The new input buffer.
3326 void pycodeYY_switch_to_buffer (YY_BUFFER_STATE new_buffer )
3329 /* TODO. We should be able to replace this entire function body
3331 * pycodeYYpop_buffer_state();
3332 * pycodeYYpush_buffer_state(new_buffer);
3334 pycodeYYensure_buffer_stack ();
3335 if ( YY_CURRENT_BUFFER == new_buffer )
3338 if ( YY_CURRENT_BUFFER )
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);
3346 YY_CURRENT_BUFFER_LVALUE = new_buffer;
3347 pycodeYY_load_buffer_state( );
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.
3354 (yy_did_buffer_switch_on_eof) = 1;
3357 static void pycodeYY_load_buffer_state (void)
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);
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.
3369 * @return the allocated buffer state.
3371 YY_BUFFER_STATE pycodeYY_create_buffer (FILE * file, int size )
3375 b = (YY_BUFFER_STATE) pycodeYYalloc(sizeof( struct yy_buffer_state ) );
3377 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_create_buffer()" );
3379 b->yy_buf_size = size;
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.
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()" );
3388 b->yy_is_our_buffer = 1;
3390 pycodeYY_init_buffer(b,file );
3395 /** Destroy the buffer.
3396 * @param b a buffer created with pycodeYY_create_buffer()
3399 void pycodeYY_delete_buffer (YY_BUFFER_STATE b )
3405 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3406 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3408 if ( b->yy_is_our_buffer )
3409 pycodeYYfree((void *) b->yy_ch_buf );
3411 pycodeYYfree((void *) b );
3415 extern int isatty (int );
3416 #endif /* __cplusplus */
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.
3422 static void pycodeYY_init_buffer (YY_BUFFER_STATE b, FILE * file )
3427 pycodeYY_flush_buffer(b );
3429 b->yy_input_file = file;
3430 b->yy_fill_buffer = 1;
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.
3436 if (b != YY_CURRENT_BUFFER){
3437 b->yy_bs_lineno = 1;
3438 b->yy_bs_column = 0;
3441 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
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.
3450 void pycodeYY_flush_buffer (YY_BUFFER_STATE b )
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.
3461 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3462 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3464 b->yy_buf_pos = &b->yy_ch_buf[0];
3467 b->yy_buffer_status = YY_BUFFER_NEW;
3469 if ( b == YY_CURRENT_BUFFER )
3470 pycodeYY_load_buffer_state( );
3473 /** Pushes the new state onto the stack. The new state becomes
3474 * the current state. This function will allocate the stack
3476 * @param new_buffer The new state.
3479 void pycodeYYpush_buffer_state (YY_BUFFER_STATE new_buffer )
3481 if (new_buffer == NULL)
3484 pycodeYYensure_buffer_stack();
3486 /* This block is copied from pycodeYY_switch_to_buffer. */
3487 if ( YY_CURRENT_BUFFER )
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);
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;
3500 /* copied from pycodeYY_switch_to_buffer. */
3501 pycodeYY_load_buffer_state( );
3502 (yy_did_buffer_switch_on_eof) = 1;
3505 /** Removes and deletes the top of the stack, if present.
3506 * The next element becomes the new top.
3509 void pycodeYYpop_buffer_state (void)
3511 if (!YY_CURRENT_BUFFER)
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);
3519 if (YY_CURRENT_BUFFER) {
3520 pycodeYY_load_buffer_state( );
3521 (yy_did_buffer_switch_on_eof) = 1;
3525 /* Allocates the stack if it does not exist.
3526 * Guarantees space for at least one push.
3528 static void pycodeYYensure_buffer_stack (void)
3530 yy_size_t num_to_alloc;
3532 if (!(yy_buffer_stack)) {
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.
3539 (yy_buffer_stack) = (struct yy_buffer_state**)pycodeYYalloc
3540 (num_to_alloc * sizeof(struct yy_buffer_state*)
3542 if ( ! (yy_buffer_stack) )
3543 YY_FATAL_ERROR( "out of dynamic memory in pycodeYYensure_buffer_stack()" );
3545 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3547 (yy_buffer_stack_max) = num_to_alloc;
3548 (yy_buffer_stack_top) = 0;
3552 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3554 /* Increase the buffer to prepare for a possible push. */
3555 int grow_size = 8 /* arbitrary grow size */;
3557 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3558 (yy_buffer_stack) = (struct yy_buffer_state**)pycodeYYrealloc
3560 num_to_alloc * sizeof(struct yy_buffer_state*)
3562 if ( ! (yy_buffer_stack) )
3563 YY_FATAL_ERROR( "out of dynamic memory in pycodeYYensure_buffer_stack()" );
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;
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
3575 * @return the newly allocated buffer state object.
3577 YY_BUFFER_STATE pycodeYY_scan_buffer (char * base, yy_size_t size )
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. */
3587 b = (YY_BUFFER_STATE) pycodeYYalloc(sizeof( struct yy_buffer_state ) );
3589 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_scan_buffer()" );
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;
3598 b->yy_fill_buffer = 0;
3599 b->yy_buffer_status = YY_BUFFER_NEW;
3601 pycodeYY_switch_to_buffer(b );
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
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.
3614 YY_BUFFER_STATE pycodeYY_scan_string (yyconst char * yystr )
3617 return pycodeYY_scan_bytes(yystr,strlen(yystr) );
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.
3625 * @return the newly allocated buffer state object.
3627 YY_BUFFER_STATE pycodeYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
3633 /* Get memory for full buffer, including space for trailing EOB's. */
3634 n = _yybytes_len + 2;
3635 buf = (char *) pycodeYYalloc(n );
3637 YY_FATAL_ERROR( "out of dynamic memory in pycodeYY_scan_bytes()" );
3639 for ( i = 0; i < _yybytes_len; ++i )
3640 buf[i] = yybytes[i];
3642 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3644 b = pycodeYY_scan_buffer(buf,n );
3646 YY_FATAL_ERROR( "bad buffer in pycodeYY_scan_bytes()" );
3648 /* It's okay to grow etc. this buffer, and we should throw it
3649 * away when we're done.
3651 b->yy_is_our_buffer = 1;
3656 #ifndef YY_EXIT_FAILURE
3657 #define YY_EXIT_FAILURE 2
3660 static void yy_fatal_error (yyconst char* msg )
3662 (void) fprintf( stderr, "%s\n", msg );
3663 exit( YY_EXIT_FAILURE );
3666 /* Redefine yyless() so it works in section 3 code. */
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; \
3683 /* Accessor methods (get/set functions) to struct members. */
3685 /** Get the current line number.
3688 int pycodeYYget_lineno (void)
3691 return pycodeYYlineno;
3694 /** Get the input stream.
3697 FILE *pycodeYYget_in (void)
3702 /** Get the output stream.
3705 FILE *pycodeYYget_out (void)
3710 /** Get the length of the current token.
3713 yy_size_t pycodeYYget_leng (void)
3715 return pycodeYYleng;
3718 /** Get the current token.
3722 char *pycodeYYget_text (void)
3724 return pycodeYYtext;
3727 /** Set the current line number.
3728 * @param line_number
3731 void pycodeYYset_lineno (int line_number )
3734 pycodeYYlineno = line_number;
3737 /** Set the input stream. This does not discard the current
3739 * @param in_str A readable stream.
3741 * @see pycodeYY_switch_to_buffer
3743 void pycodeYYset_in (FILE * in_str )
3745 pycodeYYin = in_str ;
3748 void pycodeYYset_out (FILE * out_str )
3750 pycodeYYout = out_str ;
3753 int pycodeYYget_debug (void)
3755 return pycodeYY_flex_debug;
3758 void pycodeYYset_debug (int bdebug )
3760 pycodeYY_flex_debug = bdebug ;
3763 static int yy_init_globals (void)
3765 /* Initialization is the same as for the non-reentrant scanner.
3766 * This function is called from pycodeYYlex_destroy(), so don't allocate here.
3769 (yy_buffer_stack) = 0;
3770 (yy_buffer_stack_top) = 0;
3771 (yy_buffer_stack_max) = 0;
3772 (yy_c_buf_p) = (char *) 0;
3778 (yy_full_match) = 0;
3781 /* Defined in main.c */
3784 pycodeYYout = stdout;
3786 pycodeYYin = (FILE *) 0;
3787 pycodeYYout = (FILE *) 0;
3790 /* For future reference: Set errno on error, since we are called by
3791 * pycodeYYlex_init()
3796 /* pycodeYYlex_destroy is for both reentrant and non-reentrant scanners. */
3797 int pycodeYYlex_destroy (void)
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();
3807 /* Destroy the stack itself. */
3808 pycodeYYfree((yy_buffer_stack) );
3809 (yy_buffer_stack) = NULL;
3811 pycodeYYfree ( (yy_state_buf) );
3812 (yy_state_buf) = NULL;
3814 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3815 * pycodeYYlex() is called, initialization will occur. */
3822 * Internal utility routines.
3826 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
3829 for ( i = 0; i < n; ++i )
3834 #ifdef YY_NEED_STRLEN
3835 static int yy_flex_strlen (yyconst char * s )
3838 for ( n = 0; s[n]; ++n )
3845 void *pycodeYYalloc (yy_size_t size )
3847 return (void *) malloc( size );
3850 void *pycodeYYrealloc (void * ptr, yy_size_t size )
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.
3859 return (void *) realloc( (char *) ptr, size );
3862 void pycodeYYfree (void * ptr )
3864 free( (char *) ptr ); /* see pycodeYYrealloc() for (char *) cast */
3867 #define YYTABLES_NAME "yytables"
3869 #line 1386 "pycode.l"
3873 /*@ ----------------------------------------------------------------------------
3876 void resetPythonCodeParserState()
3878 g_currentDefinition = 0;
3879 g_currentMemberDef = 0;
3880 g_doubleStringIsDoc = FALSE;
3887 Examines current stack of white-space indentations;
3888 re-syncs the parser with the correct scope.
3890 static void adjustScopesAndSuites(unsigned indentLength)
3893 if (!g_indents.isEmpty() && indentLength < g_indents.top())
3895 while (!g_indents.isEmpty() && indentLength < g_indents.top())
3897 // printf("Exited scope indent of [%d]\n", g_indents.top());
3898 g_indents.pop(); // Pop the old suite's indentation
3900 g_currentMemberDef=0;
3901 if (g_currentDefinition)
3902 g_currentDefinition=g_currentDefinition->getOuterScope();
3906 // Are there any remaining indentation levels for suites?
3907 if (!g_indents.isEmpty())
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)
3923 //printf("***parseCode()\n");
3925 //--------------------------------------
3926 if (s.isEmpty()) return;
3929 g_inputPosition = 0;
3930 g_currentFontClass = 0;
3931 g_needsTermination = FALSE;
3932 g_searchCtx=searchCtx;
3934 g_inputLines = endLine+1;
3936 g_inputLines = countLines();
3939 g_yyLineNr = startLine;
3943 g_exampleBlock = exBlock;
3944 g_exampleName = exName;
3945 g_sourceFileDef = fd;
3947 bool cleanupSourceDef = FALSE;
3950 // create a dummy filedef for the example
3951 g_sourceFileDef = new FileDef("",(exName?exName:"generated"));
3952 cleanupSourceDef = TRUE;
3954 if (g_sourceFileDef)
3956 setCurrentDoc("l00001");
3959 // Starts line 1 on the output
3962 pycodeYYrestart( pycodeYYin );
3966 if (!g_indents.isEmpty())
3968 // printf("Exited pysourceparser in inconsistent state!\n");
3971 if (g_needsTermination)
3975 if (cleanupSourceDef)
3977 // delete the temporary file definition used for this example
3978 delete g_sourceFileDef;
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); }
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)."