diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 1999-12-15 19:37:58 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 1999-12-15 19:37:58 (GMT) |
commit | 916d6d5c6f6c9d14c4c9a636582671c81447f54a (patch) | |
tree | b859924ab8503fed25bbfbc7ea96b72b9dee34b0 /src/pre.cpp | |
parent | a54eecdf4b3c961ff41bc5d3ea6f21713e08f903 (diff) | |
download | Doxygen-916d6d5c6f6c9d14c4c9a636582671c81447f54a.zip Doxygen-916d6d5c6f6c9d14c4c9a636582671c81447f54a.tar.gz Doxygen-916d6d5c6f6c9d14c4c9a636582671c81447f54a.tar.bz2 |
mods for doxygen-0.49-991106
Diffstat (limited to 'src/pre.cpp')
-rw-r--r-- | src/pre.cpp | 4468 |
1 files changed, 4468 insertions, 0 deletions
diff --git a/src/pre.cpp b/src/pre.cpp new file mode 100644 index 0000000..b29e73f --- /dev/null +++ b/src/pre.cpp @@ -0,0 +1,4468 @@ +#define yy_create_buffer preYY_create_buffer +#define yy_delete_buffer preYY_delete_buffer +#define yy_scan_buffer preYY_scan_buffer +#define yy_scan_string preYY_scan_string +#define yy_scan_bytes preYY_scan_bytes +#define yy_flex_debug preYY_flex_debug +#define yy_init_buffer preYY_init_buffer +#define yy_flush_buffer preYY_flush_buffer +#define yy_load_buffer_state preYY_load_buffer_state +#define yy_switch_to_buffer preYY_switch_to_buffer +#define yyin preYYin +#define yyleng preYYleng +#define yylex preYYlex +#define yyout preYYout +#define yyrestart preYYrestart +#define yytext preYYtext + +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#include <unistd.h> + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#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 yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +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. + */ + int 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; + + /* 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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* 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". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 118 +#define YY_END_OF_BUFFER 119 +static yyconst short int yy_acclist[768] = + { 0, + 101, 101, 119, 117, 118, 1, 117, 118, 116, 118, + 3, 117, 118, 117, 118, 2, 117, 118, 5, 117, + 118, 1, 5, 117, 118, 5, 117, 118, 5, 116, + 118, 3, 5, 117, 118, 4, 117, 118, 5, 117, + 118, 2, 5, 117, 118, 36, 117, 118, 1, 36, + 117, 118, 33, 116, 118, 3, 36, 117, 118, 36, + 117, 118, 34, 36, 117, 118, 34, 36, 117, 118, + 34, 36, 117, 118, 34, 36, 117, 118, 34, 36, + 117, 118, 2, 36, 117, 118, 58, 117, 118, 1, + 58, 117, 118, 56, 116, 118, 3, 58, 117, 118, + + 58, 117, 118, 57, 58, 117, 118, 57, 58, 117, + 118, 57, 58, 117, 118, 2, 58, 117, 118, 59, + 60, 117, 118, 1, 59, 60, 117, 118, 63, 116, + 118, 3, 59, 60, 117, 118, 60, 117, 118, 2, + 59, 60, 117, 118, 8, 117, 118, 1, 8, 117, + 118, 9, 116, 118, 3, 8, 117, 118, 8, 117, + 118, 7, 8, 117, 118,16390, 2, 8, 117, 118, + 117, 118, 1, 117, 118, 3, 117, 118, 117, 118, + 2, 117, 118, 65, 117, 118, 8260, 117, 118,16452, + 16453, 117, 118, 71, 117, 118, 72, 117, 118, 70, + + 117, 118, 73, 117, 118, 113, 117, 118, 1, 113, + 117, 118, 101, 113, 117, 118, 100, 116, 118, 3, + 113, 117, 118, 104, 113, 117, 118, 97, 113, 117, + 118, 105, 113, 117, 118, 113, 117, 118, 103, 113, + 117, 118, 98, 113, 117, 118, 113, 117, 118, 2, + 113, 117, 118, 51, 117, 118, 1, 51, 117, 118, + 3, 51, 117, 118, 51, 117, 118, 2, 51, 117, + 118, 50, 51, 117, 118, 1, 50, 51, 117, 118, + 50, 51, 117, 118, 50, 116, 118, 3, 50, 51, + 117, 118, 49, 51, 117, 118, 50, 51, 117, 118, + + 2, 50, 51, 117, 118, 79, 81, 117, 118, 1, + 79, 81, 117, 118, 80, 116, 118, 3, 79, 81, + 117, 118, 81, 117, 118, 79, 81, 117, 118, 2, + 79, 81, 117, 118, 91, 92, 117, 118, 1, 91, + 92, 117, 118, 88, 116, 118, 3, 91, 92, 117, + 118, 91, 92, 117, 118, 2, 91, 92, 117, 118, + 85, 87, 117, 118, 1, 85, 87, 117, 118, 86, + 116, 118, 3, 85, 87, 117, 118, 87, 117, 118, + 85, 87, 117, 118, 2, 85, 87, 117, 118, 95, + 96, 117, 118, 1, 95, 96, 117, 118, 3, 95, + + 96, 117, 118, 95, 96, 117, 118, 2, 95, 96, + 117, 118, 41, 117, 118, 1, 41, 117, 118, 42, + 116, 118, 3, 41, 117, 118, 41, 117, 118, 41, + 117, 118, 41, 117, 118, 2, 41, 117, 118, 48, + 117, 118, 1, 48, 117, 118, 46, 116, 118, 3, + 48, 117, 118, 48, 117, 118, 44, 48, 117, 118, + 48, 117, 118, 2, 48, 117, 118, 47, 48, 117, + 118, 45, 48, 117, 118, 111, 117, 118, 1, 111, + 117, 118, 3, 111, 117, 118, 108, 111, 117, 118, + 111, 117, 118, 111, 117, 118, 2, 111, 117, 118, + + 112, 117, 118, 1, 112, 117, 118, 3, 112, 117, + 118, 110, 112, 117, 118, 112, 117, 118, 112, 117, + 118, 2, 112, 117, 118, 37, 117, 118, 35, 117, + 118, 1, 35, 117, 118, 3, 35, 117, 118, 35, + 117, 118, 2, 35, 117, 118, 15, 117, 118, 1, + 15, 117, 118, 13, 116, 118, 3, 15, 117, 118, + 12, 15, 117, 118, 10, 15, 117, 118, 11, 15, + 117, 118, 15, 117, 118, 14, 15, 117, 118, 2, + 15, 117, 118, 19, 117, 118, 1, 19, 117, 118, + 3, 19, 117, 118, 17, 19, 117, 118, 19, 117, + + 118, 19, 117, 118, 2, 19, 117, 118, 114, 115, + 5, 5, 4, 34, 34, 34, 34, 34, 34, 34, + 62, 114, 61, 115, 57, 57, 57, 57, 59, 8198, + 7,16390, 66, 114, 115, 64, 65, 8260, 8261, 67, + 8260,16452,16453, 72, 71, 72, 70, 73, 101, 102, + 74, 114, 75, 115, 98, 99, 50, 50, 49, 79, + 76, 78, 114, 77, 79, 115, 91, 89, 91, 114, + 90, 91, 115, 85, 82, 84, 114, 83, 85, 115, + 95, 93, 95, 114, 94, 95, 115, 38, 44, 43, + 45, 107, 114, 106, 115, 109, 37, 18, 114, 18, + + 115, 16, 34, 34, 34, 34, 27, 34, 34, 34, + 34, 57, 57, 57, 52, 57, 57, 102, 34, 34, + 34, 34, 34, 34, 34, 34, 57, 53, 57, 57, + 57, 73, 34, 28, 31, 29, 34, 34, 34, 34, + 34, 54, 55, 57, 57, 34, 32, 24, 23, 34, + 34, 30, 22, 26, 25, 34,16404,16404, 21, 8212, + 34, 40, 39, 8212, 8212, 34, 8212 + } ; + +static yyconst short int yy_accept[364] = + { 0, + 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, 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, 6, 9, 11, 14, + 16, 19, 22, 26, 29, 32, 36, 39, 42, 46, + 49, 53, 56, 60, 63, 67, 71, 75, 79, 83, + 87, 90, 94, 97, 101, 104, 108, 112, 116, 120, + 124, 129, 132, 137, 140, 145, 148, 152, 155, 159, + + 162, 167, 171, 173, 176, 179, 181, 184, 187, 192, + 194, 197, 200, 203, 206, 209, 213, 217, 220, 224, + 228, 232, 236, 239, 243, 247, 250, 254, 257, 261, + 265, 268, 272, 276, 281, 285, 288, 293, 297, 301, + 306, 310, 315, 318, 323, 326, 330, 335, 339, 344, + 347, 352, 356, 361, 365, 370, 373, 378, 381, 385, + 390, 394, 399, 404, 408, 413, 416, 420, 423, 427, + 430, 433, 436, 440, 443, 447, 450, 454, 457, 461, + 464, 468, 472, 476, 479, 483, 487, 491, 494, 497, + 501, 504, 508, 512, 516, 519, 522, 526, 529, 532, + + 536, 540, 543, 547, 550, 554, 557, 561, 565, 569, + 573, 576, 580, 584, 587, 591, 595, 599, 602, 605, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 623, 625, 626, 627, 628, 629, 630, + 630, 631, 633, 633, 634, 635, 636, 636, 637, 638, + 639, 640, 641, 644, 644, 645, 646, 647, 648, 648, + 649, 650, 650, 651, 653, 655, 656, 657, 658, 659, + 660, 661, 662, 664, 667, 668, 671, 674, 675, 676, + 678, 681, 682, 685, 688, 689, 689, 690, 691, 692, + 694, 696, 697, 698, 700, 702, 703, 704, 705, 706, + + 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 718, 719, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 730, 731, 732, 733, 733, 734, + 736, 737, 738, 739, 740, 741, 742, 743, 745, 746, + 746, 747, 748, 749, 750, 751, 752, 753, 753, 754, + 755, 756, 758, 758, 759, 760, 762, 763, 764, 765, + 767, 768, 768 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 2, 1, 1, 3, 4, + 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 6, 7, 1, 1, 1, 8, 9, + 10, 11, 1, 12, 1, 13, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 1, 1, 16, + 1, 17, 1, 18, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 1, 20, 1, 1, 19, 1, 19, 19, 21, 22, + + 23, 24, 19, 19, 25, 19, 19, 26, 19, 27, + 19, 19, 19, 19, 28, 19, 29, 19, 19, 19, + 19, 19, 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, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[31] = + { 0, + 1, 1, 2, 3, 4, 5, 1, 1, 6, 1, + 7, 1, 8, 9, 10, 5, 1, 1, 11, 1, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 1 + } ; + +static yyconst short int yy_base[404] = + { 0, + 0, 29, 58, 87, 117, 0, 147, 0, 176, 205, + 235, 0, 264, 293, 322, 0, 334, 0, 361, 0, + 390, 0, 419, 448, 477, 506, 535, 564, 593, 622, + 651, 680, 709, 738, 767, 796, 825, 854, 884, 0, + 905, 0, 933, 962, 991, 1020, 1032, 0, 1060, 1089, + 1118, 1147, 1176, 1205, 374, 1633, 1633, 1633, 1633, 1, + 1633, 1633, 1633, 0, 1633, 1633, 1633, 2, 1633, 1633, + 1633, 1633, 1633, 6, 0, 349, 0, 1, 342, 1633, + 1633, 1633, 1633, 1633, 7, 0, 9, 344, 1633, 0, + 0, 1633, 0, 8, 0, 1633, 1633, 1633, 1633, 18, + + 35, 1633, 31, 35, 36, 40, 39, 46, 61, 58, + 364, 363, 362, 341, 1633, 1633, 3, 1633, 1633, 1633, + 335, 1633, 36, 1633, 0, 336, 1633, 1633, 1633, 1633, + 55, 1633, 1633, 1633, 64, 1633, 1633, 1633, 62, 1633, + 0, 0, 1633, 0, 325, 63, 0, 0, 0, 1633, + 0, 64, 0, 0, 0, 1633, 0, 324, 68, 0, + 0, 0, 0, 69, 0, 1633, 1633, 1633, 1633, 70, + 333, 312, 1633, 1633, 1633, 1633, 1633, 82, 0, 330, + 1633, 1633, 0, 1633, 1633, 1633, 1633, 84, 0, 1633, + 1633, 1633, 1633, 1633, 86, 0, 1633, 0, 1633, 1633, + + 1633, 88, 1633, 1633, 1633, 1633, 1633, 1633, 1633, 1633, + 92, 1633, 1633, 1633, 1633, 1633, 1633, 93, 327, 1633, + 1633, 1633, 1633, 102, 1633, 0, 308, 83, 309, 176, + 309, 307, 1633, 1633, 0, 85, 306, 186, 0, 179, + 1633, 188, 188, 1633, 194, 195, 193, 1633, 211, 5, + 1633, 1633, 212, 214, 322, 319, 318, 317, 306, 305, + 109, 310, 313, 1633, 1633, 0, 1633, 1633, 215, 1633, + 0, 1633, 1633, 0, 0, 0, 0, 0, 1633, 1633, + 0, 0, 0, 0, 1633, 291, 0, 1633, 0, 1633, + 1633, 1633, 0, 1633, 1633, 1633, 289, 289, 289, 286, + + 1633, 286, 286, 280, 282, 280, 280, 277, 1633, 278, + 278, 283, 290, 267, 264, 220, 1221, 266, 263, 263, + 254, 206, 222, 0, 180, 175, 1633, 160, 163, 1633, + 1633, 1236, 223, 91, 92, 84, 1633, 0, 224, 63, + 82, 1633, 225, 1633, 264, 35, 21, 1, 8, 268, + 1633, 269, 271, 273, 1633, 0, 279, 1633, 0, 0, + 0, 1633, 1265, 1276, 1287, 1298, 1309, 1320, 1331, 1342, + 1353, 1364, 1375, 1386, 1397, 1408, 1419, 1430, 1441, 1443, + 1445, 1456, 1466, 1477, 1487, 1497, 1501, 1503, 1514, 1525, + 1536, 1547, 1558, 1560, 1562, 1573, 1575, 1586, 1597, 1607, + + 1617, 1619, 1621 + } ; + +static yyconst short int yy_def[404] = + { 0, + 363, 363, 363, 364, 362, 5, 362, 7, 365, 365, + 362, 11, 366, 366, 363, 15, 15, 17, 17, 19, + 362, 21, 367, 368, 363, 363, 363, 363, 369, 369, + 370, 370, 371, 371, 372, 372, 373, 373, 362, 39, + 39, 41, 374, 374, 375, 375, 17, 47, 376, 376, + 377, 377, 378, 378, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 379, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 380, 380, 380, 380, 380, 362, + 362, 362, 362, 362, 362, 381, 381, 381, 362, 382, + 382, 362, 382, 362, 382, 362, 362, 362, 362, 362, + + 383, 362, 384, 384, 384, 384, 384, 385, 386, 362, + 362, 362, 362, 387, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 388, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 389, 362, 362, 362, 362, 362, + 390, 390, 362, 390, 362, 390, 390, 391, 391, 362, + 391, 391, 391, 392, 392, 362, 392, 362, 392, 392, + 393, 393, 393, 393, 393, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 394, 362, + 362, 362, 395, 362, 362, 362, 362, 362, 396, 362, + 362, 362, 362, 362, 362, 396, 362, 397, 362, 362, + + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 379, 362, 380, 380, 380, 380, 380, + 380, 380, 362, 362, 381, 381, 381, 381, 382, 362, + 362, 383, 384, 362, 384, 384, 362, 362, 385, 362, + 362, 362, 386, 362, 362, 362, 362, 362, 362, 387, + 362, 362, 362, 362, 362, 388, 362, 362, 389, 362, + 390, 362, 362, 390, 391, 391, 391, 392, 362, 362, + 392, 393, 393, 393, 362, 362, 394, 362, 395, 362, + 362, 362, 397, 362, 362, 362, 380, 380, 380, 380, + + 362, 380, 380, 380, 380, 381, 381, 381, 362, 381, + 381, 362, 362, 362, 380, 380, 398, 380, 380, 380, + 380, 380, 381, 381, 381, 381, 362, 362, 380, 362, + 362, 399, 380, 380, 380, 380, 362, 381, 381, 362, + 380, 362, 362, 362, 380, 380, 362, 362, 362, 362, + 362, 400, 362, 401, 362, 402, 362, 362, 403, 402, + 403, 0, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + + 362, 362, 362 + } ; + +static yyconst short int yy_nxt[1664] = + { 0, + 362, 57, 224, 58, 59, 261, 225, 250, 251, 262, + 349, 221, 221, 60, 222, 222, 221, 233, 233, 222, + 234, 234, 353, 347, 230, 228, 229, 231, 221, 61, + 57, 222, 58, 59, 236, 237, 244, 240, 240, 240, + 244, 244, 60, 241, 244, 244, 264, 244, 247, 265, + 245, 244, 244, 246, 248, 244, 244, 352, 61, 57, + 254, 58, 59, 250, 251, 233, 269, 255, 234, 252, + 270, 60, 233, 273, 276, 234, 274, 277, 280, 283, + 221, 281, 284, 222, 349, 348, 347, 61, 63, 64, + 65, 66, 221, 67, 290, 222, 221, 291, 221, 222, + + 68, 222, 221, 294, 224, 222, 295, 298, 225, 306, + 299, 261, 307, 346, 345, 262, 69, 70, 71, 70, + 72, 73, 70, 70, 70, 70, 70, 70, 70, 70, + 74, 70, 70, 70, 70, 75, 70, 75, 76, 77, + 75, 78, 75, 75, 75, 79, 80, 81, 82, 81, + 83, 84, 81, 81, 81, 81, 81, 81, 81, 81, + 85, 81, 81, 81, 81, 86, 81, 86, 86, 87, + 86, 88, 86, 86, 86, 86, 89, 91, 301, 92, + 93, 240, 240, 240, 301, 341, 340, 241, 309, 94, + 240, 240, 240, 244, 309, 247, 241, 302, 339, 244, + + 244, 248, 303, 338, 244, 95, 91, 310, 92, 93, + 244, 244, 311, 247, 250, 251, 254, 269, 94, 248, + 252, 270, 330, 255, 337, 343, 309, 343, 330, 336, + 337, 344, 309, 344, 95, 96, 97, 96, 98, 99, + 96, 96, 96, 96, 96, 96, 96, 96, 100, 96, + 96, 96, 96, 101, 96, 101, 101, 101, 101, 101, + 101, 101, 101, 101, 102, 104, 350, 58, 105, 56, + 350, 354, 351, 357, 355, 354, 351, 106, 355, 358, + 56, 357, 335, 226, 355, 334, 333, 358, 355, 332, + 329, 328, 313, 107, 104, 327, 58, 105, 56, 310, + + 326, 325, 324, 323, 322, 321, 106, 320, 319, 56, + 318, 317, 316, 315, 314, 313, 263, 259, 312, 258, + 257, 256, 107, 57, 257, 58, 59, 308, 305, 304, + 300, 297, 296, 288, 286, 60, 285, 279, 272, 267, + 108, 263, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 61, 109, 259, 109, 109, 109, 109, 109, 109, + 109, 109, 109, 110, 258, 257, 256, 238, 232, 111, + 112, 227, 113, 362, 362, 362, 362, 362, 362, 114, + 362, 114, 114, 114, 114, 114, 114, 114, 114, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 115, 115, + + 115, 115, 115, 123, 115, 115, 115, 124, 125, 126, + 125, 125, 125, 125, 125, 125, 125, 125, 125, 127, + 129, 362, 58, 130, 362, 362, 362, 362, 362, 362, + 362, 362, 131, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 132, 134, + 135, 136, 137, 362, 138, 362, 362, 362, 362, 362, + 362, 139, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 140, 57, 362, + 58, 59, 362, 362, 362, 362, 362, 362, 362, 362, + 60, 362, 362, 362, 362, 362, 362, 362, 362, 362, + + 362, 362, 362, 362, 362, 362, 61, 57, 362, 58, + 59, 362, 362, 362, 362, 362, 362, 362, 362, 60, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 61, 57, 362, 58, 59, + 362, 362, 362, 362, 362, 362, 362, 362, 60, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 61, 57, 362, 58, 59, 362, + 362, 362, 362, 362, 362, 362, 362, 60, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 61, 142, 362, 143, 144, 362, 362, + + 362, 362, 362, 145, 362, 362, 146, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 147, 142, 362, 143, 144, 362, 362, 362, + 362, 362, 145, 362, 362, 146, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 147, 149, 362, 150, 151, 362, 362, 362, 362, + 362, 362, 362, 362, 152, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 153, 149, 362, 150, 151, 362, 362, 362, 362, 362, + 362, 362, 362, 152, 362, 362, 362, 362, 362, 362, + + 362, 362, 362, 362, 362, 362, 362, 362, 362, 153, + 155, 362, 156, 157, 362, 362, 362, 362, 362, 158, + 362, 362, 159, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 160, 155, + 362, 156, 157, 362, 362, 362, 362, 362, 158, 362, + 362, 159, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 160, 162, 362, + 150, 163, 362, 362, 362, 362, 362, 362, 362, 362, + 164, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 165, 162, 362, 150, + + 163, 362, 362, 362, 362, 362, 362, 362, 362, 164, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 165, 167, 362, 168, 169, + 362, 362, 362, 362, 362, 362, 362, 362, 170, 362, + 362, 362, 362, 362, 171, 362, 172, 362, 362, 362, + 362, 362, 362, 362, 173, 167, 362, 168, 169, 362, + 362, 362, 362, 362, 362, 362, 362, 170, 362, 362, + 362, 362, 362, 171, 362, 172, 362, 362, 362, 362, + 362, 362, 362, 173, 174, 175, 174, 176, 177, 174, + 174, 174, 174, 174, 174, 174, 174, 178, 174, 174, + + 174, 174, 179, 180, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 181, 182, 362, 362, 362, 362, 362, + 362, 362, 362, 183, 362, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 185, 362, 58, 186, 187, 362, + 362, 362, 362, 362, 362, 362, 188, 362, 362, 362, + 362, 362, 189, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 190, 185, 362, 58, 186, 187, 362, 362, + 362, 362, 362, 362, 362, 188, 362, 362, 362, 362, + 362, 189, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 190, 192, 362, 58, 193, 362, 362, 194, 362, + + 362, 362, 362, 362, 195, 362, 362, 362, 362, 362, + 196, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 197, 192, 362, 58, 193, 362, 362, 194, 362, 362, + 362, 362, 362, 195, 362, 362, 362, 362, 362, 196, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 197, + 198, 362, 198, 198, 198, 198, 198, 198, 198, 198, + 198, 200, 362, 72, 201, 362, 362, 362, 362, 362, + 362, 362, 362, 202, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 203, + 200, 362, 72, 201, 362, 362, 362, 362, 362, 362, + + 362, 362, 202, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 203, 205, + 362, 206, 207, 208, 362, 362, 209, 210, 362, 362, + 362, 211, 362, 362, 362, 212, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 213, 205, 362, + 206, 207, 208, 362, 362, 209, 210, 362, 362, 362, + 211, 362, 362, 362, 212, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 213, 215, 362, 58, + 216, 217, 362, 362, 362, 362, 362, 362, 362, 218, + 362, 362, 362, 362, 362, 219, 362, 362, 362, 362, + + 362, 362, 362, 362, 362, 220, 215, 362, 58, 216, + 217, 362, 362, 362, 362, 362, 362, 362, 218, 362, + 362, 362, 362, 362, 219, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 220, 226, 362, 362, 362, 226, + 362, 226, 226, 226, 226, 226, 226, 226, 226, 226, + 226, 362, 362, 362, 226, 362, 226, 226, 226, 226, + 226, 226, 226, 226, 226, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 90, 90, 103, 103, + + 103, 103, 103, 103, 103, 103, 103, 103, 103, 128, + 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, + 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 141, 141, 141, 141, 141, 141, 141, 141, 141, + 141, 141, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 154, 154, 154, 154, 154, 154, 154, + 154, 154, 154, 154, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 191, 191, 191, + + 191, 191, 191, 191, 191, 191, 191, 191, 199, 199, + 199, 199, 199, 199, 199, 199, 199, 199, 199, 204, + 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 223, 223, 223, 223, 223, 223, 223, 223, 223, + 223, 223, 226, 226, 235, 235, 239, 239, 362, 239, + 239, 239, 239, 239, 362, 239, 239, 242, 242, 242, + 362, 242, 362, 362, 362, 242, 242, 243, 243, 362, + 243, 243, 243, 243, 243, 243, 243, 243, 249, 362, + 362, 362, 249, 362, 362, 362, 249, 249, 253, 253, + + 362, 362, 253, 362, 362, 362, 253, 253, 260, 362, + 260, 260, 266, 266, 268, 268, 268, 268, 268, 268, + 268, 268, 268, 268, 268, 271, 271, 362, 271, 271, + 271, 362, 271, 271, 271, 271, 275, 275, 362, 275, + 275, 275, 275, 275, 275, 275, 275, 278, 278, 362, + 278, 278, 278, 362, 278, 278, 278, 278, 282, 282, + 362, 282, 282, 282, 282, 282, 282, 282, 282, 287, + 287, 289, 289, 292, 292, 362, 292, 292, 292, 292, + 292, 292, 292, 292, 293, 293, 331, 331, 331, 331, + 331, 331, 331, 331, 331, 331, 331, 342, 342, 342, + + 342, 342, 342, 342, 342, 342, 342, 342, 356, 362, + 362, 356, 362, 362, 362, 362, 356, 356, 359, 362, + 362, 359, 362, 362, 362, 362, 362, 359, 360, 360, + 361, 361, 55, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362 + } ; + +static yyconst short int yy_chk[1664] = + { 0, + 0, 1, 64, 1, 1, 117, 64, 250, 250, 117, + 349, 60, 68, 1, 60, 68, 74, 85, 94, 74, + 85, 94, 348, 347, 78, 77, 77, 78, 100, 1, + 2, 100, 2, 2, 87, 87, 103, 101, 101, 101, + 104, 105, 2, 101, 107, 106, 123, 103, 108, 123, + 106, 104, 105, 106, 108, 107, 106, 346, 2, 3, + 110, 3, 3, 109, 109, 131, 135, 110, 131, 109, + 135, 3, 139, 146, 152, 139, 146, 152, 159, 164, + 170, 159, 164, 170, 341, 340, 336, 3, 4, 4, + 4, 4, 178, 4, 188, 178, 195, 188, 202, 195, + + 4, 202, 211, 218, 224, 211, 218, 228, 224, 236, + 228, 261, 236, 335, 334, 261, 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, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 9, 230, 9, + 9, 240, 240, 240, 230, 329, 328, 240, 238, 9, + 242, 242, 242, 243, 238, 247, 242, 230, 326, 245, + + 246, 247, 230, 325, 243, 9, 10, 238, 10, 10, + 245, 246, 238, 249, 253, 253, 254, 269, 10, 249, + 253, 269, 316, 254, 323, 333, 339, 343, 316, 322, + 323, 333, 339, 343, 10, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 13, 345, 13, 13, 13, + 350, 352, 345, 353, 352, 354, 350, 13, 354, 353, + 13, 357, 321, 352, 352, 320, 319, 357, 354, 318, + 315, 314, 313, 13, 14, 312, 14, 14, 14, 311, + + 310, 308, 307, 306, 305, 304, 14, 303, 302, 14, + 300, 299, 298, 297, 286, 263, 262, 260, 259, 258, + 257, 256, 14, 15, 255, 15, 15, 237, 232, 231, + 229, 227, 219, 180, 172, 15, 171, 158, 145, 126, + 15, 121, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 17, 114, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 19, 113, 112, 111, 88, 79, 19, + 19, 76, 19, 55, 0, 0, 0, 0, 0, 19, + 0, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 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, 0, 23, 23, 0, 0, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 23, 24, + 24, 24, 24, 0, 24, 0, 0, 0, 0, 0, + 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 24, 25, 0, + 25, 25, 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 25, 26, 0, 26, + 26, 0, 0, 0, 0, 0, 0, 0, 0, 26, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 26, 27, 0, 27, 27, + 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 27, 28, 0, 28, 28, 0, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 29, 0, 29, 29, 0, 0, + + 0, 0, 0, 29, 0, 0, 29, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 29, 30, 0, 30, 30, 0, 0, 0, + 0, 0, 30, 0, 0, 30, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 31, 0, 31, 31, 0, 0, 0, 0, + 0, 0, 0, 0, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 31, 32, 0, 32, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, + 33, 0, 33, 33, 0, 0, 0, 0, 0, 33, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 34, + 0, 34, 34, 0, 0, 0, 0, 0, 34, 0, + 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, + 35, 35, 0, 0, 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 35, 36, 0, 36, + + 36, 0, 0, 0, 0, 0, 0, 0, 0, 36, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 36, 37, 0, 37, 37, + 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, + 0, 0, 0, 0, 37, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 37, 38, 0, 38, 38, 0, + 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, + 0, 0, 0, 38, 0, 38, 0, 0, 0, 0, + 0, 0, 0, 38, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 41, 0, 0, 0, 0, 0, + 0, 0, 0, 41, 0, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 43, 0, 43, 43, 43, 0, + 0, 0, 0, 0, 0, 0, 43, 0, 0, 0, + 0, 0, 43, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 43, 44, 0, 44, 44, 44, 0, 0, + 0, 0, 0, 0, 0, 44, 0, 0, 0, 0, + 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 44, 45, 0, 45, 45, 0, 0, 45, 0, + + 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 45, 46, 0, 46, 46, 0, 0, 46, 0, 0, + 0, 0, 0, 46, 0, 0, 0, 0, 0, 46, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, + 47, 0, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 49, 0, 49, 49, 0, 0, 0, 0, 0, + 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 50, 0, 50, 50, 0, 0, 0, 0, 0, 0, + + 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, + 0, 51, 51, 51, 0, 0, 51, 51, 0, 0, + 0, 51, 0, 0, 0, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 51, 52, 0, + 52, 52, 52, 0, 0, 52, 52, 0, 0, 0, + 52, 0, 0, 0, 52, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 52, 53, 0, 53, + 53, 53, 0, 0, 0, 0, 0, 0, 0, 53, + 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 53, 54, 0, 54, 54, + 54, 0, 0, 0, 0, 0, 0, 0, 54, 0, + 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 54, 317, 0, 0, 0, 317, + 0, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 332, 0, 0, 0, 332, 0, 332, 332, 332, 332, + 332, 332, 332, 332, 332, 363, 363, 363, 363, 363, + 363, 363, 363, 363, 363, 363, 364, 364, 364, 364, + 364, 364, 364, 364, 364, 364, 364, 365, 365, 365, + 365, 365, 365, 365, 365, 365, 365, 365, 366, 366, + + 366, 366, 366, 366, 366, 366, 366, 366, 366, 367, + 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, + 368, 368, 368, 368, 368, 368, 368, 368, 368, 368, + 368, 369, 369, 369, 369, 369, 369, 369, 369, 369, + 369, 369, 370, 370, 370, 370, 370, 370, 370, 370, + 370, 370, 370, 371, 371, 371, 371, 371, 371, 371, + 371, 371, 371, 371, 372, 372, 372, 372, 372, 372, + 372, 372, 372, 372, 372, 373, 373, 373, 373, 373, + 373, 373, 373, 373, 373, 373, 374, 374, 374, 374, + 374, 374, 374, 374, 374, 374, 374, 375, 375, 375, + + 375, 375, 375, 375, 375, 375, 375, 375, 376, 376, + 376, 376, 376, 376, 376, 376, 376, 376, 376, 377, + 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, + 378, 378, 378, 378, 378, 378, 378, 378, 378, 378, + 378, 379, 379, 379, 379, 379, 379, 379, 379, 379, + 379, 379, 380, 380, 381, 381, 382, 382, 0, 382, + 382, 382, 382, 382, 0, 382, 382, 383, 383, 383, + 0, 383, 0, 0, 0, 383, 383, 384, 384, 0, + 384, 384, 384, 384, 384, 384, 384, 384, 385, 0, + 0, 0, 385, 0, 0, 0, 385, 385, 386, 386, + + 0, 0, 386, 0, 0, 0, 386, 386, 387, 0, + 387, 387, 388, 388, 389, 389, 389, 389, 389, 389, + 389, 389, 389, 389, 389, 390, 390, 0, 390, 390, + 390, 0, 390, 390, 390, 390, 391, 391, 0, 391, + 391, 391, 391, 391, 391, 391, 391, 392, 392, 0, + 392, 392, 392, 0, 392, 392, 392, 392, 393, 393, + 0, 393, 393, 393, 393, 393, 393, 393, 393, 394, + 394, 395, 395, 396, 396, 0, 396, 396, 396, 396, + 396, 396, 396, 396, 397, 397, 398, 398, 398, 398, + 398, 398, 398, 398, 398, 398, 398, 399, 399, 399, + + 399, 399, 399, 399, 399, 399, 399, 399, 400, 0, + 0, 400, 0, 0, 0, 0, 400, 400, 401, 0, + 0, 401, 0, 0, 0, 0, 0, 401, 402, 402, + 403, 403, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, + 362, 362, 362 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +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 yytext */ \ +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 *yytext; +#line 1 "pre.l" +#define INITIAL 0 +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered by this license. + * + */ +#line 18 "pre.l" + +/* + * includes + */ + +#include <stdio.h> +#include <iostream.h> +#include <assert.h> +#include <ctype.h> + +#include "qtbc.h" +#include <qarray.h> +#include <qstack.h> +#include <qfile.h> +#include <qstrlist.h> +#include <qdict.h> +#include <qregexp.h> +#include <qfileinfo.h> + +#include "constexp.h" +#include "define.h" +#include "doxygen.h" +#include "message.h" +#include "util.h" +#include "defargs.h" + +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define popen _popen +#define pclose _pclose +#endif + +#define YY_NEVER_INTERACTIVE 1 + +#define DUMP_OUTPUT 0 // set this to one to see what the preprocessor + // produces. +#define SHOW_INCLUDES 0 // set this to one to list all parsed include files + +struct FileState +{ + int lineNr; + FILE *filePtr; + YY_BUFFER_STATE bufState; + QCString fileName; +}; + +/* ----------------------------------------------------------------- + * + * statics + */ + +static int yyLineNr = 1; +static QCString yyFileName; +static int ifcount = 0; +static QStrList *pathList = 0; +static QStack<FileState> includeStack; +static QDict<int> *argDict; +static int defArgs = -1; +static QCString defName; +static QCString defText; +static QCString defArgsStr; +static bool defVarArgs; +static int level; +static int lastCContext; +static int lastCPPContext; +static QArray<int> levelGuard; +static QCString guardExpr; +static BufStr *outputBuf; +static int roundCount; +static bool quoteArg; +static DefineDict *fileDefineDict; +static DefineDict *expandedDict; +static int findDefArgContext; + +static QCString lastGuardName; + + +static void incrLevel() +{ + level++; + levelGuard.resize(level); + levelGuard[level-1]=FALSE; + //printf("%s line %d: incrLevel %d\n",yyFileName.data(),yyLineNr,level); +} + +static void decrLevel() +{ + //printf("%s line %d: decrLevel %d\n",yyFileName.data(),yyLineNr,level); + if (level > 0) + { + level--; + levelGuard.resize(level); + } + else + { + err("Error: More #endif's than #if's found.\n"); + } +} + +static bool otherCaseDone() +{ + return levelGuard[level-1]; +} + +static void setCaseDone(bool value) +{ + levelGuard[level-1]=value; +} + +static Define *isDefined(const char *name) +{ + if (name) + { + Define *def; + //if ((def=fileDefineCache->findDefine(yyFileName,name)) && !def->undef) + // return def; + if ((def=fileDefineDict->find(name)) && !def->undef) return def; + } + return 0; +} + +static FILE *findFile(const char *fileName) +{ + if (pathList==0) + { + return 0; + } + char *s=pathList->first(); + while (s) + { + QCString absName=(QCString)s+"/"+fileName; + QFileInfo fi(absName); + if (fi.exists()) + { + FILE *f; + if (!Config::inputFilter.isEmpty()) + { + QCString cmd = Config::inputFilter+" "+absName; + f=popen(cmd,"r"); + if (!f) warn("Warning: could not execute filter %s\n",cmd.data()); + } + else + { + f=fopen(absName,"r"); + if (!f) warn("Warning: could not open file %s for reading\n",absName.data()); + } + if (f) + { + yyFileName=absName; + yyLineNr=1; + return f; + } + } + s=pathList->next(); + } + return 0; +} + + +static int getNextChar(const QCString &expr,QCString *rest,uint &pos); +static int getCurrentChar(const QCString &expr,QCString *rest,uint pos); +static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c); +static void expandExpression(QCString &expr,QCString *rest,int pos); + +static QCString stringize(const QCString &s) +{ + QCString result; + uint i=0; + bool inString=FALSE; + bool inChar=FALSE; + char c,pc; + while (i<s.length()) + { + if (!inString && !inChar) + { + while (i<s.length() && !inString && !inChar) + { + c=s.at(i++); + if (c=='"') + { + result+="\\\""; + inString=TRUE; + } + else if (c=='\'') + { + result+=c; + inChar=TRUE; + } + else + { + result+=c; + } + } + } + else if (inChar) + { + while (i<s.length() && inChar) + { + c=s.at(i++); + if (c=='\'') + { + result+='\''; + inChar=FALSE; + } + else if (c=='\\') + { + result+="\\\\"; + } + else + { + result+=c; + } + } + } + else + { + pc=0; + while (i<s.length() && inString) + { + char c=s.at(i++); + if (c=='"') + { + result+="\\\""; + inString= pc=='\\'; + } + else if (c=='\\') + result+="\\\\"; + else + result+=c; + pc=c; + } + } + } + //printf("stringize `%s'->`%s'\n",s.data(),result.data()); + return result; +} + +/*! Execute all ## operators in expr. + * If the macro name before or after the operator contains a no-rescan + * marker (@-) then this is removed (before the concatenated macro name + * may be expanded again. + */ +static void processConcatOperators(QCString &expr) +{ + QRegExp r("[ \\t\\n]*##[ \\t\\n]*"); + int l,n,i=0; + while ((n=r.match(expr,i,&l))!=-1) + { + if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-') + { + // remove no-rescan marker after ID + l+=2; + } + // remove the ## operator and the surrounding whitespace + expr=expr.left(n)+expr.right(expr.length()-n-l); + int k=n-1; + while (k>=0 && isId(expr.at(k))) k--; + if (k>0 && expr.at(k)=='-' && expr.at(k-1)=='@') + { + // remove no-rescan marker before ID + expr=expr.left(k-1)+expr.right(expr.length()-k-1); + n-=2; + } + i=n+l; + } +} + +/*! replaces the function macro \a def whose argument list starts at + * \a pos in expression \a expr. + * Notice that this routine may scan beyond the \a expr string if needed. + * The characters from the input file will be read. + * The replacement string will be returned in \a result and the + * length of the (unexpanded) argument list is stored in \a len. + */ +static bool replaceFunctionMacro(const QCString &expr,QCString *rest,int pos,int &len,const Define *def,QCString &result) +{ + //printf("replaceFunctionMacro(expr=%s,rest=%s,pos=%d,def=%s) level=%d\n",expr.data(),rest ? rest->data() : 0,pos,def->name.data(),level); + //bool replaced=FALSE; + uint j=pos; + len=0; + result.resize(0); + int cc; + while ((cc=getCurrentChar(expr,rest,j))!=EOF && cc==' ') + { + len++; + getNextChar(expr,rest,j); + } + if (cc!='(') + { + unputChar(expr,rest,j,' '); + return FALSE; + } + getNextChar(expr,rest,j); // eat the `(' character + + //while (j<expr.length() && expr.at(j)!='(') j++; + //j++; // skip opening paren + + QDict<QCString> argTable; // list of arguments + argTable.setAutoDelete(TRUE); + QCString arg; + int argCount=0; + bool done=FALSE; + + // FASE 1: read the macro arguments + if (def->nargs==0) + { + while ((cc=getNextChar(expr,rest,j))!=EOF) + { + char c = (char)cc; + if (c==')') break; + } + } + else + { + while (!done && (argCount<def->nargs || def->varArgs) && + ((cc=getNextChar(expr,rest,j))!=EOF) + ) + { + char c=(char)cc; + if (c=='(') // argument is a function => search for matching ) + { + int level=1; + arg+=c; + char term='\0'; + while ((cc=getNextChar(expr,rest,j))!=EOF) + { + char c=(char)cc; + if (c=='\'' || c=='\"') // skip ('s and )'s inside strings + { + if (term!='\0') + { + if (c==term && expr.at(j-2)!='\\') term='\0'; + } + else + { + term=c; + } + } + if (term=='\0' && c==')') + { + level--; + arg+=c; + if (level==0) break; + } + else if (term=='\0' && c=='(') + { + level++; + arg+=c; + } + else + arg+=c; + } + } + else if (c==')' || c==',') // last or next argument found + { + if (c==',' && argCount==def->nargs-1 && def->varArgs) + { + arg=arg.stripWhiteSpace(); + arg+=','; + } + else + { + QCString argKey; + argKey.sprintf("@%d",argCount++); // key name + arg=arg.stripWhiteSpace(); + // add argument to the lookup table + argTable.insert(argKey, new QCString(arg)); + arg.resize(0); + if (c==')') // end of the argument list + { + done=TRUE; + } + } + } + else if (c=='\"') // append literal strings + { + arg+=c; + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + { + found = pc!='\\' && cc=='"'; + c=(char)cc; + pc=c; + arg+=c; + } + } + else if (c=='\'') // append literal characters + { + arg+=c; + char pc=c; + bool found=FALSE; + while (!found && (cc=getNextChar(expr,rest,j))!=EOF) + { + found = pc!='\\' && cc=='\''; + c=(char)cc; + pc=c; + arg+=c; + } + } + else // append other characters + { + arg+=c; + } + } + } + + // FASE 2: apply the macro function + if (argCount==def->nargs || + (argCount>def->nargs && def->varArgs)) // matching parameters lists + { + uint k=0; + // substitution of all formal arguments + QCString resExpr; + const QCString d=def->definition.stripWhiteSpace(); + bool inString=FALSE; + while (k<d.length()) + { + if (d.at(k)=='@') // maybe a marker, otherwise an escaped @ + { + if (d.at(k+1)=='@') // escaped @ => copy it (is unescaped later) + { + k+=2; + resExpr+="@@"; // we unescape these later + } + else if (d.at(k+1)=='-') // no-rescan marker + { + k+=2; + resExpr+="@-"; + } + else // argument marker => read the argument number + { + QCString key="@"; + QCString *subst=0; + bool hash=FALSE; + int l=k-1; + // search for ## backward + if (l>=0 && d.at(l)=='"') l--; + while (l>=0 && d.at(l)==' ') l--; + if (l>0 && d.at(l)=='#' && d.at(l-1)=='#') hash=TRUE; + k++; + // scan the number + while (k<d.length() && d.at(k)>='0' && d.at(k)<='9') key+=d.at(k++); + if (!hash) + { + // search for ## forward + l=k; + if (l<(int)d.length() && d.at(l)=='"') l++; + while (l<(int)d.length() && d.at(l)==' ') l++; + if (l<(int)d.length()-1 && d.at(l)=='#' && d.at(l+1)=='#') hash=TRUE; + } + //printf("request key %s result %s\n",key.data(),args[key]->data()); + if (key.length()>1 && (subst=argTable[key])) + { + QCString substArg=*subst; + // only if no ## operator is before or after the argument + // marker we do macro expansion. + if (!hash) expandExpression(substArg,0,0); + if (inString) + { + //printf("`%s'=stringize(`%s')\n",stringize(*subst).data(),subst->data()); + + // if the marker is inside a string (because a # was put + // before the macro name) we must escape " and \ characters + resExpr+=stringize(substArg); + } + else + { + resExpr+=substArg; + } + } + } + } + else // no marker, just copy + { + if (!inString && d.at(k)=='\"') + { + inString=TRUE; // entering a literal string + } + else if (inString && d.at(k)=='\"' && d.at(k-1)!='\\') + { + inString=FALSE; // leaving a literal string + } + resExpr+=d.at(k++); + } + } + len=j-pos; + result=resExpr; + //printf("result after substitution `%s' expr=`%s'\n", + // result.data(),expr.mid(pos,len).data()); + return TRUE; + } + else + { + return FALSE; + } +} + + +/*! returns the next identifier in string \a expr by starting at position \a p. + * The position of the identifier is returned (or -1 if nothing is found) + * and \a l is its length. Any quoted strings are skipping during the search. + */ +static int getNextId(const QCString &expr,int p,int *l) +{ + int n; + while (p<(int)expr.length()) + { + char c=expr.at(p++); + if (isalpha(c) || c=='_') // read id + { + n=p-1; + while (p<(int)expr.length() && isId(expr.at(p)) + ) p++; + *l=p-n; + return n; + } + else if (c=='"') // skip string + { + char pc=c; + if (p<(int)expr.length()) c=expr.at(p); + while (p<(int)expr.length() && (c!='"' || pc=='\\')) + { + pc=c; + c=expr.at(p); + p++; + } + } + } + return -1; +} + +/*! preforms recursive macro expansion on the string \a expr + * starting at position \a pos. + * May read additional characters from the input while re-scanning! + * If \a expandAll is \c TRUE then all macros in the expression are + * expanded, otherwise only the first is expanded. + */ +static void expandExpression(QCString &expr,QCString *rest,int pos) +{ + //printf("expandExpression(%s,%s)\n",expr.data(),rest ? rest->data() : 0); + QCString macroName; + QCString expMacro; + int i=pos,l,p,len; + while ((p=getNextId(expr,i,&l))!=-1) // search for an macro name + { + bool replaced=FALSE; + macroName=expr.mid(p,l); + //printf("macroName %s found\n",macroName.data()); + if (p<2 || !(expr.at(p-2)=='@' && expr.at(p-1)=='-')) // no-rescan marker? + { + if (expandedDict->find(macroName)==0) // expand macro + { + Define *def=isDefined(macroName); + //printf("name is not an expanded macro def=%s\n",def ? def->name.data() : 0); + if (def && def->nargs==-1) // simple macro + { + // substitute the definition of the macro + expMacro=def->definition.stripWhiteSpace(); + replaced=TRUE; + len=l; + //printf("simple macro expansion=`%s'->`%s'\n",macroName.data(),expMacro.data()); + } + else if (def && def->nargs>=0) // function macro + { + replaced=replaceFunctionMacro(expr,rest,p+l,len,def,expMacro); + len+=l; + } + + if (replaced) // expand the macro and rescan the expression + { + + //printf("replacing `%s'->`%s'\n",expr.mid(p,len).data(),expMacro.data()); + QCString resultExpr=expMacro; + QCString restExpr=expr.right(expr.length()-len-p); + processConcatOperators(resultExpr); + if (!def->nonRecursive) + { + expandedDict->insert(macroName,def); + expandExpression(resultExpr,&restExpr,0); + expandedDict->remove(macroName); + } + expr=expr.left(p)+resultExpr+restExpr; + i=p; + //printf("new expression: %s\n",expr.data()); + } + else // move to the next macro name + { + //printf("moving to the next macro old=%d new=%d\n",i,p+l); + i=p+l; + } + } + else // move to the next macro name + { + expr=expr.left(p)+"@-"+expr.right(expr.length()-p); + //printf("macro already expanded, moving to the next macro expr=%s\n",expr.data()); + i=p+l+2; + //i=p+l; + } + } + else // no re-scan marker found, skip the macro name + { + //printf("skipping marked macro\n"); + i=p+l; + } + } +} + +/*! replaces all occurrences of @@ in \a s by @ + * All identifiers found are replaced by 0L + * \par assumption: + * \a s only contains pairs of @@'s. + */ +QCString removeIdsAndMarkers(const char *s) +{ + //printf("removeIdsAndMarkers(%s)\n",s); + const char *p=s; + char c; + bool inNum=FALSE; + QCString result; + if (p) + { + while ((c=*p)) + { + if (c=='@') // replace @@ with @ + { + if (*(p+1)=='@') + { + result+=c; + } + p+=2; + } + else if (isdigit(c)) + { + result+=c; + p++; + inNum=TRUE; + } + else if ((isalpha(c) || c=='_') && !inNum) // replace identifier with 0L + { + result+="0L"; + p++; + while ((c=*p) && isId(c)) p++; + } + else + { + result+=c; + char lc=tolower(c); + if (lc!='l' && lc!='u') inNum=FALSE; + p++; + } + } + } + return result; +} + +/*! replaces all occurrences of @@ in \a s by @ + * \par assumption: + * \a s only contains pairs of @@'s + */ +QCString removeMarkers(const char *s) +{ + const char *p=s; + char c; + QCString result; + if (p) + { + while ((c=*p)) + { + if (c=='@') // replace @@ with @ + { + if (*(p+1)=='@') + { + result+=c; + } + p+=2; + } + else + { + result+=c; + p++; + } + } + } + return result; +} + +/*! compute the value of the expression in string \a expr. + * If needed the function may read additional characters from the input. + */ + +bool computeExpression(const QCString &expr) +{ + QCString e=expr; + expandExpression(e,0,0); + e = removeIdsAndMarkers(e); + if (e.length()==0) return FALSE; + return parseCppExpression(e); +} + +/*! expands the macro definition in \a name + * If needed the function may read additional characters from the input + */ + +QCString expandMacro(const QCString &name) +{ + QCString n=name; + expandExpression(n,0,0); + n=removeMarkers(n); + //printf("expandMacro `%s'->`%s'\n",name.data(),n.data()); + return n; +} + +Define *newDefine() +{ + Define *def=new Define; + def->name = defName; + def->definition = defText.stripWhiteSpace(); + def->nargs = defArgs; + def->fileName = yyFileName; + def->lineNr = yyLineNr; + def->varArgs = defVarArgs; + return def; +} + +void addDefine() +{ + bool ambig; + FileDef *fd=findFileDef(&inputNameDict,yyFileName,ambig); + MemberDef *md=new MemberDef("#define",defName,defArgsStr,0, + Public,Normal,FALSE,FALSE,MemberDef::Define,0,0); + ArgumentList *argList = new ArgumentList; + stringToArgumentList(defArgsStr,argList); + md->setArgumentList(argList); + md->setDefFile(yyFileName); + md->setDefLine(yyLineNr); + md->setFileDef(fd); + md->setDefinition("#define "+defName); + + MemberName *mn=functionNameDict[defName]; + if (mn==0) + { + mn = new MemberName(defName); + functionNameList.inSort(mn); + functionNameDict.insert(defName,mn); + } + mn->append(md); + if (fd) fd->insertMember(md); + + Define *d; + if ((d=defineDict[defName])==0) defineDict.insert(defName,newDefine()); + +} + +static void outputChar(char c) +{ + if (includeStack.isEmpty()) outputBuf->addChar(c); +} + +static void outputArray(const char *a,int len) +{ + if (includeStack.isEmpty()) outputBuf->addArray(a,len); +} + +static void readIncludeFile(const QCString &inc) +{ + if (!Config::searchIncludeFlag) return; // do not read include files + uint i=0; + // find the start of the include file name + while (i<inc.length() && + (inc.at(i)==' ' || inc.at(i)=='"' || inc.at(i)=='<') + ) i++; + uint s=i; + // find the end of the include file name + while (i<inc.length() && + inc.at(i)!='"' && inc.at(i)!='>') i++; + if (s<inc.length() && i>s) // valid include file name found + { + QCString incFileName=inc.mid(s,i-s).stripWhiteSpace(); + + FILE *f; + QCString oldFileName=yyFileName.copy(); + if ((f=findFile(incFileName))) // see if the include file can be found + { +#if SHOW_INCLUDES + for (i=0;i<includeStack.count();i++) msg(" "); + msg("#include %s: parsing...\n",incFileName.data()); +#endif + // store the state of the old file + FileState *fs=new FileState; + fs->bufState=YY_CURRENT_BUFFER; + fs->lineNr=yyLineNr; + fs->fileName=oldFileName; + fs->filePtr=f; + // push the state on the stack + includeStack.push(fs); + // set the scanner to the include file + preYYin=f; + yy_switch_to_buffer(yy_create_buffer(preYYin, YY_BUF_SIZE)); + } + else + { +#if SHOW_INCLUDES + msg("#include %s: not found! skipping...\n",incFileName.data()); + //printf("Error: include file %s not found\n",yytext); +#endif + } + } +} + +/* ----------------------------------------------------------------- */ + +#define Start 1 + +#define Command 2 + +#define SkipCommand 3 + +#define SkipLine 4 + +#define CopyLine 5 + +#define Include 6 + +#define IncludeID 7 + +#define DefName 8 + +#define DefineArg 9 + +#define DefineText 10 + +#define SkipCPPBlock 11 + +#define Ifdef 12 + +#define Ifndef 13 + +#define SkipCComment 14 + +#define SkipCPPComment 15 + +#define RemoveCComment 16 + +#define RemoveCPPComment 17 + +#define Guard 18 + +#define DefinedExpr1 19 + +#define DefinedExpr2 20 + +#define SkipDoubleQuote 21 + +#define SkipSingleQuote 22 + +#define UndefName 23 + +#define IgnoreLine 24 + +#define FindDefineArgs 25 + +#define ReadString 26 + + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#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 (void) fwrite( yytext, yyleng, 1, yyout ) +#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->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#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 + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * 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 ( yyleng > 0 ) \ + yy_current_buffer->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 864 "pre.l" + + + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *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 >= 363 ) + 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] != 1633 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +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 866 "pre.l" + + YY_BREAK +case 2: +YY_RULE_SETUP +#line 867 "pre.l" + + YY_BREAK +case 3: +YY_RULE_SETUP +#line 868 "pre.l" + + YY_BREAK +/* +<Start>^{B}*([^ \t#\n\/][^\n]*)?"\n" { + //printf("%s line %d: %s",yyFileName.data(),yyLineNr,yytext); + if (includeStack.isEmpty()) + { + //preprocessedFile+=yytext; + //char *s=yytext,c; + //if (s) while ((c=*s++)) *dataPtr++=c; + outputBuf->addArray(yytext,yyleng); + } + yyLineNr++; + } + */ +case 4: +YY_RULE_SETUP +#line 882 "pre.l" +{ BEGIN(Command); } + YY_BREAK +case 5: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 883 "pre.l" +{ + outputArray(yytext,yyleng); + BEGIN(CopyLine); + } + YY_BREAK +/* +<CopyLine>[^\n/]+ { + outputArray(yytext,yyleng); + } + */ +case 6: +YY_RULE_SETUP +#line 892 "pre.l" +{ + Define *def=0; + //printf("Search for define %s\n",yytext); + if (includeStack.isEmpty() && + Config::macroExpansionFlag && + /* (expandDefine=fileDefineCache->findDefine(yyFileName,yytext)) */ + (def=fileDefineDict->find(yytext)) && + (!Config::onlyPredefinedFlag || def->isPredefined) + ) + { + //printf("Found it!\n"); + roundCount=0; + defArgsStr=yytext; + if (def->nargs==-1) // no function macro + { + QCString result = expandMacro(defArgsStr); + //printf("result=`%s'\n",result.data()); + outputArray(result,result.length()); + } + else // zero or more arguments + { + findDefArgContext = CopyLine; + BEGIN(FindDefineArgs); + } + } + else + { + outputArray(yytext,yyleng); + } + } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 922 "pre.l" +{ + Define *def=0; + //printf("Search for define %s\n",yytext); + if (includeStack.isEmpty() && + Config::macroExpansionFlag && + (def=fileDefineDict->find(yytext)) && + def->nargs==-1 && + (!Config::onlyPredefinedFlag || def->isPredefined) + ) + { + //printf("Found it!\n"); + QCString name=yytext; + QCString result=expandMacro(name); + //printf("result=`%s'\n",result.data()); + outputArray(result,result.length()); + } + else + { + outputArray(yytext,yyleng); + } + } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 943 "pre.l" +{ + outputChar(*yytext); + } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 946 "pre.l" +{ + outputChar('\n'); + BEGIN(Start); + yyLineNr++; + } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 951 "pre.l" +{ + defArgsStr+='('; + roundCount++; + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 955 "pre.l" +{ + defArgsStr+=')'; + roundCount--; + if (roundCount==0) + { + //printf("defArgsStr=`%s'\n",defArgsStr.data()); + QCString result=expandMacro(defArgsStr); + if (findDefArgContext==CopyLine) + { + outputArray(result,result.length()); + BEGIN(findDefArgContext); + } + else // findDefArgContext==IncludeID + { + readIncludeFile(result); + BEGIN(Start); + } + } + } + YY_BREAK +/* +<FindDefineArgs>")"{B}*"(" { + defArgsStr+=yytext; + } + */ +case 12: +YY_RULE_SETUP +#line 979 "pre.l" +{ + defArgsStr+=*yytext; + BEGIN(ReadString); + } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 983 "pre.l" +{ + yyLineNr++; + outputChar('\n'); + } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 987 "pre.l" +{ + defArgsStr+="@@"; + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 990 "pre.l" +{ + defArgsStr+=*yytext; + } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 993 "pre.l" +{ + defArgsStr+=yytext; + } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 996 "pre.l" +{ + defArgsStr+=*yytext; + BEGIN(FindDefineArgs); + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 1000 "pre.l" +{ + defArgsStr+=yytext; + } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 1003 "pre.l" +{ + defArgsStr+=*yytext; + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 1006 "pre.l" +{ + if (Config::macroExpansionFlag) + BEGIN(IncludeID); + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 1010 "pre.l" +{ + BEGIN(Include); + } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 1013 "pre.l" +{ + //printf("!!!DefName\n"); + BEGIN(DefName); + } + YY_BREAK +case 23: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 5; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1017 "pre.l" +{ + incrLevel(); + guardExpr.resize(0); + BEGIN(DefinedExpr2); + } + YY_BREAK +case 24: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 5; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1022 "pre.l" +{ + //printf("Pre.l: ifdef\n"); + incrLevel(); + guardExpr.resize(0); + BEGIN(DefinedExpr1); + } + YY_BREAK +case 25: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 6; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1028 "pre.l" +{ + incrLevel(); + guardExpr="! "; + BEGIN(DefinedExpr2); + } + YY_BREAK +case 26: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 6; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1033 "pre.l" +{ + incrLevel(); + guardExpr="! "; + BEGIN(DefinedExpr1); + } + YY_BREAK +case 27: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 2; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1038 "pre.l" +{ + incrLevel(); + guardExpr.resize(0); + BEGIN(Guard); + } + YY_BREAK +case 28: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 4; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1043 "pre.l" +{ + if (!otherCaseDone()) + { + guardExpr.resize(0); + BEGIN(Guard); + } + else + { + ifcount=0; + BEGIN(SkipCPPBlock); + } + } + YY_BREAK +case 29: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 4; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1055 "pre.l" +{ + //printf("else levelGuard[%d]=%d\n",level-1,levelGuard[level-1]); + if (otherCaseDone()) + { + ifcount=0; + BEGIN(SkipCPPBlock); + } + else + { + setCaseDone(TRUE); + //levelGuard[level-1]=TRUE; + } + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 1068 "pre.l" +{ + BEGIN(UndefName); + } + YY_BREAK +case 31: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 4; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1071 "pre.l" +{ + if (!otherCaseDone()) + { + guardExpr.resize(0); + BEGIN(Guard); + } + } + YY_BREAK +case 32: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 5; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1078 "pre.l" +{ + //printf("Pre.l: #endif\n"); + decrLevel(); + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 1082 "pre.l" +{ + outputChar('\n'); + BEGIN(Start); + yyLineNr++; + } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 1087 "pre.l" +{ // unknown directive + BEGIN(IgnoreLine); + } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 1090 "pre.l" + + YY_BREAK +case 36: +YY_RULE_SETUP +#line 1091 "pre.l" + + YY_BREAK +case 37: +YY_RULE_SETUP +#line 1092 "pre.l" +{ + Define *def; + if ((def=isDefined(yytext))) + { + //printf("undefining %s\n",yytext); + def->undef=TRUE; + } + BEGIN(Start); + } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 1101 "pre.l" +{ + outputChar('\n'); + guardExpr+=' '; + yyLineNr++; + } + YY_BREAK +case 39: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 7; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1106 "pre.l" +{ + BEGIN(DefinedExpr2); + } + YY_BREAK +case 40: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 7; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1109 "pre.l" +{ + BEGIN(DefinedExpr1); + } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 1112 "pre.l" +{ guardExpr+=*yytext; } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 1113 "pre.l" +{ + outputChar('\n'); + yyLineNr++; + //printf("Guard: `%s'\n", + // guardExpr.data()); + bool guard=computeExpression(guardExpr); + setCaseDone(guard); + //printf("if levelGuard[%d]=%d\n",level-1,levelGuard[level-1]); + if (guard) + { + BEGIN(Start); + } + else + { + ifcount=0; + BEGIN(SkipCPPBlock); + } + } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 1131 "pre.l" +{ yyLineNr++; outputChar('\n'); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 1132 "pre.l" +{ + if (isDefined(yytext)) + guardExpr+=" 1L "; + else + guardExpr+=" 0L "; + lastGuardName=yytext; + BEGIN(Guard); + } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 1140 "pre.l" +{ + if (isDefined(yytext)) + guardExpr+=" 1L "; + else + guardExpr+=" 0L "; + lastGuardName.resize(0); + } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 1147 "pre.l" +{ // should not happen, handle anyway + ifcount=0; + BEGIN(SkipCPPBlock); + } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 1151 "pre.l" +{ + BEGIN(Guard); + } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 1154 "pre.l" + + YY_BREAK +case 49: +YY_RULE_SETUP +#line 1155 "pre.l" +{ BEGIN(SkipCommand); } + YY_BREAK +case 50: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1156 "pre.l" +{ BEGIN(SkipLine); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 1157 "pre.l" + + YY_BREAK +case 52: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1158 "pre.l" +{ + incrLevel(); + ifcount++; + //printf("#if... depth=%d\n",ifcount); + } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 1163 "pre.l" +{ + //printf("Else! ifcount=%d otherCaseDone=%d\n",ifcount,otherCaseDone()); + if (ifcount==0 && !otherCaseDone()) + { + setCaseDone(TRUE); + //outputChar('\n'); + BEGIN(Start); + } + } + YY_BREAK +case 54: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp = yy_bp + 4; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1172 "pre.l" +{ + if (ifcount==0) + { + if (!otherCaseDone()) + { + guardExpr.resize(0); + lastGuardName.resize(0); + BEGIN(Guard); + } + else + { + BEGIN(SkipCPPBlock); + } + } + } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 1187 "pre.l" +{ + decrLevel(); + if (--ifcount<0) + { + //outputChar('\n'); + BEGIN(Start); + } + } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 1195 "pre.l" +{ + outputChar('\n'); + yyLineNr++; + BEGIN(SkipCPPBlock); + } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 1200 "pre.l" +{ // unknown directive + BEGIN(SkipLine); + } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 1203 "pre.l" + + YY_BREAK +case 59: +YY_RULE_SETUP +#line 1204 "pre.l" + + YY_BREAK +case 60: +YY_RULE_SETUP +#line 1205 "pre.l" + + YY_BREAK +case 61: +YY_RULE_SETUP +#line 1206 "pre.l" +{ + lastCPPContext=YY_START; + BEGIN(RemoveCPPComment); + } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 1210 "pre.l" +{ + lastCContext=YY_START; + BEGIN(RemoveCComment); + } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 1214 "pre.l" +{ + outputChar('\n'); + yyLineNr++; + BEGIN(SkipCPPBlock); + } + YY_BREAK +case 64: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1219 "pre.l" +{ + roundCount=0; + defArgsStr=yytext; + findDefArgContext = IncludeID; + BEGIN(FindDefineArgs); + } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 1225 "pre.l" +{ + readIncludeFile(expandMacro(yytext)); + BEGIN(Start); + } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 1229 "pre.l" +{ + QCString incName=yytext; + //int l=incName.length(); + //QCString incFileName=incName.left(l-1); + //if (fileDefineCache->fileCached(incFileName)) + //{ + // printf("file already cached!\n"); + // fileDefineCache->merge(incFileName,yyFileName); + //} + //else if ((f=findFile(incFileName))) + readIncludeFile(incName); + + BEGIN(Start); + } + YY_BREAK +case 67: +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ +yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 1243 "pre.l" +{ + //printf("Define() `%s'\n",yytext); + argDict = new QDict<int>(31); + argDict->setAutoDelete(TRUE); + defArgs = 0; + defArgsStr.resize(0); + defText.resize(0); + defName = yytext; + defVarArgs = FALSE; + BEGIN(DefineArg); + } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 1254 "pre.l" +{ + //printf("Define `%s'\n",yytext); + argDict = 0; + defArgs = -1; + defArgsStr.resize(0); + defText.resize(0); + defName = yytext; + defVarArgs = FALSE; + QCString tmp=(QCString)"#define "+defName+defArgsStr; + outputArray(tmp.data(),tmp.length()); + quoteArg=FALSE; + BEGIN(DefineText); + } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 1267 "pre.l" +{ + argDict = 0; + defArgs = -1; + defName = yytext; + defArgsStr.resize(0); + defText.resize(0); + defVarArgs = FALSE; + if ( defName!=lastGuardName ) + { // define may appear in the output + QCString tmp=(QCString)"#define "+defName+defArgsStr; + outputArray(tmp.data(),tmp.length()); + quoteArg=FALSE; + BEGIN(DefineText); + } + else // define is a guard => hide + { + //printf("Found a guard %s\n",yytext); + Define *def=0; + //if (includeStack.isEmpty()) + //{ + // addDefine(); + //} + if (/*!Config::onlyPredefinedFlag &&*/ (def=fileDefineDict->find(defName))==0) + { + fileDefineDict->insert(defName,newDefine()); + } + else if (def)// name already exists + { + if (def->undef) // undefined name + { + def->undef = FALSE; + def->name = defName; + def->definition = defText.stripWhiteSpace(); + def->nargs = defArgs; + def->fileName = yyFileName; + def->lineNr = yyLineNr; + } + else + { + //printf("Error: define %s is defined more than once!\n",defName.data()); + } + } + //outputChar('\n'); + lastGuardName.resize(0); + BEGIN(Start); + } + } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 1314 "pre.l" +{ defArgsStr+=yytext; } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 1315 "pre.l" +{ defArgsStr+=yytext; } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 1316 "pre.l" +{ + defArgsStr+=yytext; + QCString tmp=(QCString)"#define "+defName+defArgsStr; + outputArray(tmp.data(),tmp.length()); + quoteArg=FALSE; + BEGIN(DefineText); + } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 1323 "pre.l" +{ + //printf("Define addArg(%s)\n",yytext); + QCString argName=yytext; + defVarArgs = yytext[yyleng-1]=='.'; + if (defVarArgs) // strip ellipsis + argName=argName.left(argName.length()-3); + defArgsStr+=yytext; + argDict->insert(argName,new int(defArgs)); + defArgs++; + } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 1333 "pre.l" +{ + outputChar('/');outputChar('*'); + defText+=' '; + lastCContext=YY_START; + BEGIN(SkipCComment); + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 1339 "pre.l" +{ + outputChar('/');outputChar('/'); + lastCPPContext=YY_START; + BEGIN(SkipCPPComment); + } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 1344 "pre.l" +{ + outputChar('*');outputChar('/'); + BEGIN(lastCContext); + } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 1348 "pre.l" +{ + outputChar('/');outputChar('/'); + } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 1351 "pre.l" +{ + outputChar('/');outputChar('*'); + } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 1354 "pre.l" +{ + outputArray(yytext,yyleng); + } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 1357 "pre.l" +{ + yyLineNr++; + outputChar('\n'); + } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 1361 "pre.l" +{ + outputChar(*yytext); + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 1364 "pre.l" +{ BEGIN(lastCContext); } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 1365 "pre.l" + + YY_BREAK +case 84: +YY_RULE_SETUP +#line 1366 "pre.l" + + YY_BREAK +case 85: +YY_RULE_SETUP +#line 1367 "pre.l" + + YY_BREAK +case 86: +YY_RULE_SETUP +#line 1368 "pre.l" +{ yyLineNr++; outputChar('\n'); } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 1369 "pre.l" + + YY_BREAK +case 88: +YY_RULE_SETUP +#line 1370 "pre.l" +{ + unput(*yytext); + BEGIN(lastCPPContext); + } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 1374 "pre.l" +{ + outputChar('/');outputChar('*'); + } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 1377 "pre.l" +{ + outputChar('/');outputChar('/'); + } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 1380 "pre.l" +{ + outputArray(yytext,yyleng); + } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 1383 "pre.l" +{ + outputChar(*yytext); + } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 1386 "pre.l" + + YY_BREAK +case 94: +YY_RULE_SETUP +#line 1387 "pre.l" + + YY_BREAK +case 95: +YY_RULE_SETUP +#line 1388 "pre.l" + + YY_BREAK +case 96: +YY_RULE_SETUP +#line 1389 "pre.l" + + YY_BREAK +case 97: +YY_RULE_SETUP +#line 1390 "pre.l" +{ + quoteArg=TRUE; + } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 1393 "pre.l" +{ + if (quoteArg) + { + defText+="\""; + } + if (defArgs>0) + { + int *n; + if ((n=(*argDict)[yytext])) + { + if (!quoteArg) defText+=' '; + defText+='@'; + QCString numStr; + numStr.setNum(*n); + defText+=numStr; + if (!quoteArg) defText+=' '; + } + else + { + defText+=yytext; + } + } + else + { + defText+=yytext; + } + if (quoteArg) + { + defText+="\""; + } + quoteArg=FALSE; + } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 1425 "pre.l" +{ + outputChar('\n'); + defText += ' '; yyLineNr++; + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 1429 "pre.l" +{ + outputChar('\n'); + Define *def=0; + //printf("Define name=`%s' text=`%s'\n",defName.data(),defText.data()); + if (includeStack.isEmpty()) + { + addDefine(); + } + if (/*!Config::onlyPredefinedFlag &&*/ (def=fileDefineDict->find(defName))==0) + { + fileDefineDict->insert(defName,newDefine()); + } + else if (def)// name already exists + { + //printf("define found\n"); + if (def->undef) // undefined name + { + def->undef = FALSE; + def->name = defName; + def->definition = defText.stripWhiteSpace(); + def->nargs = defArgs; + def->fileName = yyFileName; + def->lineNr = yyLineNr; + } + else + { + //printf("Error: define %s is defined more than once!\n",defName.data()); + } + } + delete argDict; + yyLineNr++; + lastGuardName.resize(0); + BEGIN(Start); + } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 1463 "pre.l" +{ defText += ' '; } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 1464 "pre.l" +{ defText += "##"; } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 1465 "pre.l" +{ defText += "@@"; } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 1466 "pre.l" +{ defText += *yytext; + BEGIN(SkipDoubleQuote); + } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 1469 "pre.l" +{ defText += *yytext; + BEGIN(SkipSingleQuote); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 1472 "pre.l" +{ defText += yytext; } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 1473 "pre.l" +{ defText += yytext; } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 1474 "pre.l" +{ + defText += *yytext; + BEGIN(DefineText); + } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 1478 "pre.l" +{ + defText += yytext; + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 1481 "pre.l" +{ + defText += *yytext; + BEGIN(DefineText); + } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 1485 "pre.l" +{ defText += *yytext; } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 1486 "pre.l" +{ defText += *yytext; } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 1487 "pre.l" +{ defText += *yytext; } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(Start): +case YY_STATE_EOF(Command): +case YY_STATE_EOF(SkipCommand): +case YY_STATE_EOF(SkipLine): +case YY_STATE_EOF(CopyLine): +case YY_STATE_EOF(Include): +case YY_STATE_EOF(IncludeID): +case YY_STATE_EOF(DefName): +case YY_STATE_EOF(DefineArg): +case YY_STATE_EOF(DefineText): +case YY_STATE_EOF(SkipCPPBlock): +case YY_STATE_EOF(Ifdef): +case YY_STATE_EOF(Ifndef): +case YY_STATE_EOF(SkipCComment): +case YY_STATE_EOF(SkipCPPComment): +case YY_STATE_EOF(RemoveCComment): +case YY_STATE_EOF(RemoveCPPComment): +case YY_STATE_EOF(Guard): +case YY_STATE_EOF(DefinedExpr1): +case YY_STATE_EOF(DefinedExpr2): +case YY_STATE_EOF(SkipDoubleQuote): +case YY_STATE_EOF(SkipSingleQuote): +case YY_STATE_EOF(UndefName): +case YY_STATE_EOF(IgnoreLine): +case YY_STATE_EOF(FindDefineArgs): +case YY_STATE_EOF(ReadString): +#line 1488 "pre.l" +{ + //printf("End of include file\n"); + //printf("Include stack depth=%d\n",includeStack.count()); + if (includeStack.isEmpty()) + { + //printf("Terminating scanner!\n"); + yyterminate(); + } + else + { + FileState *fs=includeStack.pop(); + //fileDefineCache->merge(yyFileName,fs->fileName); + if (Config::inputFilter.isEmpty()) + fclose(fs->filePtr); + else + pclose(fs->filePtr); + YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER; + yy_switch_to_buffer( fs->bufState ); + yy_delete_buffer( oldBuf ); + yyLineNr=fs->lineNr; + yyFileName=fs->fileName.copy(); + //printf("######## FileName %s\n",yyFileName.data()); + delete fs; + } + } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 1513 "pre.l" +{ + outputChar('/');outputChar('*'); + lastCContext=YY_START; + BEGIN(SkipCComment); + } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 1518 "pre.l" +{ + outputChar('/');outputChar('/'); + lastCPPContext=YY_START; + BEGIN(SkipCPPComment); + } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 1523 "pre.l" +{ + outputChar('\n'); + yyLineNr++; + } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 1527 "pre.l" +{ + outputChar(*yytext); + } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 1531 "pre.l" +ECHO; + YY_BREAK + + 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->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 yyin at a new source and called + * yylex(). 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->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->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->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 ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, 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->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 yylex */ + + +/* 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() + { + register char *dest = yy_current_buffer->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->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->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; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->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() + { + 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)] : 30); + 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 >= 363 ) + 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 ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 30; + 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 >= 363 ) + 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 == 362); + if ( ! yy_is_jam ) + *yy_state_ptr++ = yy_current_state; + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->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; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#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->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int 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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + 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 yytext */ + yy_hold_char = *++yy_c_buf_p; + + yy_current_buffer->yy_at_bol = (c == '\n'); + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + 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->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_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 *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + 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 ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + 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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_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; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_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; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (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 yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* 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 ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 1531 "pre.l" + + +/*@ ---------------------------------------------------------------------------- + */ + +static int getNextChar(const QCString &expr,QCString *rest,uint &pos) +{ + //printf("getNextChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos); + if (pos<expr.length()) + { + //printf("%c=expr()\n",expr.at(pos)); + return expr.at(pos++); + } + else if (rest && rest->length()>0) + { + int cc=rest->at(0); + *rest=rest->right(rest->length()-1); + //printf("%c=rest\n",cc); + return cc; + } + else + { + int cc=yyinput(); + //printf("%c=yyinput()\n",cc); + return cc; + } +} + +static int getCurrentChar(const QCString &expr,QCString *rest,uint pos) +{ + //printf("getCurrentChar(%s,%s,%d)\n",expr.data(),rest ? rest->data() : 0,pos); + if (pos<expr.length()) + { + //printf("%c=expr()\n",expr.at(pos)); + return expr.at(pos); + } + else if (rest && rest->length()>0) + { + int cc=rest->at(0); + //printf("%c=rest\n",cc); + return cc; + } + else + { + int cc=yyinput();unput(cc); + //printf("%c=yyinput()\n",cc); + return cc; + } +} + +static void unputChar(const QCString &expr,QCString *rest,uint &pos,char c) +{ + //printf("unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c); + if (pos<expr.length()) + { + pos++; + } + else if (rest) + { + //printf("Prepending to rest!\n"); + char cs[2];cs[0]=c;cs[1]='\0'; + rest->prepend(cs); + } + else + { + unput(c); + } + //printf("result: unputChar(%s,%s,%d,%c)\n",expr.data(),rest ? rest->data() : 0,pos,c); +} + +void addSearchDir(const char *dir) +{ + QFileInfo fi(dir); + if (fi.isDir()) pathList->append(fi.absFilePath()); +} + +void initPreprocessor() +{ + pathList = new QStrList; + addSearchDir("."); + //defineNameList.setAutoDelete(TRUE); + //defineNameList.clear(); + defineDict.clear(); + //fileDefineCache = new DefineCache(1009); + expandedDict = new DefineDict(17); + fileDefineDict = new DefineDict(1009); +} + +void cleanupPreprocessor() +{ + //delete fileDefineCache; + delete fileDefineDict; + delete expandedDict; + delete pathList; +} + + +void preprocessFile(const char *fileName,BufStr &output) +{ +#if DUMP_OUTPUT + uint orgOffset=output.curPos(); +#endif + + outputBuf=&output; + includeStack.setAutoDelete(TRUE); + includeStack.clear(); + fileDefineDict->setAutoDelete(TRUE); + fileDefineDict->clear(); + expandedDict->setAutoDelete(FALSE); + expandedDict->clear(); + + // add predefined macros + char *defStr = Config::predefined.first(); + while (defStr) + { + QCString ds = defStr; + int i_equals=ds.find('='); + int i_obrace=ds.find('('); + int i_cbrace=ds.find(')'); + bool nonRecursive = i_equals>0 && ds.at(i_equals-1)==':'; + + if (i_obrace==0) continue; // no define name + + if (i_obrace<i_equals && i_cbrace<i_equals && + i_obrace!=-1 && i_cbrace!=-1 && + i_obrace<i_cbrace + ) // predefined function macro definition + { + QRegExp reId("[a-z_A-Z][a-z_A-Z0-9]*"); // regexp matching an id + QDict<int> argDict(17); + argDict.setAutoDelete(TRUE); + int i=i_obrace+1,p,l,count=0; + // gather the formal arguments in a dictionary + while (i<i_cbrace && (p=reId.match(ds,i,&l))) + { + argDict.insert(ds.mid(p,l),new int(count++)); + i=p+l; + } + // strip definition part + QCString tmp=ds.right(ds.length()-i_equals-1); + QCString definition; + i=0; + // substitute all occurrences of formal arguments by their + // corresponding markers + while ((p=reId.match(tmp,i,&l))!=-1) + { + if (p>i) definition+=tmp.mid(i,p-i); + int *argIndex; + if ((argIndex=argDict[tmp.mid(p,l)])!=0) + { + QCString marker; + marker.sprintf(" @%d ",*argIndex); + definition+=marker; + } + else + { + definition+=tmp.mid(p,l); + } + i=p+l; + } + if (i<(int)tmp.length()) definition+=tmp.mid(i,tmp.length()-i); + + // add define definition to the dictionary of defines for this file + Define *def = new Define; + def->name = ds.left(i_obrace); + def->definition = definition; + def->nargs = count; + def->isPredefined = TRUE; + def->nonRecursive = nonRecursive; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); + } + else if ((i_obrace==-1 || i_obrace>i_equals) && + (i_cbrace==-1 || i_cbrace>i_equals) && + ds.length()>0 && (int)ds.length()>i_equals + ) // predefined non-function macro definition + { + Define *def = new Define; + if (i_equals==-1) // simple define without argument + { + def->name = ds; + def->definition = "1"; // substitute occurrences by 1 (true) + } + else // simple define with argument + { + int ine=i_equals - (nonRecursive ? 1 : 0); + def->name = ds.left(ine); + def->definition = ds.right(ds.length()-i_equals-1); + } + def->nargs = -1; + def->isPredefined = TRUE; + def->nonRecursive = nonRecursive; + fileDefineDict->insert(def->name,def); + + //printf("#define `%s' `%s' #nargs=%d\n", + // def->name.data(),def->definition.data(),def->nargs); + } + + defStr=Config::predefined.next(); + } + + if (Config::inputFilter.isEmpty()) + { + preYYin = fopen(fileName,"r"); + if (!preYYin) + { + err("Error: could not open file %s\n",fileName); + return; + } + } + else + { + QCString cmd = Config::inputFilter+" "+fileName; + preYYin = popen(cmd,"r"); + if (!preYYin) + { + err("Error: could not execute filter %s\n",cmd.data()); + return; + } + } + yyLineNr = 1; + level = 0; + ifcount = 0; + yyFileName = fileName; + BEGIN( Start ); + + lastGuardName.resize(0); + guardExpr.resize(0); + + preYYlex(); + if (Config::inputFilter.isEmpty()) + fclose(preYYin); + else + pclose(preYYin); + +#if DUMP_OUTPUT + char *orgPos=output.data()+orgOffset; + char *newPos=output.data()+output.curPos(); + printf("Resulting size: %d bytes\n",newPos-orgPos); + int line=1; + printf("---------\n00001 "); + while (orgPos<newPos) + { + putchar(*orgPos); + if (*orgPos=='\n') printf("%05d ",++line); + orgPos++; + } + printf("\n---------\n"); +#endif +} + +extern "C" { // some bogus code to keep the compiler happy +// int preYYwrap() { return 1 ; } + void preYYdummy() { yy_flex_realloc(0,0); } +} |