diff options
Diffstat (limited to 'src/pyscanner.cpp')
-rw-r--r-- | src/pyscanner.cpp | 4693 |
1 files changed, 4693 insertions, 0 deletions
diff --git a/src/pyscanner.cpp b/src/pyscanner.cpp new file mode 100644 index 0000000..48f54a4 --- /dev/null +++ b/src/pyscanner.cpp @@ -0,0 +1,4693 @@ + +#line 3 "<stdout>" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define yy_create_buffer pyscanYY_create_buffer +#define yy_delete_buffer pyscanYY_delete_buffer +#define yy_flex_debug pyscanYY_flex_debug +#define yy_init_buffer pyscanYY_init_buffer +#define yy_flush_buffer pyscanYY_flush_buffer +#define yy_load_buffer_state pyscanYY_load_buffer_state +#define yy_switch_to_buffer pyscanYY_switch_to_buffer +#define yyin pyscanYYin +#define yyleng pyscanYYleng +#define yylex pyscanYYlex +#define yylineno pyscanYYlineno +#define yyout pyscanYYout +#define yyrestart pyscanYYrestart +#define yytext pyscanYYtext +#define yywrap pyscanYYwrap +#define yyalloc pyscanYYalloc +#define yyrealloc pyscanYYrealloc +#define yyfree pyscanYYfree + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 35 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +typedef uint64_t flex_uint64_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE pyscanYYrestart(pyscanYYin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 262144 +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t pyscanYYleng; + +extern FILE *pyscanYYin, *pyscanYYout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up pyscanYYtext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via pyscanYYrestart()), so that the user can continue scanning by + * just pointing pyscanYYin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when pyscanYYtext is formed. */ +static char yy_hold_char; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t pyscanYYleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow pyscanYYwrap()'s to do buffer switches + * instead of setting up a fresh pyscanYYin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void pyscanYYrestart (FILE *input_file ); +void pyscanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE pyscanYY_create_buffer (FILE *file,int size ); +void pyscanYY_delete_buffer (YY_BUFFER_STATE b ); +void pyscanYY_flush_buffer (YY_BUFFER_STATE b ); +void pyscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer ); +void pyscanYYpop_buffer_state (void ); + +static void pyscanYYensure_buffer_stack (void ); +static void pyscanYY_load_buffer_state (void ); +static void pyscanYY_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER pyscanYY_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE pyscanYY_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE pyscanYY_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE pyscanYY_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *pyscanYYalloc (yy_size_t ); +void *pyscanYYrealloc (void *,yy_size_t ); +void pyscanYYfree (void * ); + +#define yy_new_buffer pyscanYY_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + pyscanYYensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + pyscanYY_create_buffer(pyscanYYin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + pyscanYYensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + pyscanYY_create_buffer(pyscanYYin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define pyscanYYwrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +FILE *pyscanYYin = (FILE *) 0, *pyscanYYout = (FILE *) 0; + +typedef int yy_state_type; + +extern int pyscanYYlineno; + +int pyscanYYlineno = 1; + +extern char *pyscanYYtext; +#define yytext_ptr pyscanYYtext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up pyscanYYtext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + pyscanYYleng = (yy_size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 152 +#define YY_END_OF_BUFFER 153 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_acclist[753] = + { 0, + 16482,16482, 100, 100, 25, 25, 31, 31, 36, 36, + 153, 151, 152, 150, 152, 21, 151, 152, 17, 150, + 152, 12, 21, 151, 152, 21, 151, 152, 11, 21, + 151, 152, 21, 151, 152, 15, 21, 151, 152, 15, + 21, 151, 152, 15, 21, 151, 152, 15, 21, 151, + 152, 15, 21, 151, 152, 16, 21, 151, 152, 15, + 21, 151, 152,16393,16394, 15, 21, 151, 152,16393, + 16394, 15, 21, 151, 152,16393,16394, 15, 21, 151, + 152,16393,16394, 15, 21, 151, 152,16393,16394, 47, + 48, 151, 152, 45, 150, 152, 44, 48, 151, 152, + + 48, 151, 152, 43, 48, 151, 152, 48, 151, 152, + 46, 48, 151, 152, 46, 48, 151, 152, 125, 127, + 151, 152, 127, 151, 152, 126, 150, 152, 127, 151, + 152, 127, 151, 152, 124, 127, 151, 152, 130, 132, + 151, 152, 131, 150, 152, 132, 151, 152, 130, 132, + 151, 152, 128, 132, 151, 152, 151, 152, 65, 151, + 152, 64, 151, 152, 63, 151, 152, 72, 151, 152, + 66, 151, 152, 72, 151, 152, 69, 151, 152, 66, + 72, 151, 152, 70, 151, 152, 68, 72, 151, 152, + 67, 72, 151, 152, 55, 59, 151, 152, 59, 151, + + 152, 58, 150, 152,16433, 54, 59, 151, 152, 57, + 59, 151, 152, 53, 59, 151, 152, 52, 59, 151, + 152, 57, 59, 151, 152, 76, 151, 152, 77, 150, + 152, 73, 76, 151, 152, 75, 76, 151, 152, 74, + 76, 151, 152, 90, 151, 152, 91, 151, 152, 91, + 151, 152, 92, 151, 152, 93, 151, 152, 151, 152, + 94, 150, 152, 8290, 151, 152, 151, 152, 151, 152, + 97, 151, 152, 84, 87, 151, 152, 87, 151, 152, + 85, 150, 152, 83, 87, 151, 152, 87, 151, 152, + 82, 87, 151, 152, 81, 87, 151, 152, 112, 151, + + 152, 100, 112, 151, 152, 113, 150, 152, 104, 112, + 151, 152, 110, 112, 151, 152, 103, 112, 151, 152, + 107, 112, 151, 152, 101, 112, 151, 152, 101, 112, + 151, 152, 99, 112, 151, 152, 111, 112, 151, 152, + 111, 112, 151, 152, 111, 112, 151, 152, 108, 112, + 151, 152, 111, 112, 151, 152, 109, 112, 151, 152, + 121, 151, 152, 120, 150, 152, 118, 151, 152, 119, + 150, 152, 116, 118, 151, 152, 114, 118, 151, 152, + 115, 118, 151, 152, 117, 118, 151, 152, 137, 138, + 151, 152, 138, 151, 152, 136, 138, 151, 152, 138, + + 151, 152, 143, 144, 151, 152, 142, 144, 151, 152, + 144, 151, 152, 144, 151, 152, 147, 149, 151, 152, + 147, 148, 150, 152, 147, 149, 151, 152, 147, 149, + 151, 152, 149, 151, 152, 26, 151, 152, 25, 26, + 151, 152, 24, 150, 152, 22, 26, 151, 152, 22, + 26, 151, 152, 33, 151, 152, 31, 33, 151, 152, + 30, 150, 152, 27, 33, 151, 152, 32, 33, 151, + 152, 29, 33, 151, 152,16412, 37, 151, 152, 36, + 37, 151, 152, 35, 150, 152, 34, 37, 151, 152, + 17, 14, 15, 15, 15, 15, 15, 16,16393,16394, + + 16393,16394,16393,16394,16393,16394,16393,16394, 15,16393, + 16394, 15,16393,16394, 15,16393,16394, 15,16393,16394, + 15,16393,16394, 47, 42, 46, 46, 125, 124, 130, + 129, 130, 128, 128, 65, 64, 63, 66, 71, 70, + 67, 55,16433, 57, 57, 52, 51, 56, 57, 90, + 91, 93, 94, 97, 84, 86, 81, 80, 100, 110, + 101, 101, 101, 111, 104, 103, 111, 117, 137, 134, + 134, 133, 143, 140, 140, 139, 147, 147, 147, 25, + 22, 22, 31, 8220, 29,16412, 36, 34, 18, 14, + 20, 19, 15, 15, 15, 15,16393,16394,16393,16394, + + 16393,16394,16393,16394,16393,16394, 8202, 8202, 8202, 15, + 16393,16394, 15,16393,16394, 15,16393,16394, 15,16393, + 16394, 39, 42, 41, 40, 46, 122, 123, 71, 50, + 8241, 60, 57, 62, 62, 61, 56, 57, 93, 95, + 96, 78, 88, 86, 89, 105, 106, 102, 101, 101, + 135, 141, 145, 146, 22, 22, 8220, 34, 18, 19, + 15, 2, 15, 15,16393,16394,16393,16394,16393,16394, + 16393,16394, 15,16393,16394, 1, 2, 15,16393,16394, + 15,16393,16394, 39, 40, 46, 122, 123, 60, 61, + 93, 95, 96, 79, 88, 89, 105, 106, 102, 101, + + 145, 146, 22, 22, 34, 15, 6, 15,16393,16394, + 1,16393,16394,16393,16394, 15,16393,16394, 5, 6, + 15,16393,16394, 102, 22, 4, 15,16393,16394, 5, + 16393,16394, 3, 4, 15,16393,16394,16422, 22, 23, + 8, 3,16393,16394, 7, 8,16422, 8230, 23, 7, + 8201, 13 + } ; + +static yyconst flex_int16_t yy_accept[452] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 3, 3, 3, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 6, 7, 8, 9, 10, 11, 12, 14, 16, + 19, 22, 26, 29, 33, 36, 40, 44, 48, 52, + 56, 60, 66, 72, 78, 84, 90, 94, 97, 101, + 104, 108, 111, 115, 119, 123, 126, 129, 132, 135, + 139, 143, 146, 149, 153, 157, 159, 162, 165, 168, + 171, 174, 177, 180, 184, 187, 191, 195, 199, 202, + + 206, 210, 214, 218, 222, 226, 229, 232, 236, 240, + 244, 247, 250, 253, 256, 259, 261, 264, 267, 269, + 271, 274, 278, 281, 284, 288, 291, 295, 299, 302, + 306, 309, 313, 317, 321, 325, 329, 333, 337, 341, + 345, 349, 353, 357, 361, 364, 367, 370, 373, 377, + 381, 385, 389, 393, 396, 400, 403, 407, 411, 414, + 417, 421, 425, 429, 433, 436, 439, 443, 446, 450, + 454, 457, 461, 464, 468, 472, 477, 480, 484, 487, + 491, 492, 492, 493, 493, 493, 493, 494, 495, 496, + 497, 498, 499, 501, 503, 505, 507, 509, 509, 512, + + 512, 515, 518, 521, 524, 525, 525, 526, 526, 526, + 527, 528, 529, 529, 529, 530, 531, 531, 532, 533, + 534, 535, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 544, 544, 544, 545, 546, 546, 547, 548, + 550, 551, 552, 552, 553, 553, 554, 554, 554, 555, + 556, 556, 556, 556, 557, 557, 558, 559, 560, 560, + 561, 561, 561, 562, 563, 564, 564, 565, 566, 567, + 568, 569, 570, 570, 571, 572, 573, 574, 574, 575, + 576, 577, 578, 578, 579, 580, 581, 581, 581, 582, + 583, 584, 584, 585, 587, 588, 588, 588, 589, 590, + + 591, 592, 593, 593, 594, 595, 596, 597, 599, 601, + 603, 605, 607, 608, 609, 610, 613, 616, 619, 622, + 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 632, 633, 635, 636, 637, 639, 640, 641, 642, 642, + 643, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 652, 653, 653, 654, 655, 655, 656, 657, 658, + 658, 659, 660, 661, 661, 662, 663, 664, 665, 667, + 669, 671, 673, 673, 673, 673, 676, 678, 681, 684, + 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, + 695, 696, 697, 698, 699, 699, 700, 701, 702, 703, + + 704, 705, 706, 706, 707, 708, 709, 711, 712, 714, + 716, 716, 719, 721, 724, 724, 724, 725, 726, 726, + 727, 728, 730, 731, 733, 733, 735, 738, 739, 741, + 741, 742, 743, 745, 745, 747, 747, 748, 749, 750, + 750, 751, 751, 751, 751, 751, 752, 752, 752, 753, + 753 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 7, 7, 8, 9, + 10, 11, 12, 13, 12, 14, 7, 15, 16, 16, + 16, 16, 16, 16, 16, 17, 17, 18, 7, 7, + 19, 7, 1, 20, 21, 21, 21, 21, 22, 21, + 23, 23, 23, 24, 23, 25, 23, 23, 23, 23, + 23, 26, 23, 23, 27, 23, 23, 28, 23, 23, + 29, 30, 31, 1, 32, 7, 33, 21, 34, 35, + + 36, 37, 23, 38, 39, 24, 23, 40, 41, 23, + 42, 43, 23, 44, 45, 46, 47, 23, 23, 28, + 48, 23, 49, 7, 31, 7, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[50] = + { 0, + 1, 2, 3, 1, 4, 5, 1, 4, 1, 1, + 1, 1, 6, 7, 8, 8, 8, 1, 9, 1, + 10, 10, 11, 11, 11, 11, 11, 11, 1, 12, + 1, 11, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 1 + } ; + +static yyconst flex_int16_t yy_base[516] = + { 0, + 1602, 1601, 0, 49, 98, 0, 1600, 1599, 146, 150, + 153, 158, 164, 0, 213, 0, 261, 268, 274, 276, + 289, 0, 338, 0, 387, 395, 403, 411, 419, 0, + 1595, 1594, 468, 0, 515, 516, 522, 523, 529, 530, + 560, 0, 609, 0, 658, 0, 1596, 1660, 1660, 1660, + 1592, 1589, 1587, 1584, 1544, 0, 1538, 1537, 1527, 1529, + 706, 391, 707, 520, 708, 709, 0, 1660, 1564, 1562, + 1559, 1660, 0, 1518, 0, 1660, 1660, 1532, 1527, 1532, + 0, 266, 1660, 534, 1527, 539, 1660, 1660, 0, 1660, + 1530, 0, 1660, 1660, 1529, 1660, 0, 0, 1660, 541, + + 1515, 1504, 1488, 160, 1484, 1660, 1660, 1660, 1660, 1660, + 0, 1475, 1660, 1660, 1462, 278, 1660, 1660, 1470, 1466, + 399, 0, 1660, 1467, 1459, 0, 1442, 547, 1660, 1443, + 1660, 1437, 0, 1433, 1660, 739, 698, 1660, 0, 386, + 713, 1660, 725, 1660, 1660, 1660, 1660, 1660, 1660, 1660, + 1660, 0, 0, 1435, 1660, 552, 0, 1660, 1431, 714, + 1405, 1403, 1426, 1422, 726, 1660, 1427, 1660, 718, 734, + 1660, 1423, 1660, 1660, 1660, 722, 1660, 1420, 1660, 723, + 1418, 1415, 0, 0, 1411, 1363, 0, 1353, 1348, 1321, + 1319, 747, 740, 758, 742, 764, 766, 768, 769, 756, + + 770, 772, 771, 774, 0, 1352, 0, 0, 1345, 0, + 1302, 0, 1327, 1322, 1323, 0, 790, 1660, 795, 1318, + 1317, 793, 1660, 1660, 0, 1320, 0, 1311, 0, 0, + 798, 1306, 1309, 1305, 0, 759, 1298, 803, 1660, 0, + 0, 1299, 0, 1276, 812, 1660, 1273, 1265, 816, 0, + 1266, 1269, 1265, 0, 1260, 818, 1660, 1265, 1255, 0, + 1250, 807, 811, 815, 1660, 0, 0, 1660, 1660, 829, + 0, 0, 1252, 1660, 839, 1660, 0, 1248, 1660, 841, + 1660, 1225, 842, 1246, 1234, 1238, 844, 1233, 846, 847, + 1224, 850, 1222, 851, 1211, 852, 1210, 854, 1207, 0, + + 1660, 1203, 1163, 1147, 1189, 1147, 1144, 814, 855, 857, + 860, 863, 1660, 865, 1141, 867, 868, 870, 873, 1180, + 0, 1660, 1173, 1139, 1171, 1170, 0, 1660, 1171, 1167, + 1164, 0, 1660, 1163, 0, 1152, 1161, 1160, 0, 1161, + 1157, 1144, 0, 1008, 1007, 1006, 881, 1660, 504, 1660, + 875, 1660, 878, 1005, 1004, 1005, 869, 871, 1004, 1003, + 893, 1660, 1660, 957, 953, 994, 985, 909, 882, 891, + 897, 902, 889, 907, 907, 907, 912, 916, 917, 1660, + 1660, 934, 1660, 1660, 1660, 1660, 886, 1660, 1660, 1660, + 1660, 1660, 1660, 1660, 908, 1660, 1660, 1660, 1660, 920, + + 926, 927, 799, 810, 808, 748, 928, 931, 935, 937, + 737, 940, 941, 943, 0, 948, 951, 944, 712, 717, + 556, 953, 955, 967, 515, 969, 974, 975, 977, 501, + 416, 976, 978, 368, 980, 981, 982, 1660, 990, 368, + 983, 353, 242, 230, 227, 1660, 115, 115, 1660, 1660, + 1013, 1025, 1037, 1049, 1061, 1073, 1085, 1097, 1109, 1121, + 1133, 1145, 1150, 1160, 1170, 1181, 1193, 1198, 1209, 1221, + 1226, 1237, 1242, 1253, 1264, 1275, 1287, 1292, 1297, 1308, + 1316, 1327, 1339, 1344, 1348, 1359, 1370, 1382, 1393, 1405, + 1416, 1426, 1436, 1447, 1459, 1470, 1481, 1493, 1505, 1517, + + 1528, 1539, 1551, 1554, 1564, 1575, 1580, 1589, 1599, 1604, + 1615, 1626, 1636, 1638, 1648 + } ; + +static yyconst flex_int16_t yy_def[516] = + { 0, + 451, 451, 450, 450, 450, 5, 451, 451, 452, 452, + 453, 453, 450, 13, 450, 15, 454, 454, 455, 455, + 450, 21, 450, 23, 456, 456, 457, 457, 450, 29, + 458, 458, 450, 33, 459, 459, 460, 460, 461, 461, + 450, 41, 450, 43, 450, 45, 450, 450, 450, 450, + 450, 450, 462, 450, 450, 463, 463, 463, 463, 463, + 464, 465, 465, 465, 465, 465, 466, 450, 450, 467, + 450, 450, 468, 468, 469, 450, 450, 450, 450, 450, + 470, 450, 450, 470, 450, 450, 450, 450, 471, 450, + 450, 472, 450, 450, 450, 450, 473, 474, 450, 475, + + 450, 476, 450, 450, 477, 450, 450, 450, 450, 450, + 478, 450, 450, 450, 479, 450, 450, 450, 450, 450, + 450, 480, 450, 481, 450, 482, 450, 450, 450, 450, + 450, 450, 483, 450, 450, 450, 450, 450, 484, 484, + 484, 450, 484, 450, 450, 450, 450, 450, 450, 450, + 450, 485, 486, 450, 450, 487, 488, 450, 450, 489, + 490, 490, 450, 450, 490, 450, 450, 450, 491, 491, + 450, 450, 450, 450, 450, 492, 450, 450, 450, 493, + 450, 450, 494, 495, 450, 450, 463, 463, 463, 463, + 463, 464, 496, 496, 496, 496, 496, 450, 465, 497, + + 465, 465, 465, 465, 466, 450, 498, 499, 450, 468, + 468, 469, 450, 450, 450, 470, 450, 450, 470, 450, + 450, 450, 450, 450, 471, 450, 500, 450, 473, 474, + 475, 450, 501, 450, 476, 502, 450, 450, 450, 503, + 478, 450, 504, 479, 450, 450, 450, 450, 450, 480, + 450, 505, 450, 506, 450, 450, 450, 450, 450, 483, + 450, 450, 450, 450, 450, 507, 484, 450, 450, 484, + 485, 486, 450, 450, 450, 450, 488, 450, 450, 450, + 450, 490, 490, 450, 450, 450, 450, 508, 491, 491, + 450, 450, 450, 492, 450, 450, 509, 493, 450, 494, + + 450, 450, 450, 463, 463, 463, 463, 496, 496, 496, + 496, 496, 450, 450, 450, 465, 465, 465, 465, 450, + 498, 450, 450, 468, 450, 450, 500, 450, 450, 501, + 450, 476, 450, 450, 503, 510, 450, 450, 511, 450, + 505, 450, 506, 450, 450, 450, 450, 450, 507, 450, + 450, 450, 450, 450, 450, 508, 512, 491, 450, 509, + 513, 450, 450, 450, 463, 450, 463, 463, 496, 496, + 496, 496, 450, 450, 450, 465, 450, 465, 465, 450, + 450, 468, 450, 450, 450, 450, 510, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 512, + + 491, 513, 450, 463, 450, 463, 496, 450, 496, 496, + 450, 465, 450, 465, 514, 450, 450, 491, 450, 450, + 463, 496, 450, 496, 450, 450, 465, 515, 491, 450, + 450, 450, 496, 450, 450, 450, 515, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 0, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450 + } ; + +static yyconst flex_int16_t yy_nxt[1710] = + { 0, + 50, 50, 51, 50, 52, 53, 50, 54, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 55, + 56, 56, 56, 56, 56, 56, 56, 56, 50, 50, + 50, 56, 56, 57, 58, 56, 59, 56, 60, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 50, 50, + 61, 51, 50, 52, 53, 50, 54, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 55, 62, + 62, 62, 62, 62, 62, 62, 62, 50, 50, 50, + 62, 62, 63, 64, 62, 65, 62, 66, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 50, 67, 67, + + 68, 67, 69, 70, 67, 71, 67, 67, 67, 67, + 67, 72, 67, 67, 67, 67, 67, 67, 73, 73, + 73, 73, 73, 73, 73, 73, 67, 67, 67, 73, + 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, + 73, 73, 74, 73, 73, 73, 67, 76, 77, 449, + 78, 80, 77, 79, 78, 82, 448, 79, 83, 84, + 82, 238, 239, 85, 48, 86, 49, 48, 48, 48, + 48, 48, 87, 48, 48, 48, 48, 48, 48, 48, + 48, 88, 48, 48, 89, 89, 89, 89, 89, 89, + 89, 89, 48, 48, 48, 89, 89, 89, 89, 89, + + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 48, 90, 91, 49, 90, 90, 92, 90, + 90, 48, 93, 90, 90, 94, 90, 90, 90, 90, + 95, 96, 90, 97, 97, 97, 97, 97, 97, 97, + 97, 90, 90, 90, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 90, 99, 100, 447, 101, 102, 217, 103, 104, + 100, 218, 101, 105, 99, 103, 107, 446, 107, 245, + 246, 99, 108, 109, 108, 109, 110, 445, 110, 48, + 48, 49, 48, 48, 48, 48, 48, 48, 48, 48, + + 48, 48, 48, 48, 48, 48, 48, 48, 48, 111, + 111, 111, 111, 111, 111, 111, 111, 48, 48, 48, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 48, 48, 112, + 49, 48, 48, 48, 48, 48, 113, 113, 48, 48, + 113, 48, 48, 48, 48, 114, 48, 48, 115, 115, + 115, 115, 115, 115, 115, 115, 48, 48, 48, 115, + 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, + 115, 115, 115, 115, 115, 115, 48, 48, 116, 117, + 268, 119, 198, 269, 120, 48, 121, 117, 444, 119, + + 249, 246, 120, 443, 123, 124, 48, 125, 126, 200, + 127, 442, 128, 124, 48, 125, 126, 431, 127, 129, + 130, 131, 129, 132, 133, 129, 134, 135, 129, 129, + 129, 129, 129, 136, 137, 137, 129, 138, 129, 139, + 139, 139, 139, 139, 140, 141, 139, 142, 129, 129, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 140, 139, 139, 143, 139, 144, 147, 147, + 148, 147, 149, 147, 147, 147, 150, 151, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 152, 152, + 152, 152, 152, 152, 152, 152, 150, 147, 151, 152, + + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 150, 49, 49, 154, + 154, 198, 155, 155, 49, 49, 158, 158, 397, 159, + 159, 162, 162, 163, 163, 219, 164, 164, 200, 220, + 222, 440, 231, 397, 156, 156, 232, 223, 256, 257, + 434, 160, 160, 275, 276, 202, 224, 431, 165, 165, + 166, 167, 168, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 169, 169, 169, 169, 169, 169, 169, 169, 166, 166, + 166, 169, 169, 169, 169, 169, 169, 169, 170, 169, + + 169, 169, 169, 169, 169, 169, 169, 169, 166, 171, + 172, 173, 171, 171, 171, 171, 171, 171, 171, 174, + 171, 175, 171, 171, 171, 171, 171, 171, 171, 176, + 176, 176, 176, 176, 176, 176, 176, 171, 171, 171, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 171, 177, 178, + 179, 177, 177, 177, 177, 177, 177, 177, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 180, 180, + 180, 180, 180, 180, 180, 180, 177, 177, 177, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + + 180, 180, 180, 180, 180, 180, 177, 192, 198, 198, + 198, 262, 264, 264, 264, 280, 281, 268, 420, 287, + 269, 265, 265, 292, 296, 200, 200, 200, 450, 268, + 282, 288, 269, 282, 293, 287, 297, 265, 270, 194, + 195, 198, 196, 198, 197, 430, 201, 288, 192, 204, + 270, 203, 262, 263, 263, 264, 270, 314, 200, 198, + 200, 333, 265, 265, 235, 198, 266, 198, 270, 198, + 198, 198, 198, 198, 290, 198, 200, 310, 265, 425, + 194, 195, 200, 196, 200, 197, 200, 200, 200, 200, + 200, 217, 200, 421, 222, 218, 219, 309, 315, 231, + + 220, 223, 316, 232, 238, 239, 312, 311, 317, 405, + 224, 420, 318, 245, 246, 198, 319, 249, 246, 256, + 257, 347, 347, 347, 262, 263, 263, 264, 262, 264, + 264, 264, 200, 268, 265, 348, 269, 419, 265, 265, + 351, 276, 353, 281, 450, 287, 282, 287, 287, 282, + 348, 292, 292, 296, 265, 296, 198, 288, 198, 288, + 288, 198, 293, 293, 198, 297, 373, 297, 198, 377, + 287, 198, 287, 200, 198, 200, 351, 276, 200, 353, + 281, 200, 288, 198, 288, 200, 200, 369, 200, 358, + 373, 200, 408, 370, 296, 347, 347, 347, 198, 243, + + 200, 371, 395, 198, 396, 372, 297, 374, 198, 200, + 378, 376, 401, 377, 379, 200, 395, 413, 198, 416, + 200, 287, 417, 417, 417, 200, 407, 287, 296, 198, + 200, 374, 408, 288, 200, 200, 423, 409, 198, 288, + 297, 426, 413, 410, 198, 287, 200, 415, 411, 200, + 375, 412, 406, 200, 432, 200, 423, 288, 200, 200, + 414, 200, 417, 417, 417, 417, 417, 417, 198, 418, + 426, 200, 422, 200, 396, 435, 436, 432, 439, 441, + 424, 435, 436, 436, 441, 200, 405, 200, 427, 429, + 288, 439, 200, 438, 200, 366, 200, 404, 200, 438, + + 438, 200, 403, 288, 360, 359, 356, 399, 398, 394, + 393, 392, 433, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 75, 75, 75, 75, 75, + 75, 75, 75, 75, 75, 75, 75, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 98, + 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, + 98, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 118, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 183, 183, 391, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 187, 340, 187, + 187, 193, 340, 389, 388, 243, 386, 385, 329, 193, + 193, 199, 329, 384, 383, 382, 381, 199, 199, 199, + 199, 205, 205, 380, 375, 368, 205, 367, 205, 205, + 366, 365, 205, 207, 207, 364, 207, 207, 207, 207, + + 207, 207, 207, 207, 207, 210, 363, 210, 210, 212, + 362, 360, 295, 212, 212, 212, 212, 212, 212, 212, + 212, 216, 216, 359, 216, 291, 216, 216, 216, 216, + 216, 216, 216, 225, 356, 225, 225, 227, 227, 286, + 227, 355, 227, 227, 227, 227, 227, 227, 227, 229, + 354, 229, 229, 230, 283, 352, 350, 346, 230, 345, + 230, 230, 230, 230, 230, 233, 258, 344, 233, 342, + 340, 339, 338, 233, 233, 235, 235, 337, 235, 235, + 235, 235, 235, 235, 235, 235, 235, 240, 240, 243, + 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, + + 242, 241, 241, 244, 244, 334, 244, 244, 250, 331, + 329, 328, 228, 250, 250, 250, 250, 250, 250, 250, + 252, 226, 221, 221, 215, 252, 252, 254, 254, 326, + 254, 325, 254, 254, 254, 254, 254, 254, 254, 260, + 260, 324, 260, 260, 260, 260, 260, 260, 260, 260, + 260, 267, 323, 267, 267, 271, 320, 271, 271, 272, + 272, 307, 306, 272, 272, 272, 272, 272, 272, 272, + 274, 274, 274, 274, 274, 274, 274, 274, 274, 274, + 274, 274, 277, 277, 305, 304, 277, 277, 277, 277, + 277, 277, 277, 279, 279, 279, 279, 279, 279, 279, + + 279, 279, 279, 279, 279, 282, 282, 282, 303, 282, + 282, 282, 282, 282, 282, 282, 282, 289, 302, 299, + 181, 295, 289, 289, 291, 289, 289, 294, 286, 285, + 284, 294, 283, 294, 283, 294, 294, 298, 278, 273, + 261, 259, 298, 298, 258, 298, 298, 300, 300, 255, + 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, + 301, 301, 301, 253, 301, 301, 301, 301, 301, 301, + 301, 308, 251, 248, 247, 243, 242, 308, 308, 308, + 308, 313, 313, 313, 313, 313, 313, 313, 313, 236, + 313, 313, 313, 321, 321, 237, 321, 321, 321, 321, + + 321, 321, 321, 321, 321, 322, 322, 322, 322, 236, + 322, 322, 322, 322, 322, 322, 322, 327, 327, 234, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 330, + 228, 226, 221, 215, 214, 330, 213, 330, 330, 332, + 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, + 332, 335, 335, 211, 335, 335, 335, 335, 335, 335, + 335, 335, 335, 336, 336, 341, 209, 208, 206, 191, + 190, 341, 189, 341, 341, 343, 343, 188, 343, 343, + 343, 343, 343, 343, 343, 343, 343, 349, 186, 349, + 357, 185, 184, 182, 181, 450, 146, 146, 357, 357, + + 361, 49, 49, 49, 49, 450, 450, 450, 361, 361, + 387, 387, 450, 387, 387, 390, 390, 390, 390, 450, + 390, 390, 390, 390, 390, 390, 390, 400, 450, 450, + 450, 450, 400, 400, 450, 400, 400, 402, 450, 450, + 450, 450, 402, 402, 450, 402, 402, 428, 428, 437, + 450, 450, 450, 450, 450, 437, 437, 437, 437, 47, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + + 450, 450, 450, 450, 450, 450, 450, 450, 450 + } ; + +static yyconst flex_int16_t yy_chk[1710] = + { 0, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 9, 9, 448, + 9, 10, 10, 9, 10, 11, 447, 10, 11, 12, + 12, 104, 104, 12, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 17, 17, 445, 17, 17, 82, 17, 18, + 18, 82, 18, 18, 17, 18, 19, 444, 20, 116, + 116, 18, 19, 19, 20, 20, 19, 443, 20, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, + 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, + 140, 25, 62, 140, 25, 26, 26, 26, 442, 26, + + 121, 121, 26, 440, 27, 27, 25, 27, 27, 62, + 27, 434, 28, 28, 26, 28, 28, 431, 28, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + + 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 35, 36, 35, + 36, 64, 35, 36, 37, 38, 37, 38, 349, 37, + 38, 39, 40, 39, 40, 84, 39, 40, 64, 84, + 86, 430, 100, 349, 35, 36, 100, 86, 128, 128, + 425, 37, 38, 156, 156, 64, 86, 421, 39, 40, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + + 41, 41, 41, 41, 41, 41, 41, 41, 41, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + + 45, 45, 45, 45, 45, 45, 45, 61, 63, 65, + 66, 137, 137, 137, 137, 160, 160, 141, 420, 169, + 141, 137, 137, 176, 180, 63, 65, 66, 165, 143, + 165, 169, 143, 165, 176, 170, 180, 137, 141, 61, + 61, 193, 61, 195, 61, 419, 63, 170, 192, 66, + 143, 65, 136, 136, 136, 136, 141, 200, 193, 194, + 195, 236, 136, 136, 236, 196, 136, 197, 143, 198, + 199, 201, 203, 202, 170, 204, 194, 195, 136, 411, + 192, 192, 196, 192, 197, 192, 198, 199, 201, 203, + 202, 217, 204, 406, 222, 217, 219, 194, 200, 231, + + 219, 222, 201, 231, 238, 238, 197, 196, 202, 405, + 222, 404, 203, 245, 245, 308, 204, 249, 249, 256, + 256, 262, 262, 262, 263, 263, 263, 263, 264, 264, + 264, 264, 308, 270, 263, 263, 270, 403, 264, 264, + 275, 275, 280, 280, 283, 287, 283, 289, 290, 283, + 263, 292, 294, 296, 264, 298, 309, 287, 310, 289, + 290, 311, 292, 294, 312, 296, 314, 298, 316, 317, + 357, 318, 358, 309, 319, 310, 351, 351, 311, 353, + 353, 312, 357, 369, 358, 316, 317, 309, 318, 290, + 373, 319, 370, 310, 361, 347, 347, 347, 371, 387, + + 369, 311, 347, 372, 347, 312, 361, 314, 376, 370, + 318, 316, 358, 377, 319, 371, 347, 378, 379, 395, + 372, 400, 395, 395, 395, 376, 369, 401, 402, 407, + 377, 373, 408, 400, 378, 379, 409, 371, 410, 401, + 402, 412, 413, 372, 414, 418, 407, 382, 375, 408, + 374, 376, 368, 409, 422, 410, 423, 418, 412, 413, + 379, 414, 416, 416, 416, 417, 417, 417, 424, 401, + 426, 422, 407, 423, 417, 427, 428, 432, 429, 433, + 410, 435, 436, 437, 441, 424, 367, 426, 414, 418, + 429, 439, 427, 428, 432, 366, 433, 365, 435, 436, + + 437, 441, 364, 439, 360, 359, 356, 355, 354, 346, + 345, 344, 424, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 452, 452, 452, 452, 452, + 452, 452, 452, 452, 452, 452, 452, 453, 453, 453, + 453, 453, 453, 453, 453, 453, 453, 453, 453, 454, + 454, 454, 454, 454, 454, 454, 454, 454, 454, 454, + 454, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 457, 457, 457, 457, 457, + 457, 457, 457, 457, 457, 457, 457, 458, 458, 458, + + 458, 458, 458, 458, 458, 458, 458, 458, 458, 459, + 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, + 459, 460, 460, 460, 460, 460, 460, 460, 460, 460, + 460, 460, 460, 461, 461, 461, 461, 461, 461, 461, + 461, 461, 461, 461, 461, 462, 462, 342, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 463, 341, 463, + 463, 464, 340, 338, 337, 336, 334, 331, 330, 464, + 464, 465, 329, 326, 325, 324, 323, 465, 465, 465, + 465, 466, 466, 320, 315, 307, 466, 306, 466, 466, + 305, 304, 466, 467, 467, 303, 467, 467, 467, 467, + + 467, 467, 467, 467, 467, 468, 302, 468, 468, 469, + 299, 297, 295, 469, 469, 469, 469, 469, 469, 469, + 469, 470, 470, 293, 470, 291, 470, 470, 470, 470, + 470, 470, 470, 471, 288, 471, 471, 472, 472, 286, + 472, 285, 472, 472, 472, 472, 472, 472, 472, 473, + 284, 473, 473, 474, 282, 278, 273, 261, 474, 259, + 474, 474, 474, 474, 474, 475, 258, 255, 475, 253, + 252, 251, 248, 475, 475, 476, 476, 247, 476, 476, + 476, 476, 476, 476, 476, 476, 476, 477, 477, 244, + 477, 477, 477, 477, 477, 477, 477, 477, 477, 478, + + 242, 478, 478, 479, 479, 237, 479, 479, 480, 234, + 233, 232, 228, 480, 480, 480, 480, 480, 480, 480, + 481, 226, 221, 220, 215, 481, 481, 482, 482, 214, + 482, 213, 482, 482, 482, 482, 482, 482, 482, 483, + 483, 211, 483, 483, 483, 483, 483, 483, 483, 483, + 483, 484, 209, 484, 484, 485, 206, 485, 485, 486, + 486, 191, 190, 486, 486, 486, 486, 486, 486, 486, + 487, 487, 487, 487, 487, 487, 487, 487, 487, 487, + 487, 487, 488, 488, 189, 188, 488, 488, 488, 488, + 488, 488, 488, 489, 489, 489, 489, 489, 489, 489, + + 489, 489, 489, 489, 489, 490, 490, 490, 186, 490, + 490, 490, 490, 490, 490, 490, 490, 491, 185, 182, + 181, 178, 491, 491, 172, 491, 491, 492, 167, 164, + 163, 492, 162, 492, 161, 492, 492, 493, 159, 154, + 134, 132, 493, 493, 130, 493, 493, 494, 494, 127, + 494, 494, 494, 494, 494, 494, 494, 494, 494, 495, + 495, 495, 495, 125, 495, 495, 495, 495, 495, 495, + 495, 496, 124, 120, 119, 115, 112, 496, 496, 496, + 496, 497, 497, 497, 497, 497, 497, 497, 497, 105, + 497, 497, 497, 498, 498, 103, 498, 498, 498, 498, + + 498, 498, 498, 498, 498, 499, 499, 499, 499, 102, + 499, 499, 499, 499, 499, 499, 499, 500, 500, 101, + 500, 500, 500, 500, 500, 500, 500, 500, 500, 501, + 95, 91, 85, 80, 79, 501, 78, 501, 501, 502, + 502, 502, 502, 502, 502, 502, 502, 502, 502, 502, + 502, 503, 503, 74, 503, 503, 503, 503, 503, 503, + 503, 503, 503, 504, 504, 505, 71, 70, 69, 60, + 59, 505, 58, 505, 505, 506, 506, 57, 506, 506, + 506, 506, 506, 506, 506, 506, 506, 507, 55, 507, + 508, 54, 53, 52, 51, 47, 32, 31, 508, 508, + + 509, 8, 7, 2, 1, 0, 0, 0, 509, 509, + 510, 510, 0, 510, 510, 511, 511, 511, 511, 0, + 511, 511, 511, 511, 511, 511, 511, 512, 0, 0, + 0, 0, 512, 512, 0, 512, 512, 513, 0, 0, + 0, 0, 513, 513, 0, 513, 513, 514, 514, 515, + 0, 0, 0, 0, 0, 515, 515, 515, 515, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + 450, 450, 450, 450, 450, 450, 450, 450, 450, 450, + + 450, 450, 450, 450, 450, 450, 450, 450, 450 + } ; + +extern int pyscanYY_flex_debug; +int pyscanYY_flex_debug = 0; + +static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; +static char *yy_full_match; +static int yy_lp; +static int yy_looking_for_trail_begin = 0; +static int yy_full_lp; +static int *yy_full_state; +#define YY_TRAILING_MASK 0x2000 +#define YY_TRAILING_HEAD_MASK 0x4000 +#define REJECT \ +{ \ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ \ +yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ +(yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \ +(yy_state_ptr) = (yy_full_state); /* restore orig. state */ \ +yy_current_state = *(yy_state_ptr); /* restore curr. state */ \ +++(yy_lp); \ +goto find_rule; \ +} + +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *pyscanYYtext; +#line 1 "pyscanner.l" +/****************************************************************************** + * + * $Id: pyscanner.l,v 1.9 2001/03/19 19:27:39 root Exp $ + * + * Copyright (C) 1997-2012 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ +/* This code is based on the work done by the MoxyPyDoxy team + * (Linda Leong, Mike Rivera, Kim Truong, and Gabriel Estrada) + * in Spring 2005 as part of CS 179E: Compiler Design Project + * at the University of California, Riverside; the course was + * taught by Peter H. Froehlich <phf@acm.org>. + */ +#line 26 "pyscanner.l" + +/* + * includes + */ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include <ctype.h> + +#include "qtbc.h" +#include <qarray.h> +#include <qstack.h> +#include <qregexp.h> +#include <unistd.h> +#include <qfile.h> +#include <qfileinfo.h> + +#include "pyscanner.h" +#include "entry.h" +#include "message.h" +#include "config.h" +#include "doxygen.h" +#include "util.h" +#include "defargs.h" +#include "language.h" +#include "commentscan.h" +#include "pycode.h" +#include "arguments.h" + +#define YY_NEVER_INTERACTIVE 1 +#define YY_NO_INPUT 1 + +/* ----------------------------------------------------------------- + * + * statics + */ + + +static ParserInterface *g_thisParser; +static const char * inputString; +static int inputPosition; +static QFile inputFile; + +static Protection protection; + +static Entry* current_root = 0 ; +static Entry* current = 0 ; +static Entry* previous = 0 ; +static Entry* bodyEntry = 0 ; +static int yyLineNr = 1 ; +static QCString yyFileName; +static MethodTypes mtype; +static bool gstat; +static Specifier virt; + +static int docBlockContext; +static QCString docBlock; +static QCString docBlockName; +static bool docBlockInBody; +static bool docBlockJavaStyle; +static bool docBrief; +static bool docBlockSpecial; + +static bool g_doubleQuote; +static bool g_specialBlock; +static int g_stringContext; +static QGString * g_copyString; +static int g_indent = 0; +static int g_curIndent = 0; + +static QDict<QCString> g_packageNameCache(257); +static QCString g_packageScope; + +static char g_atomStart; +static char g_atomEnd; +static int g_atomCount; + +//static bool g_insideConstructor; + +static QCString g_moduleScope; +static QCString g_packageName; + +//static bool g_hideClassDocs; + +static QCString g_defVal; +static int g_braceCount; + +static bool g_lexInit = FALSE; +static bool g_packageCommentAllowed; + +//----------------------------------------------------------------------------- + + +static void initParser() +{ + protection = Public; + mtype = Method; + gstat = FALSE; + virt = Normal; + previous = 0; + g_packageCommentAllowed = TRUE; + g_packageNameCache.setAutoDelete(TRUE); +} + +static void initEntry() +{ + //current->python = TRUE; + current->protection = protection ; + current->mtype = mtype; + current->virt = virt; + current->stat = gstat; + current->lang = SrcLangExt_Python; + current->setParent(current_root); + initGroupInfo(current); + gstat = FALSE; +} + +static void newEntry() +{ + previous = current; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); +} + +static void newVariable() +{ + if (!current->name.isEmpty() && current->name.at(0)=='_') // mark as private + { + current->protection=Private; + } + if (current_root->section&Entry::COMPOUND_MASK) // mark as class variable + { + current->stat = TRUE; + } + newEntry(); +} + +static void newFunction() +{ + if (current->name.left(2)=="__" && current->name.right(2)=="__") + { + // special method name, see + // http://docs.python.org/ref/specialnames.html + current->protection=Public; + } + else if (current->name.at(0)=='_') + { + current->protection=Private; + } +} + +static inline int computeIndent(const char *s) +{ + int col=0; + static int tabSize=Config_getInt("TAB_SIZE"); + const char *p=s; + char c; + while ((c=*p++)) + { + if (c==' ') col++; + else if (c=='\t') col+=tabSize-(col%tabSize); + else break; + } + return col; +} + +static QCString findPackageScopeFromPath(const QCString &path) +{ + QCString *pScope = g_packageNameCache.find(path); + if (pScope) + { + return *pScope; + } + QFileInfo pf(path+"/__init__.py"); // found package initialization file + if (pf.exists()) + { + int i=path.findRev('/'); + if (i!=-1) + { + QCString scope = findPackageScopeFromPath(path.left(i)); + if (!scope.isEmpty()) + { + scope+="::"; + } + scope+=path.mid(i+1); + g_packageNameCache.insert(path,new QCString(scope)); + return scope; + } + } + return ""; +} + +static QCString findPackageScope(const char *fileName) +{ + if (fileName==0) return ""; + QFileInfo fi(fileName); + return findPackageScopeFromPath(fi.dirPath(TRUE).data()); +} + +//----------------------------------------------------------------------------- + +static void lineCount() +{ + //fprintf(stderr,"yyLineNr=%d\n",yyLineNr); + for (const char *p = pyscanYYtext; *p; ++p) + { + yyLineNr += (*p == '\n') ; + } +} + +static void incLineNr() +{ + //fprintf(stderr,"yyLineNr=%d\n",yyLineNr); + yyLineNr++; +} + +#if 0 +// Appends the current-name to current-type; +// Destroys current-name. +// Destroys current->args and current->argList +static void addType( Entry* current ) +{ + uint tl=current->type.length(); + if ( tl>0 && !current->name.isEmpty() && current->type.at(tl-1)!='.') + { + current->type += ' ' ; + } + current->type += current->name ; + current->name.resize(0) ; + tl=current->type.length(); + if ( tl>0 && !current->args.isEmpty() && current->type.at(tl-1)!='.') + { + current->type += ' ' ; + } + current->type += current->args ; + current->args.resize(0) ; + current->argList->clear(); +} + +static QCString stripQuotes(const char *s) +{ + QCString name; + if (s==0 || *s==0) return name; + name=s; + if (name.at(0)=='"' && name.at(name.length()-1)=='"') + { + name=name.mid(1,name.length()-2); + } + return name; +} +#endif +//----------------------------------------------------------------- + +//----------------------------------------------------------------- +static void startCommentBlock(bool brief) +{ + if (brief) + { + current->briefFile = yyFileName; + current->briefLine = yyLineNr; + } + else + { + current->docFile = yyFileName; + current->docLine = yyLineNr; + } +} + +/* +static void appendDocBlock() { + previous = current; + current_root->addSubEntry(current); + current = new Entry; + initEntry(); +} +*/ + +static void handleCommentBlock(const QCString &doc,bool brief) +{ + //printf("handleCommentBlock(doc=[%s] brief=%d docBlockInBody=%d docBlockJavaStyle=%d\n", + // doc.data(),brief,docBlockInBody,docBlockJavaStyle); + + // TODO: Fix me + docBlockInBody=FALSE; + + if (docBlockInBody && previous && !previous->doc.isEmpty()) + { + previous->doc=previous->doc.stripWhiteSpace()+"\n\n"; + } + + int position = 0; + bool needsEntry; + int lineNr = brief ? current->briefLine : current->docLine; + while (parseCommentBlock( + g_thisParser, + (docBlockInBody && previous) ? previous : current, + doc, // text + yyFileName, // file + lineNr, + docBlockInBody ? FALSE : brief, + docBlockJavaStyle, // javadoc style // or FALSE, + docBlockInBody, + protection, + position, + needsEntry) + ) // need to start a new entry + { + if (needsEntry) + { + newEntry(); + } + } + if (needsEntry) + { + newEntry(); + } + +} + +static void endOfDef(int correction=0) +{ + //printf("endOfDef at=%d\n",yyLineNr); + if (bodyEntry) + { + bodyEntry->endBodyLine = yyLineNr-correction; + bodyEntry = 0; + } + newEntry(); + //g_insideConstructor = FALSE; +} + +static inline void addToString(const char *s) +{ + if (g_copyString) (*g_copyString)+=s; +} + +static void initTriDoubleQuoteBlock() +{ + docBlockContext = YY_START; + docBlockInBody = FALSE; + docBlockJavaStyle = TRUE; + docBlockSpecial = pyscanYYtext[3]=='!'; + docBlock.resize(0); + g_doubleQuote = TRUE; + startCommentBlock(FALSE); +} + +static void initTriSingleQuoteBlock() +{ + docBlockContext = YY_START; + docBlockInBody = FALSE; + docBlockJavaStyle = TRUE; + docBlockSpecial = pyscanYYtext[3]=='!'; + docBlock.resize(0); + g_doubleQuote = FALSE; + startCommentBlock(FALSE); +} + +static void initSpecialBlock() +{ + docBlockContext = YY_START; + docBlockInBody = FALSE; + docBlockJavaStyle = TRUE; + docBrief = TRUE; + docBlock.resize(0); + startCommentBlock(TRUE); +} + +static void searchFoundDef() +{ + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + current->section = Entry::FUNCTION_SEC; + current->protection = protection = Public; + current->lang = SrcLangExt_Python; + current->virt = Normal; + current->stat = gstat; + current->mtype = mtype = Method; + current->type.resize(0); + current->name.resize(0); + current->args.resize(0); + current->argList->clear(); + g_packageCommentAllowed = FALSE; + gstat=FALSE; + //printf("searchFoundDef at=%d\n",yyLineNr); +} + +static void searchFoundClass() +{ + current->section = Entry::CLASS_SEC; + current->argList->clear(); + current->type += "class" ; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + g_packageCommentAllowed = FALSE; +} + +//----------------------------------------------------------------------------- +/* ----------------------------------------------------------------- */ +#undef YY_INPUT +#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size); + +static int yyread(char *buf,int max_size) +{ + int c=0; + while ( c < max_size && inputString[inputPosition] ) + { + *buf = inputString[inputPosition++] ; + //printf("%d (%c)\n",*buf,*buf); + c++; buf++; + } + return c; +} + +/* start command character */ +/* Main start state */ + + +/* Mid-comment states */ +/* %x FuncDoubleComment */ +/* %x ClassDoubleComment */ + + + +/* Function states */ + + + + +/* Class states */ + + + + +/* Variable states */ + + + +/* String states */ + + + +/* import */ + + + +#line 1582 "<stdout>" + +#define INITIAL 0 +#define Search 1 +#define SearchMemVars 2 +#define TryClassDocString 3 +#define TripleComment 4 +#define SpecialComment 5 +#define FunctionDec 6 +#define FunctionParams 7 +#define FunctionBody 8 +#define FunctionParamDefVal 9 +#define ClassDec 10 +#define ClassInheritance 11 +#define ClassCaptureIndent 12 +#define ClassBody 13 +#define VariableDec 14 +#define VariableEnd 15 +#define VariableAtom 16 +#define SingleQuoteString 17 +#define DoubleQuoteString 18 +#define TripleString 19 +#define FromMod 20 +#define FromModItem 21 +#define Import 22 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include <unistd.h> +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int pyscanYYlex_destroy (void ); + +int pyscanYYget_debug (void ); + +void pyscanYYset_debug (int debug_flag ); + +YY_EXTRA_TYPE pyscanYYget_extra (void ); + +void pyscanYYset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *pyscanYYget_in (void ); + +void pyscanYYset_in (FILE * in_str ); + +FILE *pyscanYYget_out (void ); + +void pyscanYYset_out (FILE * out_str ); + +yy_size_t pyscanYYget_leng (void ); + +char *pyscanYYget_text (void ); + +int pyscanYYget_lineno (void ); + +void pyscanYYset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int pyscanYYwrap (void ); +#else +extern int pyscanYYwrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 262144 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO fwrite( pyscanYYtext, pyscanYYleng, 1, pyscanYYout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + yy_size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( pyscanYYin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( pyscanYYin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, pyscanYYin))==0 && ferror(pyscanYYin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(pyscanYYin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int pyscanYYlex (void); + +#define YY_DECL int pyscanYYlex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after pyscanYYtext and pyscanYYleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( pyscanYYleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (pyscanYYtext[pyscanYYleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 534 "pyscanner.l" + + + /* ------------ Function recognition rules -------------- */ + +#line 1794 "<stdout>" + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + /* Create the reject buffer large enough to save one state per allowed character. */ + if ( ! (yy_state_buf) ) + (yy_state_buf) = (yy_state_type *)pyscanYYalloc(YY_STATE_BUF_SIZE ); + if ( ! (yy_state_buf) ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYYlex()" ); + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! pyscanYYin ) + pyscanYYin = stdin; + + if ( ! pyscanYYout ) + pyscanYYout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + pyscanYYensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + pyscanYY_create_buffer(pyscanYYin,YY_BUF_SIZE ); + } + + pyscanYY_load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of pyscanYYtext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 451 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *(yy_state_ptr)++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1660 ); + +yy_find_action: + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; +goto find_rule; /* Shut up GCC warning -Wall */ +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[(yy_lp)]; + if ( yy_act & YY_TRAILING_HEAD_MASK || + (yy_looking_for_trail_begin) ) + { + if ( yy_act == (yy_looking_for_trail_begin) ) + { + (yy_looking_for_trail_begin) = 0; + yy_act &= ~YY_TRAILING_HEAD_MASK; + break; + } + } + else if ( yy_act & YY_TRAILING_MASK ) + { + (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK; + (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK; + } + else + { + (yy_full_match) = yy_cp; + (yy_full_state) = (yy_state_ptr); + (yy_full_lp) = (yy_lp); + break; + } + ++(yy_lp); + goto find_rule; + } + --yy_cp; + yy_current_state = *--(yy_state_ptr); + (yy_lp) = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + +case 1: +YY_RULE_SETUP +#line 540 "pyscanner.l" +{ // start of a function/method definition with indent + //fprintf(stderr,"Found def at %d\n",yyLineNr); + g_indent=computeIndent(pyscanYYtext); + searchFoundDef(); + BEGIN( FunctionDec ); + } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 546 "pyscanner.l" +{ // start of a function/method definition + searchFoundDef(); + BEGIN( FunctionDec ); + } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 551 "pyscanner.l" +{ // start of a class definition with indent + //fprintf(stderr,"Found class at %d\n",yyLineNr); + g_indent=computeIndent(pyscanYYtext); + searchFoundClass(); + BEGIN( ClassDec ) ; + } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 557 "pyscanner.l" +{ // start of a class definition + searchFoundClass(); + BEGIN( ClassDec ) ; + } + YY_BREAK +case 5: +#line 562 "pyscanner.l" +case 6: +YY_RULE_SETUP +#line 562 "pyscanner.l" +{ // start of an from import + g_packageCommentAllowed = FALSE; + BEGIN( FromMod ); + } + YY_BREAK +case 7: +#line 568 "pyscanner.l" +case 8: +YY_RULE_SETUP +#line 568 "pyscanner.l" +{ // start of an import statement + g_packageCommentAllowed = FALSE; + BEGIN( Import ); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 572 "pyscanner.l" +{ // property + current->section = Entry::VARIABLE_SEC; + current->mtype = Property; + current->name = QCString(pyscanYYtext).stripWhiteSpace(); + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + g_packageCommentAllowed = FALSE; + BEGIN(VariableDec); + } + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 582 "pyscanner.l" +{ // variable + g_indent=computeIndent(pyscanYYtext); + current->section = Entry::VARIABLE_SEC; + current->name = QCString(pyscanYYtext).stripWhiteSpace(); + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + g_packageCommentAllowed = FALSE; + BEGIN(VariableDec); + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 592 "pyscanner.l" +{ // start of a single quoted string + g_stringContext=YY_START; + g_copyString=0; + g_packageCommentAllowed = FALSE; + BEGIN( SingleQuoteString ); + } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 598 "pyscanner.l" +{ // start of a double quoted string + g_stringContext=YY_START; + g_copyString=0; + g_packageCommentAllowed = FALSE; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 604 "pyscanner.l" +{ + gstat=TRUE; + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 607 "pyscanner.l" +{ // normal comment + g_packageCommentAllowed = FALSE; + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 610 "pyscanner.l" +{ // some other identifier + g_packageCommentAllowed = FALSE; + } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 613 "pyscanner.l" +{ + g_curIndent=computeIndent(pyscanYYtext); + } + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +#line 617 "pyscanner.l" +{ // new line + lineCount(); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 621 "pyscanner.l" +{ // start of a comment block + initTriDoubleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 626 "pyscanner.l" +{ // start of a comment block + initTriSingleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 20: +/* rule 20 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 2; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 631 "pyscanner.l" +{ // start of a special comment + g_curIndent=computeIndent(pyscanYYtext); + g_packageCommentAllowed = FALSE; + initSpecialBlock(); + BEGIN(SpecialComment); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 637 "pyscanner.l" +{ // any other character... + // This is the major default + // that should catch everything + // else in Body. + } + YY_BREAK + + +case 22: +YY_RULE_SETUP +#line 645 "pyscanner.l" +{ // from package import + g_packageName=pyscanYYtext; + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 648 "pyscanner.l" +{ + BEGIN(FromModItem); + } + YY_BREAK +case 24: +/* rule 24 can match eol */ +YY_RULE_SETUP +#line 651 "pyscanner.l" +{ + incLineNr(); + BEGIN(Search); + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 655 "pyscanner.l" +{ + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 657 "pyscanner.l" +{ + unput(*pyscanYYtext); + BEGIN(Search); + } + YY_BREAK + + +case 27: +YY_RULE_SETUP +#line 664 "pyscanner.l" +{ // import all + QCString item=g_packageName; + current->name=removeRedundantWhiteSpace(substitute(item,".","::")); + current->fileName = yyFileName; + //printf("Adding using directive: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data()); + current->section=Entry::USINGDIR_SEC; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + BEGIN(Search); + } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 675 "pyscanner.l" +{ + QCString item=g_packageName+"."+pyscanYYtext; + current->name=removeRedundantWhiteSpace(substitute(item,".","::")); + current->fileName = yyFileName; + //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data()); + current->section=Entry::USINGDECL_SEC; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 685 "pyscanner.l" +{ + QCString item=g_packageName+"."+pyscanYYtext; + current->name=removeRedundantWhiteSpace(substitute(item,".","::")); + current->fileName = yyFileName; + //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data()); + current->section=Entry::USINGDECL_SEC; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + BEGIN(Search); + } + YY_BREAK +case 30: +/* rule 30 can match eol */ +YY_RULE_SETUP +#line 696 "pyscanner.l" +{ + incLineNr(); + BEGIN(Search); + } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 700 "pyscanner.l" +{ + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 702 "pyscanner.l" +{ + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 704 "pyscanner.l" +{ + unput(*pyscanYYtext); + BEGIN(Search); + } + YY_BREAK + + +case 34: +YY_RULE_SETUP +#line 711 "pyscanner.l" +{ + current->name=removeRedundantWhiteSpace(substitute(pyscanYYtext,".","::")); + current->fileName = yyFileName; + //printf("Adding using declaration: found:%s:%d name=%s\n",yyFileName.data(),yyLineNr,current->name.data()); + current->section=Entry::USINGDECL_SEC; + current_root->addSubEntry(current); + current = new Entry ; + initEntry(); + BEGIN(Search); + } + YY_BREAK +case 35: +/* rule 35 can match eol */ +YY_RULE_SETUP +#line 721 "pyscanner.l" +{ + incLineNr(); + BEGIN(Search); + } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 725 "pyscanner.l" +{ + } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 727 "pyscanner.l" +{ + unput(*pyscanYYtext); + BEGIN(Search); + } + YY_BREAK + + +case 38: +YY_RULE_SETUP +#line 734 "pyscanner.l" +{ + //fprintf(stderr,"Found member variable %s in %s at %d\n",&pyscanYYtext[5],current_root->name.data(),yyLineNr); + current->name=&pyscanYYtext[5]; + current->section=Entry::VARIABLE_SEC; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + current->type.resize(0); + if (current->name.at(0)=='_') // mark as private + { + current->protection=Private; + } + else + { + current->protection=Public; + } + newEntry(); + } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 752 "pyscanner.l" +{ // start of a comment block + initTriDoubleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 757 "pyscanner.l" +{ // start of a comment block + initTriSingleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 41: +/* rule 41 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 2; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 762 "pyscanner.l" +{ // start of a special comment + initSpecialBlock(); + BEGIN(SpecialComment); + } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 766 "pyscanner.l" +{ // # + } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 768 "pyscanner.l" +{ // start of a single quoted string + g_stringContext=YY_START; + g_copyString=0; + BEGIN( SingleQuoteString ); + } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 773 "pyscanner.l" +{ // start of a double quoted string + g_stringContext=YY_START; + g_copyString=0; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 45: +/* rule 45 can match eol */ +YY_RULE_SETUP +#line 778 "pyscanner.l" +{ incLineNr(); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 779 "pyscanner.l" +// identifiers + YY_BREAK +case 47: +YY_RULE_SETUP +#line 780 "pyscanner.l" +// other uninteresting stuff + YY_BREAK +case 48: +YY_RULE_SETUP +#line 781 "pyscanner.l" +// anything else + YY_BREAK + + +case 49: +/* rule 49 can match eol */ +YY_RULE_SETUP +#line 785 "pyscanner.l" +{ + //fprintf(stderr,"indent %d<=%d\n",computeIndent(&pyscanYYtext[1]),g_indent); + if (computeIndent(&pyscanYYtext[1])<=g_indent) + { + int i; + for (i=pyscanYYleng-1;i>=0;i--) + { + unput(pyscanYYtext[i]); + } + endOfDef(); + //YY_CURRENT_BUFFER->yy_at_bol=TRUE; + BEGIN(Search); + } + else + { + incLineNr(); + current->program+=pyscanYYtext; + } + } + YY_BREAK +case 50: +/* rule 50 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp -= 2; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 804 "pyscanner.l" +{ + if (computeIndent(&pyscanYYtext[1])<=g_indent) + { + int i; + for (i=pyscanYYleng-1;i>=0;i--) + { + unput(pyscanYYtext[i]); + } + endOfDef(); + //YY_CURRENT_BUFFER->yy_at_bol=TRUE; + BEGIN(Search); + } + else + { + incLineNr(); + current->program+=pyscanYYtext; + } + } + YY_BREAK +case YY_STATE_EOF(FunctionBody): +#line 822 "pyscanner.l" +{ + endOfDef(); + yyterminate(); + } + YY_BREAK +case 51: +/* rule 51 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 826 "pyscanner.l" +{ // skip empty line + current->program+=pyscanYYtext; + } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 829 "pyscanner.l" +{ // something at indent >0 + current->program+=pyscanYYtext; + g_curIndent = computeIndent(pyscanYYtext); + if (g_curIndent<=g_indent) + // jumped out of the function + { + endOfDef(1); + BEGIN(Search); + } + } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 839 "pyscanner.l" +{ // start of a single quoted string + current->program+=pyscanYYtext; + g_stringContext=YY_START; + g_specialBlock = FALSE; + g_copyString=¤t->program; + BEGIN( SingleQuoteString ); + } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 846 "pyscanner.l" +{ // start of a double quoted string + current->program+=pyscanYYtext; + g_stringContext=YY_START; + g_specialBlock = FALSE; + g_copyString=¤t->program; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 853 "pyscanner.l" +{ // non-special stuff + current->program+=pyscanYYtext; + g_specialBlock = FALSE; + } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 857 "pyscanner.l" +{ // normal comment + current->program+=pyscanYYtext; + } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 860 "pyscanner.l" +{ // comment half way + current->program+=pyscanYYtext; + } + YY_BREAK +case 58: +/* rule 58 can match eol */ +YY_RULE_SETUP +#line 863 "pyscanner.l" +{ + incLineNr(); + current->program+=pyscanYYtext; + } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 867 "pyscanner.l" +{ // any character + current->program+=*pyscanYYtext; + g_specialBlock = FALSE; + } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 872 "pyscanner.l" +{ // start of a comment block + current->program+=pyscanYYtext; + initTriDoubleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 878 "pyscanner.l" +{ // start of a comment block + current->program+=pyscanYYtext; + initTriSingleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 62: +/* rule 62 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 2; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 884 "pyscanner.l" +{ // start of a special comment + initSpecialBlock(); + BEGIN(SpecialComment); + } + YY_BREAK + + +case 63: +YY_RULE_SETUP +#line 893 "pyscanner.l" +{ + //found function name + if (current->type.isEmpty()) + { + current->type = "def"; + } + current->name = pyscanYYtext; + current->name = current->name.stripWhiteSpace(); + newFunction(); + } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 903 "pyscanner.l" +{ // function without arguments + g_specialBlock = TRUE; // expecting a docstring + bodyEntry = current; + current->bodyLine = yyLineNr; + BEGIN( FunctionBody ); + } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 910 "pyscanner.l" +{ + BEGIN( FunctionParams ); + } + YY_BREAK + + +case 66: +YY_RULE_SETUP +#line 916 "pyscanner.l" +{ + } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 919 "pyscanner.l" +{ // Name of parameter + lineCount(); + Argument *a = new Argument; + current->argList->append(a); + current->argList->getLast()->name = QCString(pyscanYYtext).stripWhiteSpace(); + current->argList->getLast()->type = ""; + } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 926 "pyscanner.l" +{ // default value + // TODO: this rule is too simple, need to be able to + // match things like =")" as well! + QCString defVal=&pyscanYYtext[1]; + g_defVal.resize(0); + g_braceCount=0; + BEGIN(FunctionParamDefVal); + } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 935 "pyscanner.l" +{ // end of parameter list + } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 938 "pyscanner.l" +{ + g_specialBlock = TRUE; // expecting a docstring + bodyEntry = current; + current->bodyLine = yyLineNr; + BEGIN( FunctionBody ); + } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 944 "pyscanner.l" +{ // a comment + } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 946 "pyscanner.l" +{ // Default rule inside arguments. + } + YY_BREAK + + +case 73: +YY_RULE_SETUP +#line 952 "pyscanner.l" +{ // internal opening brace + g_braceCount++; + g_defVal+=*pyscanYYtext; + } + YY_BREAK +case 74: +#line 957 "pyscanner.l" +case 75: +YY_RULE_SETUP +#line 957 "pyscanner.l" +{ + if (g_braceCount==0) // end of default argument + { + if (current->argList->getLast()) + { + current->argList->getLast()->defval=g_defVal.stripWhiteSpace(); + } + BEGIN(FunctionParams); + } + else // continue + { + g_braceCount--; + g_defVal+=*pyscanYYtext; + } + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 972 "pyscanner.l" +{ + g_defVal+=*pyscanYYtext; + } + YY_BREAK +case 77: +/* rule 77 can match eol */ +YY_RULE_SETUP +#line 975 "pyscanner.l" +{ + g_defVal+=*pyscanYYtext; + incLineNr(); + } + YY_BREAK + + +case 78: +/* rule 78 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 1; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 983 "pyscanner.l" +{ // new def at indent 0 + incLineNr(); + endOfDef(); + //g_hideClassDocs = FALSE; + //YY_CURRENT_BUFFER->yy_at_bol=TRUE; + BEGIN(Search); + } + YY_BREAK +case 79: +/* rule 79 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 1; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 990 "pyscanner.l" +{ // start of a special comment at indent 0 + incLineNr(); + endOfDef(); + //g_hideClassDocs = FALSE; + //YY_CURRENT_BUFFER->yy_at_bol=TRUE; + BEGIN(Search); + } + YY_BREAK +case 80: +/* rule 80 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 997 "pyscanner.l" +{ // skip empty line + current->program+=pyscanYYtext; + } + YY_BREAK +case YY_STATE_EOF(ClassBody): +#line 1000 "pyscanner.l" +{ + endOfDef(); + yyterminate(); + } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 1004 "pyscanner.l" +{ // something at indent >0 + g_curIndent=computeIndent(pyscanYYtext); + //fprintf(stderr,"g_curIndent=%d g_indent=%d\n",g_curIndent,g_indent); + if (g_curIndent<=g_indent) + // jumped out of the class/method + { + endOfDef(1); + g_indent=g_curIndent; + // make sure the next rule matches ^... + //YY_CURRENT_BUFFER->yy_at_bol=TRUE; + //g_hideClassDocs = FALSE; + BEGIN(Search); + } + else + { + current->program+=pyscanYYtext; + } + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 1022 "pyscanner.l" +{ // start of a single quoted string + current->program+=*pyscanYYtext; + g_stringContext=YY_START; + g_specialBlock = FALSE; + g_copyString=¤t->program; + BEGIN( SingleQuoteString ); + } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 1029 "pyscanner.l" +{ // start of a double quoted string + current->program+=*pyscanYYtext; + g_stringContext=YY_START; + g_specialBlock = FALSE; + g_copyString=¤t->program; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 1036 "pyscanner.l" +{ // non-special stuff + current->program+=pyscanYYtext; + g_specialBlock = FALSE; + //g_hideClassDocs = FALSE; + } + YY_BREAK +case 85: +/* rule 85 can match eol */ +YY_RULE_SETUP +#line 1041 "pyscanner.l" +{ + current->program+=*pyscanYYtext; + incLineNr(); + } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 1045 "pyscanner.l" +{ // normal comment + current->program+=pyscanYYtext; + } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 1048 "pyscanner.l" +{ // any character + g_specialBlock = FALSE; + current->program+=*pyscanYYtext; + } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 1052 "pyscanner.l" +{ // start of a comment block + //if (!g_hideClassDocs) + current->program+=pyscanYYtext; + initTriDoubleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 1059 "pyscanner.l" +{ // start of a comment block + //if (!g_hideClassDocs) + current->program+=pyscanYYtext; + initTriSingleQuoteBlock(); + BEGIN(TripleComment); + } + YY_BREAK + +case 90: +YY_RULE_SETUP +#line 1067 "pyscanner.l" +{ + if (current->type.isEmpty()) + { + current->type = "class"; + } + + current->section = Entry::CLASS_SEC; + current->name = pyscanYYtext; + + // prepend scope in case of nested classes + if (current_root->section&Entry::SCOPE_MASK) + { + //printf("*** Prepending scope %s to class %s\n",current_root->name.data(),current->name.data()); + current->name.prepend(current_root->name+"::"); + } + + current->name = current->name.stripWhiteSpace(); + current->fileName = yyFileName; + docBlockContext = YY_START; + docBlockInBody = FALSE; + docBlockJavaStyle = FALSE; + docBlock.resize(0); + + BEGIN(ClassInheritance); + } + YY_BREAK + +case 91: +YY_RULE_SETUP +#line 1094 "pyscanner.l" +{ // syntactic sugar for the list + } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 1097 "pyscanner.l" +{ // begin of the class definition + g_specialBlock = TRUE; // expecting a docstring + current->bodyLine = yyLineNr; + current->program.resize(0); + BEGIN(ClassCaptureIndent); + } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 1104 "pyscanner.l" +{ + current->extends->append( + new BaseInfo(substitute(pyscanYYtext,".","::"),Public,Normal) + ); + //Has base class-do stuff + } + YY_BREAK + + +case 94: +/* rule 94 can match eol */ +YY_RULE_SETUP +#line 1114 "pyscanner.l" +{ + // Blankline - ignore, keep looking for indentation. + lineCount(); + current->program+=pyscanYYtext; + } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 1120 "pyscanner.l" +{ // start of a comment block + initTriDoubleQuoteBlock(); + current->program+=pyscanYYtext; + BEGIN(TripleComment); + } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 1126 "pyscanner.l" +{ // start of a comment block + initTriSingleQuoteBlock(); + current->program+=pyscanYYtext; + BEGIN(TripleComment); + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 1132 "pyscanner.l" +{ + current->program+=pyscanYYtext; + //current->startLine = yyLineNr; + g_curIndent=computeIndent(pyscanYYtext); + bodyEntry = current; + //fprintf(stderr,"setting indent %d\n",g_curIndent); + //printf("current->program=[%s]\n",current->program.data()); + //g_hideClassDocs = TRUE; + BEGIN(ClassBody); + } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 1143 "pyscanner.l" +{ + + // Just pushback an empty class, and + // resume parsing the body. + newEntry(); + current->program+=pyscanYYtext; + + // printf("Failed to find indent - skipping!"); + BEGIN( Search ); + } + YY_BREAK + + +case 99: +YY_RULE_SETUP +#line 1157 "pyscanner.l" +{ // the assignment operator + //printf("====== VariableDec at line %d\n",yyLineNr); + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 1160 "pyscanner.l" +{ // spaces + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 1162 "pyscanner.l" +{ // integer value + current->type = "int"; + current->initializer = pyscanYYtext; + BEGIN(VariableEnd); + } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 1167 "pyscanner.l" +{ // floating point value + current->type = "float"; + current->initializer = pyscanYYtext; + BEGIN(VariableEnd); + } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 1172 "pyscanner.l" +{ // string + current->type = "string"; + current->initializer = pyscanYYtext; + g_copyString=¤t->initializer; + g_stringContext=VariableEnd; + BEGIN( SingleQuoteString ); + } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 1179 "pyscanner.l" +{ // string + current->type = "string"; + current->initializer = pyscanYYtext; + g_copyString=¤t->initializer; + g_stringContext=VariableEnd; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 1186 "pyscanner.l" +{ // start of a comment block + current->type = "string"; + current->initializer = pyscanYYtext; + g_doubleQuote=TRUE; + g_copyString=¤t->initializer; + g_stringContext=VariableEnd; + BEGIN(TripleString); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 1195 "pyscanner.l" +{ // start of a comment block + current->type = "string"; + current->initializer = pyscanYYtext; + g_doubleQuote=FALSE; + g_copyString=¤t->initializer; + g_stringContext=VariableEnd; + BEGIN(TripleString); + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 1203 "pyscanner.l" +{ // tuple + if (current->mtype!=Property) + { + current->type = "tuple"; + } + current->initializer+=*pyscanYYtext; + g_atomStart='('; + g_atomEnd=')'; + g_atomCount=1; + BEGIN( VariableAtom ); + } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 1214 "pyscanner.l" +{ // list + current->type = "list"; + current->initializer+=*pyscanYYtext; + g_atomStart='['; + g_atomEnd=']'; + g_atomCount=1; + BEGIN( VariableAtom ); + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 1222 "pyscanner.l" +{ // dictionary + current->type = "dictionary"; + current->initializer+=*pyscanYYtext; + g_atomStart='{'; + g_atomEnd='}'; + g_atomCount=1; + BEGIN( VariableAtom ); + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 1230 "pyscanner.l" +{ // comment + BEGIN( VariableEnd ); + } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 1233 "pyscanner.l" +{ + current->initializer+=pyscanYYtext; + } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 1236 "pyscanner.l" +{ + current->initializer+=*pyscanYYtext; + } + YY_BREAK +case 113: +/* rule 113 can match eol */ +YY_RULE_SETUP +#line 1239 "pyscanner.l" +{ + unput('\n'); + BEGIN( VariableEnd ); + } + YY_BREAK + + +case 114: +YY_RULE_SETUP +#line 1246 "pyscanner.l" +{ + current->initializer+=*pyscanYYtext; + if (g_atomStart==*pyscanYYtext) + { + g_atomCount++; + } + } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 1253 "pyscanner.l" +{ + current->initializer+=*pyscanYYtext; + if (g_atomEnd==*pyscanYYtext) + { + g_atomCount--; + } + if (g_atomCount==0) + { + BEGIN(VariableEnd); + } + } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 1264 "pyscanner.l" +{ + g_stringContext=YY_START; + current->initializer+="\""; + g_copyString=¤t->initializer; + BEGIN( DoubleQuoteString ); + } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 1270 "pyscanner.l" +{ + current->initializer+=pyscanYYtext; + } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 1273 "pyscanner.l" +{ + current->initializer+=*pyscanYYtext; + } + YY_BREAK +case 119: +/* rule 119 can match eol */ +YY_RULE_SETUP +#line 1276 "pyscanner.l" +{ + current->initializer+=*pyscanYYtext; + incLineNr(); + } + YY_BREAK + + +case 120: +/* rule 120 can match eol */ +YY_RULE_SETUP +#line 1284 "pyscanner.l" +{ + incLineNr(); + newVariable(); + BEGIN(Search); + } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 1289 "pyscanner.l" +{ + unput(*pyscanYYtext); + newVariable(); + BEGIN(Search); + } + YY_BREAK +case YY_STATE_EOF(VariableEnd): +#line 1294 "pyscanner.l" +{ yyterminate(); + newEntry(); + } + YY_BREAK + + +case 122: +#line 1301 "pyscanner.l" +case 123: +YY_RULE_SETUP +#line 1301 "pyscanner.l" +{ + // printf("Expected module block %d special=%d\n",g_expectModuleDocs,g_specialBlock); + if (g_doubleQuote==(pyscanYYtext[0]=='"')) + { + if (g_specialBlock) // expecting a docstring + { + QCString actualDoc=docBlock; + if (!docBlockSpecial) // legacy unformatted docstring + { + actualDoc.prepend("\\verbatim "); + actualDoc.append("\\endverbatim "); + } + //printf("-------> current=%p bodyEntry=%p\n",current,bodyEntry); + handleCommentBlock(actualDoc, FALSE); + } + else if (g_packageCommentAllowed) // expecting module docs + { + QCString actualDoc=docBlock; + if (!docBlockSpecial) // legacy unformatted docstring + { + actualDoc.prepend("\\verbatim "); + actualDoc.append("\\endverbatim "); + } + actualDoc.prepend("\\namespace "+g_moduleScope+"\\_linebr "); + handleCommentBlock(actualDoc, FALSE); + } + if ((docBlockContext==ClassBody /*&& !g_hideClassDocs*/) || + docBlockContext==FunctionBody) + { + current->program+=docBlock; + current->program+=pyscanYYtext; + } + //if (g_hideClassDocs) + //{ + // current->startLine = yyLineNr; + //} + //g_hideClassDocs=FALSE; + BEGIN(docBlockContext); + } + else + { + docBlock += pyscanYYtext; + } + g_packageCommentAllowed = FALSE; + } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 1348 "pyscanner.l" +{ // leading whitespace + int indent = computeIndent(pyscanYYtext); + if (indent>=g_curIndent) + { // strip g_curIndent amount of whitespace + int i; + for (i=0;i<indent-g_curIndent;i++) docBlock+=' '; + //fprintf(stderr,"stripping indent %d\n",g_curIndent); + } + else + { + //fprintf(stderr,"not stripping: %d<%d\n",indent,g_curIndent); + docBlock += pyscanYYtext; + } + } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 1362 "pyscanner.l" +{ + docBlock += pyscanYYtext; + } + YY_BREAK +case 126: +/* rule 126 can match eol */ +YY_RULE_SETUP +#line 1365 "pyscanner.l" +{ + incLineNr(); + docBlock += pyscanYYtext; + } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 1369 "pyscanner.l" +{ + docBlock += pyscanYYtext; + } + YY_BREAK + + +case 128: +YY_RULE_SETUP +#line 1375 "pyscanner.l" +{ // skip leading hashes + } + YY_BREAK +case 129: +/* rule 129 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up pyscanYYtext */ +(yy_c_buf_p) = yy_cp = yy_bp + 1; +YY_DO_BEFORE_ACTION; /* set up pyscanYYtext again */ +YY_RULE_SETUP +#line 1377 "pyscanner.l" +{ // continuation of the comment on the next line + docBlock+='\n'; + docBrief = FALSE; + startCommentBlock(FALSE); + incLineNr(); + } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 1383 "pyscanner.l" +{ // any other stuff + docBlock+=pyscanYYtext; + } + YY_BREAK +case 131: +/* rule 131 can match eol */ +YY_RULE_SETUP +#line 1386 "pyscanner.l" +{ // new line that ends the comment + handleCommentBlock(docBlock, docBrief); + incLineNr(); + BEGIN(docBlockContext); + } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 1391 "pyscanner.l" +{ // anything we missed + docBlock+=*pyscanYYtext; + } + YY_BREAK + + +case 133: +/* rule 133 can match eol */ +YY_RULE_SETUP +#line 1397 "pyscanner.l" +{ // line continuation + addToString(pyscanYYtext); + incLineNr(); + } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 1401 "pyscanner.l" +{ // espaced char + addToString(pyscanYYtext); + } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 1404 "pyscanner.l" +{ // tripple double quotes + addToString(pyscanYYtext); + } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 1407 "pyscanner.l" +{ // end of the string + addToString(pyscanYYtext); + BEGIN(g_stringContext); + } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 1411 "pyscanner.l" +{ // normal chars + addToString(pyscanYYtext); + } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 1414 "pyscanner.l" +{ // normal char + addToString(pyscanYYtext); + } + YY_BREAK + + +case 139: +/* rule 139 can match eol */ +YY_RULE_SETUP +#line 1420 "pyscanner.l" +{ // line continuation + addToString(pyscanYYtext); + incLineNr(); + } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 1424 "pyscanner.l" +{ // espaced char + addToString(pyscanYYtext); + } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 1427 "pyscanner.l" +{ // tripple single quotes + addToString(pyscanYYtext); + } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 1430 "pyscanner.l" +{ // end of the string + addToString(pyscanYYtext); + BEGIN(g_stringContext); + } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 1434 "pyscanner.l" +{ // normal chars + addToString(pyscanYYtext); + } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 1437 "pyscanner.l" +{ // normal char + addToString(pyscanYYtext); + } + YY_BREAK + + +case 145: +#line 1444 "pyscanner.l" +case 146: +YY_RULE_SETUP +#line 1444 "pyscanner.l" +{ + *g_copyString += pyscanYYtext; + if (g_doubleQuote==(pyscanYYtext[0]=='"')) + { + BEGIN(g_stringContext); + } + } + YY_BREAK +case 147: +/* rule 147 can match eol */ +YY_RULE_SETUP +#line 1453 "pyscanner.l" +{ + lineCount(); + *g_copyString += pyscanYYtext; + } + YY_BREAK +case 148: +/* rule 148 can match eol */ +YY_RULE_SETUP +#line 1457 "pyscanner.l" +{ + incLineNr(); + *g_copyString += pyscanYYtext; + } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 1461 "pyscanner.l" +{ + *g_copyString += *pyscanYYtext; + } + YY_BREAK + +/* ------------ End rules -------------- */ +/* +<*>({NONEMPTY}|{EXPCHAR}|{BB}) { // This should go one character at a time. + // printf("[pyscanner] '%s' [ state %d ] [line %d] no match\n", + // pyscanYYtext, YY_START, yyLineNr); + + } + */ +case 150: +/* rule 150 can match eol */ +YY_RULE_SETUP +#line 1476 "pyscanner.l" +{ + //printf("[pyscanner] %d NEWLINE [line %d] no match\n", + // YY_START, yyLineNr); + + lineCount(); + } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 1483 "pyscanner.l" +{ + //printf("[pyscanner] '%s' [ state %d ] [line %d] no match\n", + // pyscanYYtext, YY_START, yyLineNr); + + } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 1490 "pyscanner.l" +ECHO; + YY_BREAK +#line 3459 "<stdout>" + case YY_STATE_EOF(INITIAL): + case YY_STATE_EOF(Search): + case YY_STATE_EOF(SearchMemVars): + case YY_STATE_EOF(TryClassDocString): + case YY_STATE_EOF(TripleComment): + case YY_STATE_EOF(SpecialComment): + case YY_STATE_EOF(FunctionDec): + case YY_STATE_EOF(FunctionParams): + case YY_STATE_EOF(FunctionParamDefVal): + case YY_STATE_EOF(ClassDec): + case YY_STATE_EOF(ClassInheritance): + case YY_STATE_EOF(ClassCaptureIndent): + case YY_STATE_EOF(VariableDec): + case YY_STATE_EOF(VariableAtom): + case YY_STATE_EOF(SingleQuoteString): + case YY_STATE_EOF(DoubleQuoteString): + case YY_STATE_EOF(TripleString): + case YY_STATE_EOF(FromMod): + case YY_STATE_EOF(FromModItem): + case YY_STATE_EOF(Import): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed pyscanYYin at a new source and called + * pyscanYYlex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = pyscanYYin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( pyscanYYwrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * pyscanYYtext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of pyscanYYlex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + pyscanYYrestart(pyscanYYin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) pyscanYYrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + (yy_state_ptr) = (yy_state_buf); + *(yy_state_ptr)++ = yy_current_state; + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 451 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *(yy_state_ptr)++ = yy_current_state; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 451 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 450); + if ( ! yy_is_jam ) + *(yy_state_ptr)++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up pyscanYYtext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + pyscanYYrestart(pyscanYYin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( pyscanYYwrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve pyscanYYtext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void pyscanYYrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + pyscanYYensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + pyscanYY_create_buffer(pyscanYYin,YY_BUF_SIZE ); + } + + pyscanYY_init_buffer(YY_CURRENT_BUFFER,input_file ); + pyscanYY_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void pyscanYY_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * pyscanYYpop_buffer_state(); + * pyscanYYpush_buffer_state(new_buffer); + */ + pyscanYYensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + pyscanYY_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (pyscanYYwrap()) processing, but the only time this flag + * is looked at is after pyscanYYwrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void pyscanYY_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + pyscanYYin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE pyscanYY_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) pyscanYYalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYY_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) pyscanYYalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYY_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + pyscanYY_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with pyscanYY_create_buffer() + * + */ + void pyscanYY_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + pyscanYYfree((void *) b->yy_ch_buf ); + + pyscanYYfree((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a pyscanYYrestart() or at EOF. + */ + static void pyscanYY_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + pyscanYY_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then pyscanYY_init_buffer was _probably_ + * called from pyscanYYrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void pyscanYY_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + pyscanYY_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void pyscanYYpush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + pyscanYYensure_buffer_stack(); + + /* This block is copied from pyscanYY_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from pyscanYY_switch_to_buffer. */ + pyscanYY_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void pyscanYYpop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + pyscanYY_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + pyscanYY_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void pyscanYYensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)pyscanYYalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYYensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)pyscanYYrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYYensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE pyscanYY_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) pyscanYYalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYY_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + pyscanYY_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to pyscanYYlex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * pyscanYY_scan_bytes() instead. + */ +YY_BUFFER_STATE pyscanYY_scan_string (yyconst char * yystr ) +{ + + return pyscanYY_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to pyscanYYlex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE pyscanYY_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n, i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) pyscanYYalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in pyscanYY_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = pyscanYY_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in pyscanYY_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up pyscanYYtext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + pyscanYYtext[pyscanYYleng] = (yy_hold_char); \ + (yy_c_buf_p) = pyscanYYtext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + pyscanYYleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int pyscanYYget_lineno (void) +{ + + return pyscanYYlineno; +} + +/** Get the input stream. + * + */ +FILE *pyscanYYget_in (void) +{ + return pyscanYYin; +} + +/** Get the output stream. + * + */ +FILE *pyscanYYget_out (void) +{ + return pyscanYYout; +} + +/** Get the length of the current token. + * + */ +yy_size_t pyscanYYget_leng (void) +{ + return pyscanYYleng; +} + +/** Get the current token. + * + */ + +char *pyscanYYget_text (void) +{ + return pyscanYYtext; +} + +/** Set the current line number. + * @param line_number + * + */ +void pyscanYYset_lineno (int line_number ) +{ + + pyscanYYlineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see pyscanYY_switch_to_buffer + */ +void pyscanYYset_in (FILE * in_str ) +{ + pyscanYYin = in_str ; +} + +void pyscanYYset_out (FILE * out_str ) +{ + pyscanYYout = out_str ; +} + +int pyscanYYget_debug (void) +{ + return pyscanYY_flex_debug; +} + +void pyscanYYset_debug (int bdebug ) +{ + pyscanYY_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from pyscanYYlex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + + (yy_state_buf) = 0; + (yy_state_ptr) = 0; + (yy_full_match) = 0; + (yy_lp) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + pyscanYYin = stdin; + pyscanYYout = stdout; +#else + pyscanYYin = (FILE *) 0; + pyscanYYout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * pyscanYYlex_init() + */ + return 0; +} + +/* pyscanYYlex_destroy is for both reentrant and non-reentrant scanners. */ +int pyscanYYlex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + pyscanYY_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + pyscanYYpop_buffer_state(); + } + + /* Destroy the stack itself. */ + pyscanYYfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + pyscanYYfree ( (yy_state_buf) ); + (yy_state_buf) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * pyscanYYlex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *pyscanYYalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *pyscanYYrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void pyscanYYfree (void * ptr ) +{ + free( (char *) ptr ); /* see pyscanYYrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 1490 "pyscanner.l" + + + +//---------------------------------------------------------------------------- + +static void parseCompounds(Entry *rt) +{ + //printf("parseCompounds(%s)\n",rt->name.data()); + EntryListIterator eli(*rt->children()); + Entry *ce; + for (;(ce=eli.current());++eli) + { + if (!ce->program.isEmpty()) + { + //printf("-- %s ---------\n%s\n---------------\n", + // ce->name.data(),ce->program.data()); + // init scanner state + inputString = ce->program; + inputPosition = 0; + pyscanYYrestart( pyscanYYin ) ; + if (ce->section&Entry::COMPOUND_MASK) + { + current_root = ce ; + BEGIN( Search ); + } + else if (ce->parent()) + { + current_root = ce->parent(); + //printf("Searching for member variables in %s parent=%s\n", + // ce->name.data(),ce->parent->name.data()); + BEGIN( SearchMemVars ); + } + yyFileName = ce->fileName; + yyLineNr = ce->bodyLine ; + if (current) delete current; + current = new Entry; + initEntry(); + + groupEnterCompound(yyFileName,yyLineNr,ce->name); + + pyscanYYlex() ; + g_lexInit=TRUE; + delete current; current=0; + ce->program.resize(0); + + groupLeaveCompound(yyFileName,yyLineNr,ce->name); + + } + parseCompounds(ce); + } +} + +//---------------------------------------------------------------------------- + + +static void parseMain(const char *fileName,const char *fileBuf,Entry *rt) +{ + initParser(); + + inputString = fileBuf; + inputPosition = 0; + + protection = Public; + mtype = Method; + gstat = FALSE; + virt = Normal; + current_root = rt; + g_specialBlock = FALSE; + + + inputFile.setName(fileName); + if (inputFile.open(IO_ReadOnly)) + { + yyLineNr= 1 ; + yyFileName = fileName; + //setContext(); + msg("Parsing file %s...\n",yyFileName.data()); + + QFileInfo fi(fileName); + g_moduleScope = findPackageScope(fileName); + QCString baseName=fi.baseName().utf8(); + if (baseName!="__init__") // package initializer file is not a package itself + { + if (!g_moduleScope.isEmpty()) + { + g_moduleScope+="::"; + } + g_moduleScope+=baseName; + } + + current = new Entry; + initEntry(); + current->name = g_moduleScope; + current->section = Entry::NAMESPACE_SEC; + current->type = "namespace"; + current->fileName = yyFileName; + current->startLine = yyLineNr; + current->bodyLine = yyLineNr; + + rt->addSubEntry(current); + + current_root = current ; + initParser(); + current = new Entry; + + groupEnterFile(yyFileName,yyLineNr); + + current->reset(); + initEntry(); + pyscanYYrestart( pyscanYYin ); + BEGIN( Search ); + pyscanYYlex(); + g_lexInit=TRUE; + + groupLeaveFile(yyFileName,yyLineNr); + + current_root->program.resize(0); + delete current; current=0; + + parseCompounds(current_root); + + inputFile.close(); + } + +} + +//---------------------------------------------------------------------------- + +static void parsePrototype(const QCString &text) +{ + //printf("**** parsePrototype(%s) begin\n",text.data()); + if (text.isEmpty()) + { + warn(yyFileName,yyLineNr,"Empty prototype found!"); + return; + } + + g_specialBlock = FALSE; + g_packageCommentAllowed = FALSE; + + const char *orgInputString; + int orgInputPosition; + YY_BUFFER_STATE orgState; + + // save scanner state + orgState = YY_CURRENT_BUFFER; + pyscanYY_switch_to_buffer(pyscanYY_create_buffer(pyscanYYin,YY_BUF_SIZE)); + orgInputString = inputString; + orgInputPosition = inputPosition; + + // set new string + inputString = text; + inputPosition = 0; + pyscanYYrestart( pyscanYYin ); + + BEGIN( FunctionDec ); + + pyscanYYlex(); + g_lexInit=TRUE; + + current->name = current->name.stripWhiteSpace(); + if (current->section == Entry::MEMBERDOC_SEC && current->args.isEmpty()) + current->section = Entry::VARIABLEDOC_SEC; + + // restore original scanner state + + YY_BUFFER_STATE tmpBuf = YY_CURRENT_BUFFER; + pyscanYY_switch_to_buffer(orgState); + pyscanYY_delete_buffer(tmpBuf); + + inputString = orgInputString; + inputPosition = orgInputPosition; + + //printf("**** parsePrototype end\n"); +} + +void pyscanFreeScanner() +{ +#if defined(YY_FLEX_SUBMINOR_VERSION) + if (g_lexInit) + { + pyscanYYlex_destroy(); + } +#endif +} + +//---------------------------------------------------------------------------- + +void PythonLanguageScanner::parseInput(const char *fileName,const char *fileBuf,Entry *root) +{ + g_thisParser = this; + ::parseMain(fileName,fileBuf,root); + + // May print the AST for debugging purposes + // printAST(global_root); +} + +bool PythonLanguageScanner::needsPreprocessing(const QCString &) +{ + return FALSE; +} + +void PythonLanguageScanner::parseCode(CodeOutputInterface &codeOutIntf, + const char *scopeName, + const QCString &input, + bool isExampleBlock, + const char *exampleName, + FileDef *fileDef, + int startLine, + int endLine, + bool inlineFragment, + MemberDef *memberDef, + bool showLineNumbers, + Definition *searchCtx + ) +{ + ::parsePythonCode(codeOutIntf,scopeName,input,isExampleBlock,exampleName, + fileDef,startLine,endLine,inlineFragment,memberDef, + showLineNumbers,searchCtx); +} + +void PythonLanguageScanner::parsePrototype(const char *text) +{ + ::parsePrototype(text); + +} + +void PythonLanguageScanner::resetCodeParserState() +{ + ::resetPythonCodeParserState(); +} + +//---------------------------------------------------------------------------- + +#if !defined(YY_FLEX_SUBMINOR_VERSION) +//---------------------------------------------------------------------------- +extern "C" { // some bogus code to keep the compiler happy + void pyscannerYYdummy() { yy_flex_realloc(0,0); } +} +#endif + + |