preparse.c

00001 #line 2 "preparse.c"
00002 
00003 #line 4 "preparse.c"
00004 
00005 #define  YY_INT_ALIGNED short int
00006 
00007 /* A lexical scanner generated by flex */
00008 
00009 #define FLEX_SCANNER
00010 #define YY_FLEX_MAJOR_VERSION 2
00011 #define YY_FLEX_MINOR_VERSION 5
00012 #define YY_FLEX_SUBMINOR_VERSION 31
00013 #if YY_FLEX_SUBMINOR_VERSION > 0
00014 #define FLEX_BETA
00015 #endif
00016 
00017 /* First, we deal with  platform-specific or compiler-specific issues. */
00018 
00019 /* begin standard C headers. */
00020 #include <stdio.h>
00021 #include <string.h>
00022 #include <errno.h>
00023 #include <stdlib.h>
00024 
00025 /* end standard C headers. */
00026 
00027 /* flex integer type definitions */
00028 
00029 #ifndef FLEXINT_H
00030 #define FLEXINT_H
00031 
00032 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
00033 
00034 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
00035 #include <inttypes.h>
00036 typedef int8_t flex_int8_t;
00037 typedef uint8_t flex_uint8_t;
00038 typedef int16_t flex_int16_t;
00039 typedef uint16_t flex_uint16_t;
00040 typedef int32_t flex_int32_t;
00041 typedef uint32_t flex_uint32_t;
00042 #else
00043 typedef signed char flex_int8_t;
00044 typedef short int flex_int16_t;
00045 typedef int flex_int32_t;
00046 typedef unsigned char flex_uint8_t; 
00047 typedef unsigned short int flex_uint16_t;
00048 typedef unsigned int flex_uint32_t;
00049 #endif /* ! C99 */
00050 
00051 /* Limits of integral types. */
00052 #ifndef INT8_MIN
00053 #define INT8_MIN               (-128)
00054 #endif
00055 #ifndef INT16_MIN
00056 #define INT16_MIN              (-32767-1)
00057 #endif
00058 #ifndef INT32_MIN
00059 #define INT32_MIN              (-2147483647-1)
00060 #endif
00061 #ifndef INT8_MAX
00062 #define INT8_MAX               (127)
00063 #endif
00064 #ifndef INT16_MAX
00065 #define INT16_MAX              (32767)
00066 #endif
00067 #ifndef INT32_MAX
00068 #define INT32_MAX              (2147483647)
00069 #endif
00070 #ifndef UINT8_MAX
00071 #define UINT8_MAX              (255U)
00072 #endif
00073 #ifndef UINT16_MAX
00074 #define UINT16_MAX             (65535U)
00075 #endif
00076 #ifndef UINT32_MAX
00077 #define UINT32_MAX             (4294967295U)
00078 #endif
00079 
00080 #endif /* ! FLEXINT_H */
00081 
00082 #ifdef __cplusplus
00083 
00084 /* The "const" storage-class-modifier is valid. */
00085 #define YY_USE_CONST
00086 
00087 #else   /* ! __cplusplus */
00088 
00089 #if __STDC__
00090 
00091 #define YY_USE_CONST
00092 
00093 #endif  /* __STDC__ */
00094 #endif  /* ! __cplusplus */
00095 
00096 #ifdef YY_USE_CONST
00097 #define yyconst const
00098 #else
00099 #define yyconst
00100 #endif
00101 
00102 /* Returned upon end-of-file. */
00103 #define YY_NULL 0
00104 
00105 /* Promotes a possibly negative, possibly signed char to an unsigned
00106  * integer for use as an array index.  If the signed char is negative,
00107  * we want to instead treat it as an 8-bit unsigned char, hence the
00108  * double cast.
00109  */
00110 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
00111 
00112 /* Enter a start condition.  This macro really ought to take a parameter,
00113  * but we do it the disgusting crufty way forced on us by the ()-less
00114  * definition of BEGIN.
00115  */
00116 #define BEGIN (yy_start) = 1 + 2 *
00117 
00118 /* Translate the current start state into a value that can be later handed
00119  * to BEGIN to return to the state.  The YYSTATE alias is for lex
00120  * compatibility.
00121  */
00122 #define YY_START (((yy_start) - 1) / 2)
00123 #define YYSTATE YY_START
00124 
00125 /* Action number for EOF rule of a given start state. */
00126 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
00127 
00128 /* Special action meaning "start processing a new file". */
00129 #define YY_NEW_FILE mgdlibrestart(mgdlibin  )
00130 
00131 #define YY_END_OF_BUFFER_CHAR 0
00132 
00133 /* Size of default input buffer. */
00134 #ifndef YY_BUF_SIZE
00135 #define YY_BUF_SIZE 16384
00136 #endif
00137 
00138 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
00139 #define YY_TYPEDEF_YY_BUFFER_STATE
00140 typedef struct yy_buffer_state *YY_BUFFER_STATE;
00141 #endif
00142 
00143 extern int mgdlibleng;
00144 
00145 extern FILE *mgdlibin, *mgdlibout;
00146 
00147 #define EOB_ACT_CONTINUE_SCAN 0
00148 #define EOB_ACT_END_OF_FILE 1
00149 #define EOB_ACT_LAST_MATCH 2
00150 
00151     #define YY_LESS_LINENO(n)
00152     
00153 /* Return all but the first "n" matched characters back to the input stream. */
00154 #define yyless(n) \
00155         do \
00156                 { \
00157                 /* Undo effects of setting up mgdlibtext. */ \
00158         int yyless_macro_arg = (n); \
00159         YY_LESS_LINENO(yyless_macro_arg);\
00160                 *yy_cp = (yy_hold_char); \
00161                 YY_RESTORE_YY_MORE_OFFSET \
00162                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
00163                 YY_DO_BEFORE_ACTION; /* set up mgdlibtext again */ \
00164                 } \
00165         while ( 0 )
00166 
00167 #define unput(c) yyunput( c, (yytext_ptr)  )
00168 
00169 /* The following is because we cannot portably get our hands on size_t
00170  * (without autoconf's help, which isn't available because we want
00171  * flex-generated scanners to compile on their own).
00172  */
00173 
00174 #ifndef YY_TYPEDEF_YY_SIZE_T
00175 #define YY_TYPEDEF_YY_SIZE_T
00176 typedef unsigned int yy_size_t;
00177 #endif
00178 
00179 #ifndef YY_STRUCT_YY_BUFFER_STATE
00180 #define YY_STRUCT_YY_BUFFER_STATE
00181 struct yy_buffer_state
00182         {
00183         FILE *yy_input_file;
00184 
00185         char *yy_ch_buf;                /* input buffer */
00186         char *yy_buf_pos;               /* current position in input buffer */
00187 
00188         /* Size of input buffer in bytes, not including room for EOB
00189          * characters.
00190          */
00191         yy_size_t yy_buf_size;
00192 
00193         /* Number of characters read into yy_ch_buf, not including EOB
00194          * characters.
00195          */
00196         int yy_n_chars;
00197 
00198         /* Whether we "own" the buffer - i.e., we know we created it,
00199          * and can realloc() it to grow it, and should free() it to
00200          * delete it.
00201          */
00202         int yy_is_our_buffer;
00203 
00204         /* Whether this is an "interactive" input source; if so, and
00205          * if we're using stdio for input, then we want to use getc()
00206          * instead of fread(), to make sure we stop fetching input after
00207          * each newline.
00208          */
00209         int yy_is_interactive;
00210 
00211         /* Whether we're considered to be at the beginning of a line.
00212          * If so, '^' rules will be active on the next match, otherwise
00213          * not.
00214          */
00215         int yy_at_bol;
00216 
00217     int yy_bs_lineno; 
00218     int yy_bs_column; 
00220         /* Whether to try to fill the input buffer when we reach the
00221          * end of it.
00222          */
00223         int yy_fill_buffer;
00224 
00225         int yy_buffer_status;
00226 
00227 #define YY_BUFFER_NEW 0
00228 #define YY_BUFFER_NORMAL 1
00229         /* When an EOF's been seen but there's still some text to process
00230          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
00231          * shouldn't try reading from the input source any more.  We might
00232          * still have a bunch of tokens to match, though, because of
00233          * possible backing-up.
00234          *
00235          * When we actually see the EOF, we change the status to "new"
00236          * (via mgdlibrestart()), so that the user can continue scanning by
00237          * just pointing mgdlibin at a new input file.
00238          */
00239 #define YY_BUFFER_EOF_PENDING 2
00240 
00241         };
00242 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
00243 
00244 /* Stack of input buffers. */
00245 static size_t yy_buffer_stack_top = 0; 
00246 static size_t yy_buffer_stack_max = 0; 
00247 static YY_BUFFER_STATE * yy_buffer_stack = 0; 
00249 /* We provide macros for accessing buffer states in case in the
00250  * future we want to put the buffer states in a more general
00251  * "scanner state".
00252  *
00253  * Returns the top of the stack, or NULL.
00254  */
00255 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
00256                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
00257                           : NULL)
00258 
00259 /* Same as previous macro, but useful when we know that the buffer stack is not
00260  * NULL or when we need an lvalue. For internal use only.
00261  */
00262 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
00263 
00264 /* yy_hold_char holds the character lost when mgdlibtext is formed. */
00265 static char yy_hold_char;
00266 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
00267 int mgdlibleng;
00268 
00269 /* Points to current character in buffer. */
00270 static char *yy_c_buf_p = (char *) 0;
00271 static int yy_init = 1;         /* whether we need to initialize */
00272 static int yy_start = 0;        /* start state number */
00273 
00274 /* Flag which is used to allow mgdlibwrap()'s to do buffer switches
00275  * instead of setting up a fresh mgdlibin.  A bit of a hack ...
00276  */
00277 static int yy_did_buffer_switch_on_eof;
00278 
00279 void mgdlibrestart (FILE *input_file  );
00280 void mgdlib_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
00281 YY_BUFFER_STATE mgdlib_create_buffer (FILE *file,int size  );
00282 void mgdlib_delete_buffer (YY_BUFFER_STATE b  );
00283 void mgdlib_flush_buffer (YY_BUFFER_STATE b  );
00284 void mgdlibpush_buffer_state (YY_BUFFER_STATE new_buffer  );
00285 void mgdlibpop_buffer_state (void );
00286 
00287 static void mgdlibensure_buffer_stack (void );
00288 static void mgdlib_load_buffer_state (void );
00289 static void mgdlib_init_buffer (YY_BUFFER_STATE b,FILE *file  );
00290 
00291 #define YY_FLUSH_BUFFER mgdlib_flush_buffer(YY_CURRENT_BUFFER )
00292 
00293 YY_BUFFER_STATE mgdlib_scan_buffer (char *base,yy_size_t size  );
00294 YY_BUFFER_STATE mgdlib_scan_string (yyconst char *yy_str  );
00295 YY_BUFFER_STATE mgdlib_scan_bytes (yyconst char *bytes,int len  );
00296 
00297 void *mgdliballoc (yy_size_t  );
00298 void *mgdlibrealloc (void *,yy_size_t  );
00299 void mgdlibfree (void *  );
00300 
00301 #define yy_new_buffer mgdlib_create_buffer
00302 
00303 #define yy_set_interactive(is_interactive) \
00304         { \
00305         if ( ! YY_CURRENT_BUFFER ){ \
00306         mgdlibensure_buffer_stack (); \
00307                 YY_CURRENT_BUFFER_LVALUE =    \
00308             mgdlib_create_buffer(mgdlibin,YY_BUF_SIZE ); \
00309         } \
00310         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
00311         }
00312 
00313 #define yy_set_bol(at_bol) \
00314         { \
00315         if ( ! YY_CURRENT_BUFFER ){\
00316         mgdlibensure_buffer_stack (); \
00317                 YY_CURRENT_BUFFER_LVALUE =    \
00318             mgdlib_create_buffer(mgdlibin,YY_BUF_SIZE ); \
00319         } \
00320         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
00321         }
00322 
00323 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
00324 
00325 /* Begin user sect3 */
00326 
00327 typedef unsigned char YY_CHAR;
00328 
00329 FILE *mgdlibin = (FILE *) 0, *mgdlibout = (FILE *) 0;
00330 
00331 typedef int yy_state_type;
00332 
00333 extern int mgdliblineno;
00334 
00335 int mgdliblineno = 1;
00336 
00337 extern char *mgdlibtext;
00338 #define yytext_ptr mgdlibtext
00339 
00340 static yy_state_type yy_get_previous_state (void );
00341 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
00342 static int yy_get_next_buffer (void );
00343 static void yy_fatal_error (yyconst char msg[]  );
00344 
00345 /* Done after the current pattern has been matched and before the
00346  * corresponding action - sets up mgdlibtext.
00347  */
00348 #define YY_DO_BEFORE_ACTION \
00349         (yytext_ptr) = yy_bp; \
00350         mgdlibleng = (size_t) (yy_cp - yy_bp); \
00351         (yy_hold_char) = *yy_cp; \
00352         *yy_cp = '\0'; \
00353         (yy_c_buf_p) = yy_cp;
00354 
00355 #define YY_NUM_RULES 48
00356 #define YY_END_OF_BUFFER 49
00357 /* This struct is not used in this scanner,
00358    but its presence is necessary. */
00359 struct yy_trans_info
00360         {
00361         flex_int32_t yy_verify;
00362         flex_int32_t yy_nxt;
00363         };
00364 static yyconst flex_int16_t yy_accept[356] =
00365     {   0,
00366         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00367         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00368         0,    0,    0,    0,   49,    6,    6,    6,    6,   29,
00369        29,   11,   20,   10,   29,   29,   29,   29,   29,   15,
00370        15,   14,   15,   19,   19,   18,   19,   22,   22,   21,
00371        22,   22,   25,   25,   25,   38,   38,   31,   30,   34,
00372        34,   33,   34,   37,   37,   36,   37,   47,   47,   40,
00373        39,   43,   43,   42,   43,   46,   46,   45,   46,    0,
00374         0,    5,    0,    0,    0,    0,   23,   20,    0,    7,
00375         0,    0,   13,   12,   17,   16,    0,   21,   24,   32,
00376 
00377        35,   41,   44,    0,    0,    0,    0,    0,    0,    0,
00378         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00379         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00380         0,    0,    0,    4,    0,    0,    0,    0,    0,    0,
00381         0,    0,    3,    5,    0,    0,    0,    0,    0,    0,
00382         9,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00383         0,    0,    0,    0,    3,    0,    0,    0,    0,    0,
00384         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00385         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00386         0,    0,    0,    0,    0,    0,    0,    8,    0,    0,
00387 
00388         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00389         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00390         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00391         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00392         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00393         0,    0,    0,    0,    0,    0,    0,   28,    0,    0,
00394         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00395         0,    0,    0,    0,    0,    0,    0,    1,    0,    0,
00396         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00397         0,    0,    0,    0,    0,   26,    0,   27,    0,    0,
00398 
00399         0,    0,    0,    0,    0,    0,    2,    0,    0,    0,
00400         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00401         0,    0,    0,    0,    0,    0,    0,    0,    0,    1,
00402         0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
00403         0,    0,    0,    0,    0,    0,    0,    0,    0,    2,
00404         0,    0,    2,    0,    0
00405     } ;
00406 
00407 static yyconst flex_int32_t yy_ec[256] =
00408     {   0,
00409         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
00410         1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
00411         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
00412         1,    5,    1,    6,    7,    1,    1,    8,    9,   10,
00413        11,   12,    1,    1,   13,   14,   15,   16,   16,   16,
00414        16,   16,   16,   16,   16,   16,   16,   17,   18,   19,
00415        20,   21,   22,    1,   23,   24,   25,   24,   26,   27,
00416        28,   29,   30,   24,   24,   24,   31,   24,   24,   24,
00417        24,   32,   33,   24,   24,   24,   24,   24,   24,   24,
00418        34,   35,   36,    1,   37,    1,   38,   24,   39,   40,
00419 
00420        41,   27,   42,   43,   44,   24,   24,   45,   46,   47,
00421        48,   49,   50,   51,   52,   53,   54,   55,   56,   24,
00422        24,   24,    1,    1,    1,    1,   57,   57,   57,   57,
00423        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00424        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00425        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00426        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00427        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00428        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00429        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00430 
00431        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00432        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00433        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00434        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00435        57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
00436        57,   57,   57,   57,   57
00437     } ;
00438 
00439 static yyconst flex_int32_t yy_meta[58] =
00440     {   0,
00441         1,    1,    2,    1,    3,    4,    1,    1,    4,    1,
00442         5,    1,    6,    7,    1,    8,    9,    1,    1,    1,
00443        10,    1,   11,   11,   11,   11,   11,   11,   11,   11,
00444        11,   11,   11,    7,    1,   12,   13,   11,   11,   11,
00445        11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
00446        11,   11,   11,   11,   11,   11,    3
00447     } ;
00448 
00449 static yyconst flex_int16_t yy_base[397] =
00450     {   0,
00451         0,    5,   23,   68,   12,   31,   44,   49,   89,   93,
00452        55,   76,   97,  114,  120,  126,  132,  137,  142,  148,
00453       154,  160,  169,  174, 1029, 1291, 1291, 1012,  176, 1291,
00454      1291, 1291, 1291, 1291,    0, 1005,  992,  956,  968, 1291,
00455      1291, 1291,    2, 1291, 1291, 1291,   17, 1291, 1291, 1291,
00456       993,  985, 1291, 1291,  990, 1291, 1291, 1291, 1291, 1291,
00457      1291, 1291,  991, 1291, 1291, 1291,  983, 1291, 1291, 1291,
00458      1291, 1291, 1291, 1291,  978, 1291, 1291, 1291,  980,  947,
00459         0,  933,   15,   10,    0,  942, 1291, 1291,  926, 1291,
00460       781,  778, 1291, 1291, 1291, 1291,  765, 1291, 1291, 1291,
00461 
00462      1291, 1291, 1291,  171,  179,  804,  771,   33,  165,   40,
00463       774,  757,  768,  761,  768,  765,  785,  781,  763,  204,
00464       785,  213,  213,  773,  744,  205,   52,  771,  744,  732,
00465       239,  210,  730, 1291,    9,   54,  769,  765,  755,   27,
00466       726,  720,  123, 1291,   78,   80,  204,  695,  698,  255,
00467      1291,  681,  677,  682,  675,  673,  149,  166,  707,  674,
00468       696,  170,  663,  659, 1291,  182,  238,  640,  640,  637,
00469       635,  606,  591,  586,  258,  220,  271,  581,  584,  583,
00470       569,  562,  563,  237,  272,  280,  289,  293,  558,  558,
00471       563,  309,  273,  266,  555,  317,  329, 1291,  552,  540,
00472 
00473       545,  338,  306,  116,  536,  532,  524,  519,  286,  284,
00474       519,  522,  516,  508,  327,  312,  485,  486,  478,  483,
00475       294,  329,  477,  461,  450,  452,  332,  237,  442,  434,
00476       426,  420,  342,  339,  413,  402,  401,  395,  359,   25,
00477       368,  373,  410,  391,  359,  418,  355,  382,  418,  384,
00478        80,  420,  429,  460,  358,  351,  471, 1291,  366,  364,
00479       456,  357,  473,  334,  348,  480,  518,  304,  258,  257,
00480       216,  215,  220,  218,  375,  497,  435, 1291,  459,  202,
00481       522,  169,  148,   96,  531,  542,  335,  469,  542,  529,
00482       551,   91,   84,  573,  585, 1291,  594, 1291,   96,  417,
00483 
00484       537,  549,  462,  104,   91,  603, 1291,  604,  588,  605,
00485       594,  601,  414,  599,  616,  624,  619,  633,  644,  651,
00486       648,  658,  669,  649,  676,  677,  226,  682,  698,  194,
00487       706,  687,  436,  267,  351,  720,  504,  726,  285,  186,
00488        42,  731,  739,  764,  598,  746,  766,  768,   18,  401,
00489       770,  701,    3,  769, 1291,  820,  833,  846,  859,  872,
00490       885,  898,  911,  924,  937,  950,  963,  966,  977,  990,
00491      1001, 1010, 1019, 1022, 1031, 1039, 1052, 1061, 1070, 1083,
00492      1096, 1102, 1108, 1121, 1134, 1147, 1160, 1173, 1186, 1199,
00493      1212, 1225, 1238, 1251, 1264, 1277
00494 
00495     } ;
00496 
00497 static yyconst flex_int16_t yy_def[397] =
00498     {   0,
00499       356,  356,  357,  357,  358,  358,  359,  359,  360,  360,
00500       361,  361,  362,  362,  363,  363,  364,  364,  365,  365,
00501       366,  366,  367,  367,  355,  355,  355,  355,  355,  355,
00502       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00503       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00504       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00505       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00506       355,  355,  355,  355,  355,  355,  355,  355,  355,  368,
00507       369,  355,  370,  355,  371,  355,  355,  355,  355,  355,
00508       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00509 
00510       355,  355,  355,  372,  373,  369,  355,  370,  370,  355,
00511       371,  355,  355,  355,  355,  355,  355,  355,  374,  372,
00512       375,  376,  373,  355,  355,  370,  377,  355,  355,  355,
00513       355,  355,  355,  355,  378,  379,  375,  380,  381,  355,
00514       382,  383,  355,  355,  370,  377,  377,  355,  355,  355,
00515       355,  355,  355,  355,  355,  355,  378,  379,  380,  355,
00516       381,  355,  382,  383,  355,  370,  377,  355,  355,  355,
00517       355,  355,  355,  355,  370,  377,  355,  355,  355,  355,
00518       355,  355,  355,  370,  377,  355,  355,  355,  355,  355,
00519       355,  355,  370,  377,  355,  355,  355,  355,  355,  355,
00520 
00521       355,  355,  370,  377,  355,  355,  355,  355,  370,  377,
00522       355,  355,  355,  355,  370,  377,  355,  355,  355,  355,
00523       370,  377,  355,  355,  355,  355,  370,  377,  355,  355,
00524       355,  355,  384,  377,  355,  355,  355,  355,  384,  385,
00525       384,  386,  355,  355,  355,  355,  387,  388,  384,  386,
00526       389,  386,  355,  355,  355,  355,  355,  355,  387,  390,
00527       387,  388,  384,  391,  392,  386,  355,  355,  355,  355,
00528       355,  355,  390,  390,  387,  384,  391,  355,  391,  392,
00529       386,  355,  355,  355,  355,  355,  390,  387,  384,  391,
00530       386,  355,  355,  355,  355,  355,  355,  355,  355,  387,
00531 
00532       387,  391,  391,  355,  355,  355,  355,  387,  387,  391,
00533       391,  387,  387,  391,  391,  387,  391,  387,  391,  387,
00534       391,  387,  391,  393,  394,  393,  395,  393,  394,  389,
00535       394,  387,  395,  396,  395,  393,  391,  394,  396,  396,
00536       390,  395,  393,  394,  396,  385,  393,  394,  388,  385,
00537       393,  391,  390,  387,    0,  355,  355,  355,  355,  355,
00538       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00539       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00540       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00541       355,  355,  355,  355,  355,  355
00542 
00543     } ;
00544 
00545 static yyconst flex_int16_t yy_nxt[1349] =
00546     {   0,
00547       355,   27,  355,   27,   27,  355,   27,   28,   27,   27,
00548        93,   87,   28,   41,   88,   41,   41,  355,   29,  117,
00549        42,  274,   95,   29,   31,  121,   31,   31,   32,   33,
00550       248,   34,   41,  248,   41,   41,   94,   35,  353,   42,
00551       110,   36,  140,  109,   37,   45,   43,   45,   45,   46,
00552        45,   96,   45,   45,   46,  110,   54,  109,   54,   54,
00553       274,  109,  162,   38,  117,   43,   55,  127,   39,   31,
00554       121,   31,   31,   32,   33,  109,   34,   54,   47,   54,
00555        54,  127,   35,   47,  147,  265,   36,   55,  265,   37,
00556        49,   50,   49,   49,   49,   50,   49,   49,   57,  294,
00557 
00558        57,   57,   58,  147,  166,   59,  109,   51,   38,  294,
00559        52,   51,  147,   39,   52,   57,  307,   57,   57,   58,
00560       109,   61,   59,   61,   61,  165,  165,   61,   62,   61,
00561        61,  147,  305,   65,   62,   65,   65,   66,   65,  304,
00562        65,   65,   66,   69,  294,   69,   69,   70,  147,   69,
00563        71,   69,   69,   70,   63,   73,   71,   73,   73,  117,
00564        63,   73,   74,   73,   73,  121,   67,  147,   74,  210,
00565        77,   67,   77,   77,   78,   77,  117,   77,   77,   78,
00566       117,  117,  121,  118,  119,   81,  121,  121,   75,  117,
00567       293,  118,  119,  109,   75,  121,  126,   82,   83,  265,
00568 
00569       345,  175,  265,   79,  122,   84,  341,  109,   79,   85,
00570       109,  292,  122,   83,  117,  126,  118,  119,  138,   84,
00571       121,  139,  278,  117,  109,  118,  119,   86,  140,  121,
00572       145,  334,  287,  109,  334,  167,  147,  122,  274,  185,
00573       150,  150,  150,  150,  335,  145,  122,  109,  151,  142,
00574       152,  234,  147,  153,  167,  147,  150,  150,  150,  150,
00575       154,  155,  176,  184,  151,  109,  184,  286,  285,  147,
00576       147,  147,  186,  186,  186,  186,  176,  194,  193,  109,
00577       194,  186,  186,  186,  186,  340,  109,  341,  147,  147,
00578       196,  196,  196,  196,  197,  197,  197,  197,  147,  284,
00579 
00580       109,  109,  198,  340,  147,  341,  283,  204,  227,   90,
00581       202,  202,  202,  202,  109,  109,  147,  147,  196,  196,
00582       196,  196,  109,  147,  195,  215,  203,  216,  109,   98,
00583       197,  197,  197,  197,  109,  147,  109,   90,  198,  202,
00584       202,  202,  202,  221,  147,  228,  233,  108,  109,  209,
00585       108,  222,  282,  242,  278,  109,  334,  299,   98,  334,
00586       109,  147,  240,  147,  247,  342,  279,  247,  278,  109,
00587       241,  147,  299,  247,  109,  260,  247,  260,  146,  240,
00588       147,  146,  274,  261,  241,  279,  260,  241,  240,  264,
00589       147,  272,  264,  251,  261,  260,  241,  261,  271,  249,
00590 
00591       288,  241,  260,  261,  251,  252,  248,  256,  261,  248,
00592       241,  253,  253,  253,  253,  288,  252,  261,  249,  257,
00593       257,  257,  257,  247,  252,  264,  247,  258,  264,  254,
00594       253,  253,  253,  253,  260,  252,  308,  260,  240,  255,
00595       251,  334,  261,  263,  334,  261,  241,  246,  254,  245,
00596       244,  266,  252,  243,  335,  278,  261,  316,  263,  261,
00597       241,  267,  267,  267,  267,  268,  238,  279,  269,  237,
00598       266,  252,  257,  257,  257,  257,  260,  236,  247,  278,
00599       258,  247,  278,  235,  261,  264,  279,  275,  264,  260,
00600       290,  279,  232,  240,  279,  300,  231,  261,  261,  276,
00601 
00602       251,  241,  247,  311,  281,  247,  275,  230,  270,  290,
00603       279,  261,  252,  279,  229,  241,  289,  240,  281,  267,
00604       267,  267,  267,  268,  278,  241,  269,  264,  226,  225,
00605       264,  252,  295,  295,  295,  295,  279,  224,  223,  241,
00606       296,  291,  251,  297,  297,  297,  297,  301,  220,  278,
00607       301,  298,  219,  302,  252,  279,  303,  260,  218,  303,
00608       217,  279,  240,  214,  213,  261,  270,  302,  310,  278,
00609       241,  251,  212,  252,  306,  306,  306,  306,  309,  261,
00610       279,  279,  211,  252,  241,  208,  295,  295,  295,  295,
00611       207,  206,  205,  144,  296,  297,  297,  297,  297,  201,
00612 
00613       279,  200,  252,  298,  306,  306,  306,  306,  260,  312,
00614       314,  199,  312,  314,  278,  192,  261,  191,  341,  278,
00615       349,  260,  190,  144,  260,  278,  279,  189,  188,  261,
00616       261,  279,  261,  187,  183,  349,  278,  279,  182,  278,
00617       311,  313,  309,  261,  260,  279,  261,  315,  279,  320,
00618       279,  279,  261,  260,  259,  181,  279,  259,  319,  317,
00619       321,  261,  323,  318,  278,  322,  261,  279,  278,  327,
00620       279,  260,  324,  180,  179,  261,  279,  328,  260,  261,
00621       279,  277,  332,  325,  277,  332,  261,  332,  178,  278,
00622       332,  328,  177,  261,  162,  279,  330,  327,  162,  279,
00623 
00624       261,  279,  327,  337,  160,  328,  337,  260,  331,  162,
00625       328,  337,  160,  336,  337,  261,  174,  173,  330,  328,
00626       279,  278,  172,  171,  328,  332,  330,  331,  332,  261,
00627       331,  337,  336,  279,  337,  170,  334,  338,  331,  334,
00628       327,  169,  311,  168,  332,  343,  330,  332,  328,  331,
00629       344,  248,  279,  346,  248,  162,  338,  331,  331,  327,
00630       343,  162,  328,  160,  344,  347,  350,  328,  346,  337,
00631       160,  332,  337,  352,  332,  354,  352,  331,  354,  117,
00632       156,  328,  149,  348,  330,  351,  327,  148,  330,  260,
00633       327,  143,  144,  143,  328,  117,  331,  261,  328,  136,
00634 
00635       331,  119,  134,  133,  132,  131,  130,  129,  328,  128,
00636       309,  261,  328,  125,  124,  331,  116,  115,  114,  331,
00637        26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
00638        26,   26,   26,   30,   30,   30,   30,   30,   30,   30,
00639        30,   30,   30,   30,   30,   30,   40,   40,   40,   40,
00640        40,   40,   40,   40,   40,   40,   40,   40,   40,   44,
00641        44,   44,   44,   44,   44,   44,   44,   44,   44,   44,
00642        44,   44,   48,   48,   48,   48,   48,   48,   48,   48,
00643        48,   48,   48,   48,   48,   53,   53,   53,   53,   53,
00644        53,   53,   53,   53,   53,   53,   53,   53,   56,   56,
00645 
00646        56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
00647        56,   60,   60,   60,   60,   60,   60,   60,   60,   60,
00648        60,   60,   60,   60,   64,   64,   64,   64,   64,   64,
00649        64,   64,   64,   64,   64,   64,   64,   68,   68,   68,
00650        68,   68,   68,   68,   68,   68,   68,   68,   68,   68,
00651        72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
00652        72,   72,   72,   76,   76,   76,   76,   76,   76,   76,
00653        76,   76,   76,   76,   76,   76,  104,  113,  104,  106,
00654       112,  107,  106,  105,  106,  103,  102,  106,  101,  106,
00655       108,  108,  108,  108,  108,  108,  108,  108,  108,  100,
00656 
00657       108,  108,  108,  111,   99,   98,  111,   97,  111,   92,
00658        91,  111,   90,  111,  120,  120,  120,  120,  120,   89,
00659       120,   80,  120,  123,  123,  123,  123,  123,  355,  123,
00660       355,  123,  135,  355,  135,  137,  355,  355,  355,  355,
00661       355,  137,  141,  355,  355,  355,  141,  355,  355,  141,
00662       355,  141,  146,  146,  146,  146,  146,  146,  146,  146,
00663       146,  355,  146,  146,  146,  157,  355,  355,  157,  157,
00664       355,  157,  355,  157,  158,  355,  355,  158,  158,  355,
00665       158,  355,  158,  159,  355,  159,  159,  159,  159,  159,
00666       159,  159,  159,  159,  159,  159,  161,  355,  161,  161,
00667 
00668       161,  161,  161,  161,  161,  161,  161,  161,  161,  163,
00669       355,  355,  163,  163,  163,  164,  355,  355,  164,  164,
00670       164,  239,  239,  239,  239,  239,  239,  239,  239,  239,
00671       239,  239,  239,  239,  240,  240,  240,  240,  240,  240,
00672       240,  240,  240,  240,  240,  240,  240,  250,  250,  250,
00673       250,  250,  250,  250,  250,  250,  250,  250,  250,  250,
00674       259,  259,  259,  259,  259,  259,  259,  259,  259,  259,
00675       259,  259,  259,  262,  262,  262,  262,  262,  262,  262,
00676       262,  262,  262,  262,  262,  262,  251,  251,  251,  251,
00677       251,  251,  251,  251,  251,  251,  251,  251,  251,  273,
00678 
00679       273,  273,  273,  273,  273,  273,  273,  273,  273,  273,
00680       273,  273,  277,  277,  277,  277,  277,  277,  277,  277,
00681       277,  277,  277,  277,  277,  280,  280,  280,  280,  280,
00682       280,  280,  280,  280,  280,  280,  280,  280,  326,  326,
00683       326,  326,  326,  326,  326,  326,  326,  326,  326,  326,
00684       326,  329,  329,  329,  329,  329,  329,  329,  329,  329,
00685       329,  329,  329,  329,  333,  333,  333,  333,  333,  333,
00686       333,  333,  333,  333,  333,  333,  333,  339,  339,  339,
00687       339,  339,  339,  339,  339,  339,  339,  339,  339,  339,
00688        25,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00689 
00690       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00691       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00692       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00693       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00694       355,  355,  355,  355,  355,  355,  355,  355
00695     } ;
00696 
00697 static yyconst flex_int16_t yy_chk[1349] =
00698     {   0,
00699         0,    1,    0,    1,    1,    0,    2,    1,    2,    2,
00700        43,   35,    2,    5,   35,    5,    5,    0,    1,  135,
00701         5,  353,   47,    2,    3,  135,    3,    3,    3,    3,
00702       240,    3,    6,  240,    6,    6,   43,    3,  349,    6,
00703        84,    3,  140,   83,    3,    7,    5,    7,    7,    7,
00704         8,   47,    8,    8,    8,   84,   11,   83,   11,   11,
00705       341,  108,  140,    3,  136,    6,   11,  110,    3,    4,
00706       136,    4,    4,    4,    4,  108,    4,   12,    7,   12,
00707        12,  110,    4,    8,  127,  251,    4,   12,  251,    4,
00708         9,    9,    9,    9,   10,   10,   10,   10,   13,  305,
00709 
00710        13,   13,   13,  127,  145,   13,  145,    9,    4,  304,
00711         9,   10,  146,    4,   10,   14,  299,   14,   14,   14,
00712       145,   15,   14,   15,   15,  143,  143,   16,   15,   16,
00713        16,  146,  293,   17,   16,   17,   17,   17,   18,  292,
00714        18,   18,   18,   19,  284,   19,   19,   19,  204,   20,
00715        19,   20,   20,   20,   15,   21,   20,   21,   21,  157,
00716        16,   22,   21,   22,   22,  157,   17,  204,   22,  204,
00717        23,   18,   23,   23,   23,   24,  158,   24,   24,   24,
00718       162,  104,  158,  104,  104,   29,  162,  104,   21,  105,
00719       283,  105,  105,  109,   22,  105,  109,   29,   29,  330,
00720 
00721       340,  166,  330,   23,  104,   29,  340,  109,   24,   29,
00722       166,  282,  105,   29,  120,  109,  120,  120,  122,   29,
00723       120,  122,  280,  123,  166,  123,  123,   29,  122,  123,
00724       126,  327,  274,  126,  327,  147,  147,  120,  273,  176,
00725       131,  131,  131,  131,  327,  126,  123,  126,  131,  122,
00726       132,  228,  176,  132,  147,  147,  150,  150,  150,  150,
00727       132,  132,  167,  175,  150,  184,  175,  272,  271,  228,
00728       167,  176,  177,  177,  177,  177,  167,  185,  184,  184,
00729       185,  186,  186,  186,  186,  334,  175,  334,  228,  167,
00730       187,  187,  187,  187,  188,  188,  188,  188,  194,  270,
00731 
00732       175,  193,  188,  339,  185,  339,  269,  194,  221,  187,
00733       192,  192,  192,  192,  209,  193,  210,  194,  196,  196,
00734       196,  196,  221,  185,  186,  209,  193,  210,  209,  192,
00735       197,  197,  197,  197,  203,  210,  221,  196,  197,  202,
00736       202,  202,  202,  215,  216,  222,  227,  233,  203,  203,
00737       233,  216,  268,  234,  264,  215,  335,  287,  202,  335,
00738       227,  222,  233,  216,  239,  335,  264,  239,  265,  215,
00739       233,  234,  287,  241,  227,  247,  241,  262,  242,  239,
00740       222,  242,  260,  247,  233,  264,  259,  239,  241,  250,
00741       234,  256,  250,  242,  259,  275,  241,  247,  255,  241,
00742 
00743       275,  239,  248,  275,  250,  242,  350,  245,  259,  350,
00744       241,  243,  243,  243,  243,  275,  250,  275,  241,  246,
00745       246,  246,  246,  249,  242,  252,  249,  246,  252,  243,
00746       253,  253,  253,  253,  313,  250,  300,  300,  249,  244,
00747       252,  333,  313,  249,  333,  300,  249,  238,  253,  237,
00748       236,  252,  252,  235,  333,  277,  313,  313,  249,  300,
00749       249,  254,  254,  254,  254,  254,  232,  277,  254,  231,
00750       252,  252,  257,  257,  257,  257,  261,  230,  263,  279,
00751       257,  263,  303,  229,  261,  266,  277,  261,  266,  288,
00752       279,  279,  226,  263,  303,  288,  225,  288,  261,  263,
00753 
00754       266,  263,  276,  303,  266,  276,  261,  224,  254,  279,
00755       279,  288,  266,  303,  223,  263,  276,  276,  266,  267,
00756       267,  267,  267,  267,  337,  276,  267,  281,  220,  219,
00757       281,  266,  285,  285,  285,  285,  337,  218,  217,  276,
00758       285,  281,  281,  286,  286,  286,  286,  289,  214,  290,
00759       289,  286,  213,  290,  281,  337,  291,  301,  212,  291,
00760       211,  290,  289,  208,  207,  301,  267,  290,  302,  302,
00761       289,  291,  206,  281,  294,  294,  294,  294,  301,  301,
00762       290,  302,  205,  291,  289,  201,  295,  295,  295,  295,
00763       200,  199,  195,  294,  295,  297,  297,  297,  297,  191,
00764 
00765       302,  190,  291,  297,  306,  306,  306,  306,  309,  308,
00766       310,  189,  308,  310,  311,  183,  309,  182,  345,  314,
00767       345,  312,  181,  306,  308,  310,  311,  180,  179,  312,
00768       309,  314,  308,  178,  174,  345,  315,  310,  173,  317,
00769       314,  309,  312,  312,  316,  311,  308,  311,  315,  318,
00770       314,  317,  316,  318,  324,  172,  310,  324,  317,  315,
00771       319,  318,  321,  316,  319,  320,  316,  315,  321,  324,
00772       317,  320,  322,  171,  170,  318,  319,  324,  322,  320,
00773       321,  325,  326,  323,  325,  326,  322,  328,  169,  323,
00774       328,  324,  168,  320,  164,  319,  325,  326,  163,  321,
00775 
00776       322,  323,  328,  329,  161,  326,  329,  332,  325,  160,
00777       328,  331,  159,  328,  331,  332,  156,  155,  329,  326,
00778       323,  352,  154,  153,  328,  336,  331,  325,  336,  332,
00779       329,  338,  328,  352,  338,  152,  342,  331,  331,  342,
00780       336,  149,  352,  148,  343,  336,  338,  343,  336,  329,
00781       338,  346,  352,  342,  346,  142,  331,  331,  338,  343,
00782       336,  141,  336,  139,  338,  343,  346,  343,  342,  344,
00783       138,  347,  344,  348,  347,  351,  348,  338,  351,  137,
00784       133,  343,  130,  344,  344,  347,  347,  129,  348,  354,
00785       351,  128,  125,  124,  347,  121,  344,  354,  351,  119,
00786 
00787       348,  118,  117,  116,  115,  114,  113,  112,  347,  111,
00788       354,  354,  351,  107,  106,  344,   97,   92,   91,  348,
00789       356,  356,  356,  356,  356,  356,  356,  356,  356,  356,
00790       356,  356,  356,  357,  357,  357,  357,  357,  357,  357,
00791       357,  357,  357,  357,  357,  357,  358,  358,  358,  358,
00792       358,  358,  358,  358,  358,  358,  358,  358,  358,  359,
00793       359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
00794       359,  359,  360,  360,  360,  360,  360,  360,  360,  360,
00795       360,  360,  360,  360,  360,  361,  361,  361,  361,  361,
00796       361,  361,  361,  361,  361,  361,  361,  361,  362,  362,
00797 
00798       362,  362,  362,  362,  362,  362,  362,  362,  362,  362,
00799       362,  363,  363,  363,  363,  363,  363,  363,  363,  363,
00800       363,  363,  363,  363,  364,  364,  364,  364,  364,  364,
00801       364,  364,  364,  364,  364,  364,  364,  365,  365,  365,
00802       365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
00803       366,  366,  366,  366,  366,  366,  366,  366,  366,  366,
00804       366,  366,  366,  367,  367,  367,  367,  367,  367,  367,
00805       367,  367,  367,  367,  367,  367,  368,   89,  368,  369,
00806        86,   82,  369,   80,  369,   79,   75,  369,   67,  369,
00807       370,  370,  370,  370,  370,  370,  370,  370,  370,   63,
00808 
00809       370,  370,  370,  371,   55,   52,  371,   51,  371,   39,
00810        38,  371,   37,  371,  372,  372,  372,  372,  372,   36,
00811       372,   28,  372,  373,  373,  373,  373,  373,   25,  373,
00812         0,  373,  374,    0,  374,  375,    0,    0,    0,    0,
00813         0,  375,  376,    0,    0,    0,  376,    0,    0,  376,
00814         0,  376,  377,  377,  377,  377,  377,  377,  377,  377,
00815       377,    0,  377,  377,  377,  378,    0,    0,  378,  378,
00816         0,  378,    0,  378,  379,    0,    0,  379,  379,    0,
00817       379,    0,  379,  380,    0,  380,  380,  380,  380,  380,
00818       380,  380,  380,  380,  380,  380,  381,    0,  381,  381,
00819 
00820       381,  381,  381,  381,  381,  381,  381,  381,  381,  382,
00821         0,    0,  382,  382,  382,  383,    0,    0,  383,  383,
00822       383,  384,  384,  384,  384,  384,  384,  384,  384,  384,
00823       384,  384,  384,  384,  385,  385,  385,  385,  385,  385,
00824       385,  385,  385,  385,  385,  385,  385,  386,  386,  386,
00825       386,  386,  386,  386,  386,  386,  386,  386,  386,  386,
00826       387,  387,  387,  387,  387,  387,  387,  387,  387,  387,
00827       387,  387,  387,  388,  388,  388,  388,  388,  388,  388,
00828       388,  388,  388,  388,  388,  388,  389,  389,  389,  389,
00829       389,  389,  389,  389,  389,  389,  389,  389,  389,  390,
00830 
00831       390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
00832       390,  390,  391,  391,  391,  391,  391,  391,  391,  391,
00833       391,  391,  391,  391,  391,  392,  392,  392,  392,  392,
00834       392,  392,  392,  392,  392,  392,  392,  392,  393,  393,
00835       393,  393,  393,  393,  393,  393,  393,  393,  393,  393,
00836       393,  394,  394,  394,  394,  394,  394,  394,  394,  394,
00837       394,  394,  394,  394,  395,  395,  395,  395,  395,  395,
00838       395,  395,  395,  395,  395,  395,  395,  396,  396,  396,
00839       396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
00840       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00841 
00842       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00843       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00844       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00845       355,  355,  355,  355,  355,  355,  355,  355,  355,  355,
00846       355,  355,  355,  355,  355,  355,  355,  355
00847     } ;
00848 
00849 static yy_state_type yy_last_accepting_state;
00850 static char *yy_last_accepting_cpos;
00851 
00852 extern int mgdlib_flex_debug;
00853 int mgdlib_flex_debug = 0;
00854 
00855 /* The intent behind this definition is that it'll catch
00856  * any uses of REJECT which flex missed.
00857  */
00858 #define REJECT reject_used_but_not_detected
00859 #define yymore() yymore_used_but_not_detected
00860 #define YY_MORE_ADJ 0
00861 #define YY_RESTORE_YY_MORE_OFFSET
00862 char *mgdlibtext;
00863 #line 1 "preparse.l"
00864 #line 2 "preparse.l"
00865 /* $Id: preparse.l,v 1.30 2006/05/30 14:32:25 piotras Exp $
00866 Copyright (C) 2000 Emile Heyns <emile@iris-advies.com>
00867 
00868 This program is free software; you can redistribute it and/or modify it
00869 under the terms of the GNU Lesser General Public License as published
00870 by the Free Software Foundation; either version 2 of the License, or
00871 (at your option) any later version.
00872 
00873 This program is distributed in the hope that it will be useful,
00874 but WITHOUT ANY WARRANTY; without even the implied warranty of
00875 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00876 GNU General Public License for more details.
00877 
00878 You should have received a copy of the GNU General Public License
00879 along with this program; if not, write to the Free Software
00880 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00881 */
00882 
00883 #include <config.h>
00884 #include "midgard/pageresolve.h"
00885 #include "midgard/midgard_legacy.h"
00886 
00887 static mgd_parser_itf_t mgd_parser_itf;
00888 
00889 #define mgd_parser_output_bytes(buffer, len) mgd_parser_itf.output.func(buffer, len, mgd_parser_itf.output.userdata)
00890 #define mgd_parser_output_str(string) mgd_parser_itf.output.func(string, strlen(string), mgd_parser_itf.output.userdata)
00891 #define mgd_parser_output_const(string) mgd_parser_itf.output.func(string, sizeof(string)-1, mgd_parser_itf.output.userdata)
00892 #define mgd_parser_output_char(charp) mgd_parser_itf.output.func(charp, 1, mgd_parser_itf.output.userdata)
00893 
00894 static GArray *parser_stack;
00895 static int paren_stack = 0;
00896 
00897 #if MIDGARD_PARSER_DEBUG
00898 static int other_match = 0;
00899 #endif
00900 
00901 static void mgd_fmt_start(char *fmt)
00902 {
00903    switch (*fmt) {
00904       case 'p':
00905       case 'P':
00906          mgd_parser_output_const("eval(' ?>'.mgd_preparse");
00907          break;
00908 
00909       case 'x':
00910          mgd_parser_output_const("mgd_execute_udf");
00911          break;
00912 
00913       default:
00914          mgd_parser_output_const("echo mgd_format");
00915          break;
00916    }
00917    mgd_parser_output_const("($");
00918 }
00919 
00920 static void mgd_fmt_end(char *fmt)
00921 {
00922    switch (*fmt) {
00923       case 'p':
00924       case 'P':
00925          mgd_parser_output_const(").'<?php '");
00926          break;
00927 
00928       case 'x':
00929          mgd_parser_output_const(",'");
00930          mgd_parser_output_str(fmt + 1); /*[eeh] skip 'x' */
00931          mgd_parser_output_const("'");
00932          break;
00933       case '\0':
00934          break;
00935 
00936       default:
00937          mgd_parser_output_const(", '");
00938          mgd_parser_output_str(fmt);
00939          mgd_parser_output_const("'");
00940          break;
00941    }
00942 
00943    mgd_parser_output_const(");");
00944 }
00945 
00946 static void mgd_preparse_ref(int mode) {
00947   char *guid;
00948   char *attrx, *attry;
00949   char *label;
00950   char *end;
00951   char *quot;
00952   char *textcpy = malloc ((mgdlibleng + 1) * sizeof(char));
00953   strcpy(textcpy, mgdlibtext);
00954   if ((attrx = strchr(mgdlibtext, ' ')) != NULL) {
00955     if (attrx < mgdlibtext + mgdlibleng - 1) {
00956       if ((guid = strstr(attrx, "\"guid://")) != NULL || (guid = strstr(attrx, "'guid://")) != NULL) {
00957         *guid = '\0';
00958         guid+=8;
00959         if (guid < mgdlibtext + mgdlibleng - 1) {
00960           if ((attry = strchr(guid, '\"')) != NULL || (attry = strchr(guid, '\'')) != NULL) {
00961             if (*(attry-1) == '/') {
00962               *(attry-1) = '\0';
00963             } else {
00964               *attry = '\0';
00965             }
00966             attry++;
00967             if (attry < mgdlibtext + mgdlibleng - 1 || mode) {
00968               if ((label = strchr(attry, '>')) != NULL) {
00969                 *label = '\0';
00970                 label++;
00971                 if (mode == 1) {
00972                 mgd_parser_output_const("<?=mgd_ref(");
00973                 mgd_parser_output_str(mode?"1,'":"0,'");
00974                 mgd_parser_output_str(guid);
00975                 mgd_parser_output_const("','");
00976                 quot = attrx;
00977                 while ((quot = strchr(quot, '\'')) != NULL) {
00978                   *quot = '"';
00979                 }
00980                 mgd_parser_output_str(attrx);
00981                 mgd_parser_output_const("','");
00982                 quot = attry;
00983                 while ((quot = strchr(quot, '\'')) != NULL) {
00984                   *quot = '"';
00985                 }
00986                 mgd_parser_output_str(attry);
00987                   mgd_parser_output_const("')?>");
00988                 } else {
00989                   if (label < mgdlibtext + mgdlibleng - 1) {
00990                     if ((end = strstr(label, "</a")) != NULL || (end = strstr(label, "</A")) != NULL) {
00991                       *end = '\0';
00992                       quot = label;
00993                       while ((quot = strchr(quot, '\'')) != NULL) {
00994                         *quot = '"';
00995                       }
00996                       mgd_parser_output_const("<?php ob_start(); eval(' ?>'.mgd_preparse('");
00997                       mgd_parser_output_str(label);
00998                       mgd_parser_output_const("').'<?php '); $PMEarlbQW91234012PIGGY = ob_get_contents(); ob_end_clean();");
00999                       mgd_parser_output_const("echo mgd_ref(");
01000                       mgd_parser_output_str(mode?"1,'":"0,'");
01001                       mgd_parser_output_str(guid);
01002                       mgd_parser_output_const("','");
01003                       quot = attrx;
01004                       while ((quot = strchr(quot, '\'')) != NULL) {
01005                         *quot = '"';
01006                       }
01007                       mgd_parser_output_str(attrx);
01008                       mgd_parser_output_const("','");
01009                       quot = attry;
01010                       while ((quot = strchr(quot, '\'')) != NULL) {
01011                         *quot = '"';
01012                       }
01013                       mgd_parser_output_str(attry);
01014                       mgd_parser_output_const("',$PMEarlbQW91234012PIGGY); unset($PMEarlbQW91234012PIGGY); ?>");
01015                     } else {
01016                       mgd_parser_output_str(textcpy);     
01017                     }
01018                   } else {
01019                     mgd_parser_output_str(textcpy);     
01020                   }
01021                 }           
01022               } else {
01023                 mgd_parser_output_str(textcpy);     
01024               }
01025             } else {
01026               mgd_parser_output_str(textcpy);     
01027             }
01028           } else {
01029             mgd_parser_output_str(textcpy);     
01030           }
01031         } else {
01032           mgd_parser_output_str(textcpy);     
01033         }
01034       } else {
01035         mgd_parser_output_str(textcpy);     
01036       }
01037     } else {
01038       mgd_parser_output_str(textcpy);     
01039     }
01040   }    else {
01041     mgd_parser_output_str(textcpy);     
01042   }
01043   free (textcpy);
01044 }
01045 
01046 #if MIDGARD_PARSER_DEBUG
01047 static void mgd_parser_log_other()
01048 {
01049    if (other_match == 0) return;
01050 
01051    fprintf(stderr, "MidgardParser: %d other\n", other_match);
01052    other_match = 0;
01053 }
01054 #endif
01055 
01056 
01057 
01058 
01059 
01060 
01061 
01062 
01063 
01064 
01065 
01066 #line 1067 "preparse.c"
01067 
01068 #define INITIAL 0
01069 #define IN_PHP 1
01070 #define IN_PHPQ 2
01071 #define IN_PHPQQ 3
01072 #define IN_LCOMMENT 4
01073 #define IN_BCOMMENT 5
01074 #define IN_SNIPPET 6
01075 #define IN_SNIPPETQ 7
01076 #define IN_SNIPPETQQ 8
01077 #define IN_EVAL 9
01078 #define IN_EVALQ 10
01079 #define IN_EVALQQ 11
01080 
01081 #ifndef YY_NO_UNISTD_H
01082 /* Special case for "unistd.h", since it is non-ANSI. We include it way
01083  * down here because we want the user's section 1 to have been scanned first.
01084  * The user has a chance to override it with an option.
01085  */
01086 #include <unistd.h>
01087 #endif
01088 
01089 #ifndef YY_EXTRA_TYPE
01090 #define YY_EXTRA_TYPE void *
01091 #endif
01092 
01093 /* Macros after this point can all be overridden by user definitions in
01094  * section 1.
01095  */
01096 
01097 #ifndef YY_SKIP_YYWRAP
01098 #ifdef __cplusplus
01099 extern "C" int mgdlibwrap (void );
01100 #else
01101 extern int mgdlibwrap (void );
01102 #endif
01103 #endif
01104 
01105     static void yyunput (int c,char *buf_ptr  );
01106     
01107 #ifndef yytext_ptr
01108 static void yy_flex_strncpy (char *,yyconst char *,int );
01109 #endif
01110 
01111 #ifdef YY_NEED_STRLEN
01112 static int yy_flex_strlen (yyconst char * );
01113 #endif
01114 
01115 #ifndef YY_NO_INPUT
01116 
01117 #ifdef __cplusplus
01118 static int yyinput (void );
01119 #else
01120 static int input (void );
01121 #endif
01122 
01123 #endif
01124 
01125         static int yy_start_stack_ptr = 0;
01126         static int yy_start_stack_depth = 0;
01127         static int *yy_start_stack = 0;
01128     
01129     static void yy_push_state (int new_state );
01130     
01131     static void yy_pop_state (void );
01132     
01133     static int yy_top_state (void );
01134     
01135 /* Amount of stuff to slurp up with each read. */
01136 #ifndef YY_READ_BUF_SIZE
01137 #define YY_READ_BUF_SIZE 8192
01138 #endif
01139 
01140 /* Copy whatever the last rule matched to the standard output. */
01141 #ifndef ECHO
01142 /* This used to be an fputs(), but since the string might contain NUL's,
01143  * we now use fwrite().
01144  */
01145 #define ECHO (void) fwrite( mgdlibtext, mgdlibleng, 1, mgdlibout )
01146 #endif
01147 
01148 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
01149  * is returned in "result".
01150  */
01151 #ifndef YY_INPUT
01152 #define YY_INPUT(buf,result,max_size) \
01153         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
01154                 { \
01155                 int c = '*'; \
01156                 size_t n; \
01157                 for ( n = 0; n < max_size && \
01158                              (c = getc( mgdlibin )) != EOF && c != '\n'; ++n ) \
01159                         buf[n] = (char) c; \
01160                 if ( c == '\n' ) \
01161                         buf[n++] = (char) c; \
01162                 if ( c == EOF && ferror( mgdlibin ) ) \
01163                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
01164                 result = n; \
01165                 } \
01166         else \
01167                 { \
01168                 errno=0; \
01169                 while ( (result = fread(buf, 1, max_size, mgdlibin))==0 && ferror(mgdlibin)) \
01170                         { \
01171                         if( errno != EINTR) \
01172                                 { \
01173                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
01174                                 break; \
01175                                 } \
01176                         errno=0; \
01177                         clearerr(mgdlibin); \
01178                         } \
01179                 }\
01180 \
01181 
01182 #endif
01183 
01184 /* No semi-colon after return; correct usage is to write "yyterminate();" -
01185  * we don't want an extra ';' after the "return" because that will cause
01186  * some compilers to complain about unreachable statements.
01187  */
01188 #ifndef yyterminate
01189 #define yyterminate() return YY_NULL
01190 #endif
01191 
01192 /* Number of entries by which start-condition stack grows. */
01193 #ifndef YY_START_STACK_INCR
01194 #define YY_START_STACK_INCR 25
01195 #endif
01196 
01197 /* Report a fatal error. */
01198 #ifndef YY_FATAL_ERROR
01199 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
01200 #endif
01201 
01202 /* end tables serialization structures and prototypes */
01203 
01204 /* Default declaration of generated scanner - a define so the user can
01205  * easily add parameters.
01206  */
01207 #ifndef YY_DECL
01208 #define YY_DECL_IS_OURS 1
01209 
01210 extern int mgdliblex (void);
01211 
01212 #define YY_DECL int mgdliblex (void)
01213 #endif /* !YY_DECL */
01214 
01215 /* Code executed at the beginning of each rule, after mgdlibtext and mgdlibleng
01216  * have been set up.
01217  */
01218 #ifndef YY_USER_ACTION
01219 #define YY_USER_ACTION
01220 #endif
01221 
01222 /* Code executed at the end of each rule. */
01223 #ifndef YY_BREAK
01224 #define YY_BREAK break;
01225 #endif
01226 
01227 #define YY_RULE_SETUP \
01228         YY_USER_ACTION
01229 
01232 YY_DECL
01233 {
01234         register yy_state_type yy_current_state;
01235         register char *yy_cp, *yy_bp;
01236         register int yy_act;
01237     
01238 #line 232 "preparse.l"
01239 
01240 
01241 #line 1242 "preparse.c"
01242 
01243         if ( (yy_init) )
01244                 {
01245                 (yy_init) = 0;
01246 
01247 #ifdef YY_USER_INIT
01248                 YY_USER_INIT;
01249 #endif
01250 
01251                 if ( ! (yy_start) )
01252                         (yy_start) = 1; /* first start state */
01253 
01254                 if ( ! mgdlibin )
01255                         mgdlibin = stdin;
01256 
01257                 if ( ! mgdlibout )
01258                         mgdlibout = stdout;
01259 
01260                 if ( ! YY_CURRENT_BUFFER ) {
01261                         mgdlibensure_buffer_stack ();
01262                         YY_CURRENT_BUFFER_LVALUE =
01263                                 mgdlib_create_buffer(mgdlibin,YY_BUF_SIZE );
01264                 }
01265 
01266                 mgdlib_load_buffer_state( );
01267                 }
01268 
01269         while ( 1 )             /* loops until end-of-file is reached */
01270                 {
01271                 yy_cp = (yy_c_buf_p);
01272 
01273                 /* Support of mgdlibtext. */
01274                 *yy_cp = (yy_hold_char);
01275 
01276                 /* yy_bp points to the position in yy_ch_buf of the start of
01277                  * the current run.
01278                  */
01279                 yy_bp = yy_cp;
01280 
01281                 yy_current_state = (yy_start);
01282 yy_match:
01283                 do
01284                         {
01285                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
01286                         if ( yy_accept[yy_current_state] )
01287                                 {
01288                                 (yy_last_accepting_state) = yy_current_state;
01289                                 (yy_last_accepting_cpos) = yy_cp;
01290                                 }
01291                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
01292                                 {
01293                                 yy_current_state = (int) yy_def[yy_current_state];
01294                                 if ( yy_current_state >= 356 )
01295                                         yy_c = yy_meta[(unsigned int) yy_c];
01296                                 }
01297                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
01298                         ++yy_cp;
01299                         }
01300                 while ( yy_base[yy_current_state] != 1291 );
01301 
01302 yy_find_action:
01303                 yy_act = yy_accept[yy_current_state];
01304                 if ( yy_act == 0 )
01305                         { /* have to back up */
01306                         yy_cp = (yy_last_accepting_cpos);
01307                         yy_current_state = (yy_last_accepting_state);
01308                         yy_act = yy_accept[yy_current_state];
01309                         }
01310 
01311                 YY_DO_BEFORE_ACTION;
01312 
01313 do_action:      /* This label is used only to access EOF actions. */
01314 
01315                 switch ( yy_act )
01316         { /* beginning of action switch */
01317                         case 0: /* must back up */
01318                         /* undo the effects of YY_DO_BEFORE_ACTION */
01319                         *yy_cp = (yy_hold_char);
01320                         yy_cp = (yy_last_accepting_cpos);
01321                         yy_current_state = (yy_last_accepting_state);
01322                         goto yy_find_action;
01323 
01324 case 1:
01325 /* rule 1 can match eol */
01326 YY_RULE_SETUP
01327 #line 234 "preparse.l"
01328 {
01329   mgd_preparse_ref(1);
01330 }
01331         YY_BREAK
01332 case 2:
01333 /* rule 2 can match eol */
01334 YY_RULE_SETUP
01335 #line 238 "preparse.l"
01336 {
01337   mgd_preparse_ref(0);
01338 }
01339         YY_BREAK
01340 case 3:
01341 /* rule 3 can match eol */
01342 YY_RULE_SETUP
01343 #line 242 "preparse.l"
01344 {
01345    const char *content = NULL;
01346    YY_BUFFER_STATE bstate;
01347 
01348    /* skip trainling newline */
01349    if (mgdlibtext[mgdlibleng - 1] != '>') mgdlibleng--;
01350 
01351    /* truncate string to skip ]> */
01352    mgdlibtext[mgdlibleng - 2] = '\0';
01353 
01354 #if MIDGARD_PARSER_DEBUG
01355    mgd_parser_log_other(); fprintf(stderr, "MidgardParser: template <[%s]>\n",  (const char*)mgdlibtext + 2);
01356 #endif
01357    /* skip first two chars to get name, get content */
01358    if (mgd_parser_itf.get_element.func != NULL)
01359       content = mgd_parser_itf.get_element.func((const char*)mgdlibtext + 2, mgd_parser_itf.get_element.userdata);
01360 
01361    if (content != NULL) {
01362       bstate = mgdlib_scan_string(content);
01363       g_array_append_val(parser_stack, bstate);
01364    }
01365 }
01366         YY_BREAK
01367 case 4:
01368 YY_RULE_SETUP
01369 #line 265 "preparse.l"
01370 {
01371    char *fmt;
01372    char *attr;
01373 
01374    /* truncate string to skip ); */
01375    mgdlibtext[mgdlibleng - 2] = '\0';
01376    mgdlibtext += 2;
01377 
01378 #if MIDGARD_PARSER_DEBUG
01379    mgd_parser_log_other(); fprintf(stderr, "MidgardParser: varformat &(%s);\n", mgdlibtext);
01380 #endif
01381    if ((fmt = strchr(mgdlibtext, ':')) != NULL) {
01382       *fmt = '\0';
01383       fmt++;
01384    } else {
01385       fmt = "";
01386    }
01387 
01388    if ((attr = strchr(mgdlibtext, '.')) != NULL) {
01389       *attr = '\0';
01390       attr++;
01391 
01392       mgd_parser_output_const("<?php ");
01393 
01394 #if MIDGARD_PREPARSER_FUDGE_ARRAYS
01395       mgd_parser_output_const("if (is_object($");
01396       mgd_parser_output_str(mgdlibtext);
01397       mgd_parser_output_const(")) { ");
01398 #endif
01399 
01400       mgd_fmt_start(fmt);
01401 
01402       mgd_parser_output_str(mgdlibtext);
01403       mgd_parser_output_const("->");
01404       mgd_parser_output_str(attr);
01405 
01406       mgd_fmt_end(fmt);
01407 
01408 #if MIDGARD_PREPARSER_FUDGE_ARRAYS
01409       mgd_parser_output_const(" } else { ");
01410 
01411       mgd_fmt_start(fmt);
01412 
01413       mgd_parser_output_str(mgdlibtext);
01414       mgd_parser_output_const("[");
01415       if (!isdigit(*attr)) mgd_parser_output_const("$");
01416       mgd_parser_output_str(attr);
01417       mgd_parser_output_const("]");
01418 
01419       mgd_fmt_end(fmt);
01420       mgd_parser_output_const(" }");
01421 #endif
01422       mgd_parser_output_const(" ?>");
01423    } else {
01424       mgd_parser_output_const("<?php ");
01425 
01426       mgd_fmt_start(fmt);
01427 
01428       mgd_parser_output_str(mgdlibtext);
01429 
01430       mgd_fmt_end(fmt);
01431 
01432       mgd_parser_output_const(" ?>");
01433    }
01434 }
01435         YY_BREAK
01436 case 5:
01437 /* rule 5 can match eol */
01438 YY_RULE_SETUP
01439 #line 331 "preparse.l"
01440 {
01441 #if MIDGARD_PARSER_DEBUG
01442    mgd_parser_log_other(); fprintf(stderr, "MidgardParser: start PHP\n");
01443 #endif
01444    mgd_parser_output_bytes(mgdlibtext, mgdlibleng);
01445    yy_push_state(IN_PHP);
01446 }
01447         YY_BREAK
01448 case 6:
01449 /* rule 6 can match eol */
01450 YY_RULE_SETUP
01451 #line 339 "preparse.l"
01452 {
01453 #if MIDGARD_PARSER_DEBUG
01454    other_match++;
01455 #endif
01456    mgd_parser_output_char(mgdlibtext);
01457 }
01458         YY_BREAK
01459 case 7:
01460 /* rule 7 can match eol */
01461 YY_RULE_SETUP
01462 #line 346 "preparse.l"
01463 {
01464 #if MIDGARD_PARSER_DEBUG
01465    mgd_parser_log_other(); fprintf(stderr,