Make deferral default in Shogi promotions
[xboard.git] / parser.c
1
2 #line 3 "parser.c"
3
4 #define  YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 34
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with  platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36  * if you want the limit (max/min) macros for int types. 
37  */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t; 
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56 #endif /* ! C99 */
57
58 /* Limits of integral types. */
59 #ifndef INT8_MIN
60 #define INT8_MIN               (-128)
61 #endif
62 #ifndef INT16_MIN
63 #define INT16_MIN              (-32767-1)
64 #endif
65 #ifndef INT32_MIN
66 #define INT32_MIN              (-2147483647-1)
67 #endif
68 #ifndef INT8_MAX
69 #define INT8_MAX               (127)
70 #endif
71 #ifndef INT16_MAX
72 #define INT16_MAX              (32767)
73 #endif
74 #ifndef INT32_MAX
75 #define INT32_MAX              (2147483647)
76 #endif
77 #ifndef UINT8_MAX
78 #define UINT8_MAX              (255U)
79 #endif
80 #ifndef UINT16_MAX
81 #define UINT16_MAX             (65535U)
82 #endif
83 #ifndef UINT32_MAX
84 #define UINT32_MAX             (4294967295U)
85 #endif
86
87 #endif /* ! FLEXINT_H */
88
89 #ifdef __cplusplus
90
91 /* The "const" storage-class-modifier is valid. */
92 #define YY_USE_CONST
93
94 #else   /* ! __cplusplus */
95
96 /* C99 requires __STDC__ to be defined as 1. */
97 #if defined (__STDC__)
98
99 #define YY_USE_CONST
100
101 #endif  /* defined (__STDC__) */
102 #endif  /* ! __cplusplus */
103
104 #ifdef YY_USE_CONST
105 #define yyconst const
106 #else
107 #define yyconst
108 #endif
109
110 /* Returned upon end-of-file. */
111 #define YY_NULL 0
112
113 /* Promotes a possibly negative, possibly signed char to an unsigned
114  * integer for use as an array index.  If the signed char is negative,
115  * we want to instead treat it as an 8-bit unsigned char, hence the
116  * double cast.
117  */
118 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
119
120 /* Enter a start condition.  This macro really ought to take a parameter,
121  * but we do it the disgusting crufty way forced on us by the ()-less
122  * definition of BEGIN.
123  */
124 #define BEGIN (yy_start) = 1 + 2 *
125
126 /* Translate the current start state into a value that can be later handed
127  * to BEGIN to return to the state.  The YYSTATE alias is for lex
128  * compatibility.
129  */
130 #define YY_START (((yy_start) - 1) / 2)
131 #define YYSTATE YY_START
132
133 /* Action number for EOF rule of a given start state. */
134 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
135
136 /* Special action meaning "start processing a new file". */
137 #define YY_NEW_FILE yyrestart(yyin  )
138
139 #define YY_END_OF_BUFFER_CHAR 0
140
141 /* Size of default input buffer. */
142 #ifndef YY_BUF_SIZE
143 #define YY_BUF_SIZE 16384
144 #endif
145
146 /* The state buf must be large enough to hold one state per character in the main buffer.
147  */
148 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
149
150 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
151 #define YY_TYPEDEF_YY_BUFFER_STATE
152 typedef struct yy_buffer_state *YY_BUFFER_STATE;
153 #endif
154
155 extern int yyleng;
156
157 extern FILE *yyin, *yyout;
158
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
162
163     #define YY_LESS_LINENO(n)
164     
165 /* Return all but the first "n" matched characters back to the input stream. */
166 #define yyless(n) \
167         do \
168                 { \
169                 /* Undo effects of setting up yytext. */ \
170         int yyless_macro_arg = (n); \
171         YY_LESS_LINENO(yyless_macro_arg);\
172                 *yy_cp = (yy_hold_char); \
173                 YY_RESTORE_YY_MORE_OFFSET \
174                 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
175                 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
176                 } \
177         while ( 0 )
178
179 #define unput(c) yyunput( c, (yytext_ptr)  )
180
181 /* The following is because we cannot portably get our hands on size_t
182  * (without autoconf's help, which isn't available because we want
183  * flex-generated scanners to compile on their own).
184  * Given that the standard has decreed that size_t exists since 1989,
185  * I guess we can afford to depend on it. Manoj.
186  */
187
188 #ifndef YY_TYPEDEF_YY_SIZE_T
189 #define YY_TYPEDEF_YY_SIZE_T
190 typedef size_t yy_size_t;
191 #endif
192
193 #ifndef YY_STRUCT_YY_BUFFER_STATE
194 #define YY_STRUCT_YY_BUFFER_STATE
195 struct yy_buffer_state
196         {
197         FILE *yy_input_file;
198
199         char *yy_ch_buf;                /* input buffer */
200         char *yy_buf_pos;               /* current position in input buffer */
201
202         /* Size of input buffer in bytes, not including room for EOB
203          * characters.
204          */
205         yy_size_t yy_buf_size;
206
207         /* Number of characters read into yy_ch_buf, not including EOB
208          * characters.
209          */
210         int yy_n_chars;
211
212         /* Whether we "own" the buffer - i.e., we know we created it,
213          * and can realloc() it to grow it, and should free() it to
214          * delete it.
215          */
216         int yy_is_our_buffer;
217
218         /* Whether this is an "interactive" input source; if so, and
219          * if we're using stdio for input, then we want to use getc()
220          * instead of fread(), to make sure we stop fetching input after
221          * each newline.
222          */
223         int yy_is_interactive;
224
225         /* Whether we're considered to be at the beginning of a line.
226          * If so, '^' rules will be active on the next match, otherwise
227          * not.
228          */
229         int yy_at_bol;
230
231     int yy_bs_lineno; /**< The line count. */
232     int yy_bs_column; /**< The column count. */
233     
234         /* Whether to try to fill the input buffer when we reach the
235          * end of it.
236          */
237         int yy_fill_buffer;
238
239         int yy_buffer_status;
240
241 #define YY_BUFFER_NEW 0
242 #define YY_BUFFER_NORMAL 1
243         /* When an EOF's been seen but there's still some text to process
244          * then we mark the buffer as YY_EOF_PENDING, to indicate that we
245          * shouldn't try reading from the input source any more.  We might
246          * still have a bunch of tokens to match, though, because of
247          * possible backing-up.
248          *
249          * When we actually see the EOF, we change the status to "new"
250          * (via yyrestart()), so that the user can continue scanning by
251          * just pointing yyin at a new input file.
252          */
253 #define YY_BUFFER_EOF_PENDING 2
254
255         };
256 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
257
258 /* Stack of input buffers. */
259 static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
260 static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
261 static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
262
263 /* We provide macros for accessing buffer states in case in the
264  * future we want to put the buffer states in a more general
265  * "scanner state".
266  *
267  * Returns the top of the stack, or NULL.
268  */
269 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
270                           ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
271                           : NULL)
272
273 /* Same as previous macro, but useful when we know that the buffer stack is not
274  * NULL or when we need an lvalue. For internal use only.
275  */
276 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
277
278 /* yy_hold_char holds the character lost when yytext is formed. */
279 static char yy_hold_char;
280 static int yy_n_chars;          /* number of characters read into yy_ch_buf */
281 int yyleng;
282
283 /* Points to current character in buffer. */
284 static char *yy_c_buf_p = (char *) 0;
285 static int yy_init = 0;         /* whether we need to initialize */
286 static int yy_start = 0;        /* start state number */
287
288 /* Flag which is used to allow yywrap()'s to do buffer switches
289  * instead of setting up a fresh yyin.  A bit of a hack ...
290  */
291 static int yy_did_buffer_switch_on_eof;
292
293 void yyrestart (FILE *input_file  );
294 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
295 YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
296 void yy_delete_buffer (YY_BUFFER_STATE b  );
297 void yy_flush_buffer (YY_BUFFER_STATE b  );
298 void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
299 void yypop_buffer_state (void );
300
301 static void yyensure_buffer_stack (void );
302 static void yy_load_buffer_state (void );
303 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
304
305 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
306
307 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
308 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
309 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
310
311 void *yyalloc (yy_size_t  );
312 void *yyrealloc (void *,yy_size_t  );
313 void yyfree (void *  );
314
315 #define yy_new_buffer yy_create_buffer
316
317 #define yy_set_interactive(is_interactive) \
318         { \
319         if ( ! YY_CURRENT_BUFFER ){ \
320         yyensure_buffer_stack (); \
321                 YY_CURRENT_BUFFER_LVALUE =    \
322             yy_create_buffer(yyin,YY_BUF_SIZE ); \
323         } \
324         YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
325         }
326
327 #define yy_set_bol(at_bol) \
328         { \
329         if ( ! YY_CURRENT_BUFFER ){\
330         yyensure_buffer_stack (); \
331                 YY_CURRENT_BUFFER_LVALUE =    \
332             yy_create_buffer(yyin,YY_BUF_SIZE ); \
333         } \
334         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
335         }
336
337 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
338
339 /* Begin user sect3 */
340
341 typedef unsigned char YY_CHAR;
342
343 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
344
345 typedef int yy_state_type;
346
347 extern int yylineno;
348
349 int yylineno = 1;
350
351 extern char *yytext;
352 #define yytext_ptr yytext
353
354 static yy_state_type yy_get_previous_state (void );
355 static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
356 static int yy_get_next_buffer (void );
357 static void yy_fatal_error (yyconst char msg[]  );
358
359 /* Done after the current pattern has been matched and before the
360  * corresponding action - sets up yytext.
361  */
362 #define YY_DO_BEFORE_ACTION \
363         (yytext_ptr) = yy_bp; \
364         yyleng = (size_t) (yy_cp - yy_bp); \
365         (yy_hold_char) = *yy_cp; \
366         *yy_cp = '\0'; \
367         (yy_c_buf_p) = yy_cp;
368
369 #define YY_NUM_RULES 43
370 #define YY_END_OF_BUFFER 44
371 /* This struct is not used in this scanner,
372    but its presence is necessary. */
373 struct yy_trans_info
374         {
375         flex_int32_t yy_verify;
376         flex_int32_t yy_nxt;
377         };
378 static yyconst flex_int16_t yy_acclist[646] =
379     {   0,
380        44,   42,   43,   42,   43,   42,   43,   41,   42,   43,
381        42,   43,   26,   42,   43,   42,   43,   41,   42,   43,
382        41,   42,   43,16411,   41,   42,   43,16411,   42,   43,
383        41,   42,   43,   41,   42,   43,   41,   42,   43,   41,
384        42,   43,   41,   42,   43,   41,   42,   43,   41,   42,
385        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
386        41,   42,   43,   42,   43,   41,   42,   43,   41,   42,
387        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
388        41,   42,   43,   41,   42,   43,   41,   42,   43,   41,
389        42,   43,   41,   42,   43,   41,   42,   43,   41,   42,
390
391        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
392        41,   42,   43,   41,   42,   43,   41,   42,   43,   42,
393        43,   42,   43,   41,   42,   43,   41,   42,   43,   41,
394        42,   43,16411,   41,   42,   43,16411,   42,   43,   41,
395        42,   43,   41,   42,   43,   41,   42,   43,   41,   42,
396        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
397        41,   42,   43,   41,   42,   43,   41,   42,   43,   41,
398        42,   43,   41,   42,   43,   41,   42,   43,   41,   42,
399        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
400        41,   42,   43,   41,   42,   43,   41,   42,   43,   41,
401
402        42,   43,   41,   42,   43,   41,   42,   43,   41,   42,
403        43,   41,   42,   43,   41,   42,   43,   41,   42,   43,
404        41,   42,   43,   41,   42,   43,   42,   43,   34,   41,
405        18,   41,   10,   41,   41,   41,16411, 8219,   41,   36,
406        41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
407        41,   10,   41,   41,   41,   41,   37,   41,    4,   41,
408        41,    5,   41,   41,   41,   41,   41,   41,   10,   41,
409        41,   41,   35,   41,   41,   10,   41,   41,   41,16411,
410      8219,   41,   41,   41,   41,   41,   41,   41,   41,   41,
411        41,   41,   41,   10,   41,   41,   41,   41,   41,    4,
412
413        41,   41,    5,   41,   41,   41,   41,   41,   41,   10,
414        41,   41,   41,   16,   10,   41,   24,   41,   24,    9,
415        41, 8219,   23,   41,   23,   25,   41,   41,   41,   41,
416        41,    7,   41,   41,   41,   41,   41,   41,   10,   41,
417        41,   41,   41,    5,   41,   41,    4,    4,   41,    4,
418        41,    4,    4,   41,    5,    6,   41,    5,    5,   41,
419        41,   41,   41,   10,   41,   41,   35,   40,   10,   41,
420        24,   41,    9,   41,   23,   41,   36,   41,   41,   41,
421        41,   41,    7,   41,   41,   41,   41,   41,   41,   10,
422        41,   41,   41,   41,    5,   41,   41,    4,   41,    4,
423
424        41,    4,   41,    6,   41,    5,   41,   41,   41,   41,
425        10,   41,   41,   39,   39,   39,   38,   26,   26,    7,
426        41,   11,    7,   41,    3,   41,    8,   41,    7,   41,
427         7,    7,   41,    7,   41,    7,   41,   41,   41,   20,
428        41,   41,   17,   41,   41,   41,   41,   41,   37,    4,
429        41,    2,   41,    6,    5,    6,    6,   41,    6,   41,
430         5,    5,   41,   41,   26,   40,   41,    7,   41,    3,
431        41,    8,   41,   41,    7,   41,    7,   41,   41,   41,
432        41,   20,   41,   41,   17,   41,   41,   41,   41,   41,
433        41,    2,   41,    6,   41,   41,    5,   41,   41,   39,
434
435         8,    7,    7,    3,    8,    8,   41,    8,    1,   41,
436        21,   41,   41,   20,   41,   41,   41,   41,   41,   41,
437        31,   37,    2,    2,    2,   41,    2,    6,    6,   41,
438        40,    8,   41,    1,   41,   41,   41,   20,   41,   41,
439        41,   41,   41,   41,    2,   41,    6,   41,   28,   39,
440         8,    1,   24,   24,   23,   23,   25,   25,    1,    1,
441        41,    1,   22,   21,   41,   41,   41,   12,   41,   41,
442        29,   37,   31,    2,   28,   35,   40,   40,    1,   41,
443        41,   41,   41,   12,   41,   41,   19,    1,   25,   22,
444        20,   41,   41,   41,   12,   41,   41,   41,   41,   41,
445
446        12,   41,   41,   13,   41,   41,   41,   41,   13,   41,
447        41,   15,   41,   41,   41,   15,   41,   41,   41,   40,
448        41,   41,   41,   41,   40,   40,   41,   41,   32,   41,
449        40,   40,   32,   41,   14,   32,   33,   33,   36,   40,
450        40,   32,   40,   35,   30
451     } ;
452
453 static yyconst flex_int16_t yy_accept[720] =
454     {   0,
455         1,    1,    1,    2,    4,    6,    8,   11,   13,   16,
456        18,   21,   25,   29,   31,   34,   37,   40,   43,   46,
457        49,   52,   55,   58,   61,   64,   66,   69,   72,   75,
458        78,   81,   84,   87,   90,   93,   96,   99,  102,  105,
459       108,  111,  114,  117,  120,  122,  124,  127,  130,  134,
460       138,  140,  143,  146,  149,  152,  155,  158,  161,  164,
461       167,  170,  173,  176,  179,  182,  185,  188,  191,  194,
462       197,  200,  203,  206,  209,  212,  215,  218,  221,  224,
463       227,  229,  229,  230,  231,  231,  231,  231,  231,  232,
464       232,  232,  232,  233,  233,  235,  235,  235,  235,  236,
465
466       236,  236,  238,  238,  240,  240,  241,  241,  242,  242,
467       243,  243,  244,  244,  245,  246,  247,  248,  249,  250,
468       251,  252,  254,  255,  256,  257,  257,  257,  257,  257,
469       258,  259,  261,  261,  262,  264,  265,  266,  267,  268,
470       269,  271,  272,  273,  273,  273,  273,  274,  274,  275,
471       275,  276,  278,  278,  279,  281,  281,  283,  283,  284,
472       285,  285,  286,  287,  288,  289,  290,  291,  292,  293,
473       294,  296,  297,  298,  299,  300,  302,  302,  303,  305,
474       306,  307,  308,  309,  310,  312,  313,  314,  314,  314,
475       314,  314,  314,  314,  314,  314,  314,  314,  314,  315,
476
477       315,  315,  315,  315,  315,  317,  319,  320,  322,  323,
478       323,  323,  323,  325,  326,  327,  327,  328,  328,  329,
479       329,  330,  331,  331,  332,  334,  334,  334,  334,  334,
480       334,  334,  334,  335,  336,  337,  338,  339,  341,  342,
481       343,  344,  344,  344,  344,  344,  346,  346,  347,  347,
482       348,  350,  352,  353,  355,  356,  356,  358,  359,  361,
483       362,  363,  364,  366,  367,  368,  368,  368,  368,  368,
484       369,  371,  373,  375,  377,  377,  378,  378,  379,  380,
485       380,  381,  382,  383,  385,  385,  386,  387,  388,  389,
486       390,  392,  393,  394,  395,  397,  398,  398,  400,  402,
487
488       404,  406,  408,  409,  410,  411,  413,  414,  414,  414,
489       415,  416,  416,  416,  417,  417,  417,  418,  418,  418,
490       419,  419,  420,  420,  421,  421,  421,  421,  422,  422,
491       422,  422,  422,  422,  422,  422,  423,  425,  425,  425,
492       427,  429,  430,  430,  431,  431,  432,  434,  436,  437,
493       438,  438,  438,  438,  438,  438,  438,  439,  440,  442,
494       442,  443,  445,  446,  447,  448,  449,  449,  449,  449,
495       449,  450,  451,  452,  452,  454,  455,  456,  456,  456,
496       457,  459,  460,  461,  462,  462,  464,  465,  465,  466,
497       466,  466,  466,  466,  467,  467,  468,  468,  468,  470,
498
499       472,  474,  475,  475,  477,  479,  480,  481,  482,  484,
500       485,  487,  488,  489,  490,  491,  492,  494,  496,  497,
501       499,  500,  500,  500,  500,  500,  501,  501,  501,  501,
502       501,  502,  503,  504,  504,  504,  504,  504,  504,  504,
503       504,  504,  504,  505,  505,  506,  508,  509,  511,  511,
504       511,  511,  511,  511,  512,  513,  514,  514,  516,  516,
505       517,  518,  519,  520,  521,  521,  521,  523,  523,  523,
506       524,  524,  525,  527,  528,  529,  529,  529,  531,  531,
507       531,  531,  531,  531,  531,  531,  532,  532,  532,  534,
508       536,  537,  538,  540,  541,  542,  543,  544,  545,  547,
509
510       549,  549,  549,  549,  549,  549,  549,  551,  551,  552,
511       553,  553,  554,  554,  555,  555,  556,  556,  557,  557,
512       558,  558,  559,  559,  559,  559,  560,  562,  563,  563,
513       563,  564,  564,  564,  565,  566,  566,  566,  566,  566,
514       566,  567,  568,  570,  571,  573,  573,  574,  575,  575,
515       575,  577,  577,  577,  578,  579,  579,  579,  581,  582,
516       583,  584,  586,  587,  587,  588,  588,  588,  588,  588,
517       589,  589,  590,  590,  590,  591,  591,  591,  592,  592,
518       592,  592,  592,  593,  594,  595,  597,  598,  598,  598,
519       598,  598,  598,  599,  600,  601,  603,  604,  604,  604,
520
521       604,  604,  604,  604,  605,  605,  605,  605,  605,  606,
522       607,  607,  607,  607,  607,  608,  609,  609,  609,  609,
523       609,  610,  610,  610,  610,  611,  612,  614,  614,  614,
524       614,  614,  615,  615,  616,  618,  618,  618,  618,  618,
525       619,  620,  620,  620,  620,  620,  621,  622,  623,  623,
526       623,  623,  623,  623,  624,  625,  625,  625,  625,  625,
527       626,  627,  628,  629,  629,  629,  629,  629,  629,  631,
528       631,  631,  631,  631,  632,  633,  635,  635,  635,  636,
529       636,  637,  637,  638,  638,  638,  640,  640,  641,  642,
530       642,  642,  642,  642,  644,  644,  644,  644,  644,  644,
531
532       644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
533       644,  644,  644,  644,  644,  644,  645,  646,  646
534     } ;
535
536 static yyconst flex_int32_t yy_ec[256] =
537     {   0,
538         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
539         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
540         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
541         1,    4,    1,    5,    6,    7,    8,    1,    9,   10,
542        11,   12,   13,    1,   14,   15,   16,   17,   18,   19,
543        20,   20,   20,   20,   20,   20,   20,   21,   22,    1,
544        23,    1,    1,   24,   25,   26,   27,   28,   29,   30,
545        31,   32,   33,   33,   34,   35,   36,   37,   38,   39,
546        39,   40,   41,   42,   43,   42,   44,   45,   42,   42,
547        46,    1,   47,   48,   49,    1,   50,   51,   52,   53,
548
549        54,   55,   56,   57,   58,   59,   60,   61,   62,   63,
550        64,   65,   66,   67,   68,   69,   70,   71,   72,   73,
551        74,   71,   75,    1,   76,    1,    1,    1,    1,    1,
552         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
553         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
554         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
555         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
556         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
557         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
558         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
559
560         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
561         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
562         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
563         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
564         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
565         1,    1,    1,    1,    1
566     } ;
567
568 static yyconst flex_int32_t yy_meta[77] =
569     {   0,
570         1,    2,    3,    2,    1,    1,    1,    1,    4,    5,
571         6,    1,    7,    8,    1,    1,    9,    9,    9,    9,
572        10,    1,   11,    1,   12,   12,   12,   12,   12,   12,
573        12,   12,   13,   12,   13,   13,   12,   12,   12,   12,
574        13,   13,   13,   12,   14,    1,    1,   15,    1,   16,
575        16,   16,   16,   17,   16,   16,   16,   16,   16,   16,
576        16,   18,   19,   19,   19,   19,   19,   18,   18,   18,
577        18,   18,   20,   18,    1,    1
578     } ;
579
580 static yyconst flex_int16_t yy_base[807] =
581     {   0,
582         0,   76, 3128, 4684,  128,  137,    0,  148, 3123,  146,
583       158,  178,  169, 3120,  241,  165, 3065, 3054,  126,  253,
584       249,  270,  257,  261,  300,  357,  420,  260,  272,  281,
585       286,  295,  337,  326,  339,  351,  293,  255,  152,  176,
586       400,  395,  418,  404,  426, 3116,  317,  446,  501,  478,
587       167,  567,  221, 3062, 3051,  164,  403,  439,  471,  494,
588       478,  576,  627,  545,  548,  584,  560,  553,  602,  450,
589       604,  367,  642,  644,  687,  697,  698,  704,  705,  711,
590       724, 3061,  612,    0, 3106,  299,  650,  181, 4684, 3102,
591       787,  731,  310, 3096, 3096, 3094,  521,  751, 3094,  671,
592
593       167,  735, 3093,    0, 3106, 4684,    0,  811,    0,  864,
594         0,  925,  971, 3058, 3053, 3056, 3061, 3033,  758, 3033,
595      3063, 3062, 3031, 3044, 3035, 3045, 1043,  309, 1119, 4684,
596      1146, 1199,    0, 1224, 1277,  762,  766,  770, 3022, 3026,
597      3025, 3020, 3029,  310, 3010,  810, 3081, 3080,  426, 3079,
598       752,  793,  381,  800, 1350,  338,  445,  448, 1416, 1469,
599      3078, 1530, 3031, 3025,  802,  655,  725,  774, 3009, 3039,
600       813, 3008,  938, 3017, 1554, 1607, 3070, 1632, 1685,  931,
601       944, 1051,  581,  945,  946,  750,  739,  812, 3002,  458,
602       473,  567,  679,  720, 1002,  839, 3057, 2991, 4684, 1059,
603
604      1064, 3062, 3059, 3048, 3033, 3042, 3041,    0, 4684, 3040,
605      3039, 3038, 3037, 3036,  578,  857,  893,  954, 1735, 1772,
606       972,  985, 1010, 1068, 1825, 1065, 2981, 2974, 2973, 2986,
607      2981,  633, 1022, 1094, 2962, 1010, 2979, 3018, 2973, 2969,
608      1141,  401, 1145,  719, 1899, 1966,    0, 1971,    0, 3018,
609      3016, 3015, 4684, 1134, 1158, 1425, 2023, 3015, 3013,  601,
610      2971, 2966, 3003, 2947, 4684, 1169, 1145, 3011,  198, 3011,
611      1170, 1135,  947, 1351,  760, 3009, 1060, 1432, 2069, 3008,
612      1437, 1536, 1533, 2122, 3007, 1762, 1907, 1419, 1908, 1161,
613      1352, 1763, 1162, 1913, 2188, 2193, 3006, 1066, 2998, 1799,
614
615      2245, 1418, 1417,  948, 1927, 1471, 1067, 1287, 2954, 4684,
616       788,  809,  825,  843,  869,  985, 4684, 1559, 2996, 2995,
617      2929, 2927, 1306, 2290, 2984, 2983, 2982, 2981,  950, 2976,
618       266, 2975, 1098, 1940,  638, 4684, 2354, 1941, 1379,    0,
619      2393, 1132, 1608, 2392, 1943, 1686, 2980, 2979, 4684, 1442,
620      2914, 2909, 2903, 2901, 2901, 2905, 2907, 2906,  792,  966,
621      1004,    0, 2927, 2908, 2909, 2907, 1416, 1417, 1164, 1729,
622      2955, 2948, 1498, 1554, 2065, 1895, 2947,  943, 1929, 1930,
623      2945, 4684, 1149, 4684, 2889,    0, 2887, 2289, 2946, 1952,
624      2352, 2897, 2878, 2938, 1113, 2026,  174, 1182, 2445, 1353,
625
626      2484, 2524, 2936, 1960, 2928, 2097, 2084, 2293, 2348, 2529,
627      1472, 1942, 2349, 2282, 2346, 2482, 2539, 2191, 2392, 1828,
628      1949, 2031, 2884, 1006, 2924, 1024, 1096, 1278, 1282, 1582,
629      2063, 2923, 2922, 1581, 2921, 2855, 2919, 2853, 2913, 2841,
630      2898, 2065, 4684, 2123, 2246, 2904, 4684, 2578, 2859, 2839,
631      2306, 2838, 2833, 2820, 2881, 1558, 2496, 2869, 1597, 2843,
632      2817, 2796, 2795, 2851, 1764, 2258, 4684, 2846, 2263, 2482,
633      2521, 2541, 2836, 4684, 2809, 1233, 2752,    0, 2799, 2551,
634      2794, 1951, 2794, 2748, 2734, 1354, 1774, 1770, 2350, 2619,
635      2531, 2534, 2661, 2657, 2487, 2071, 2581, 2664, 2660, 2525,
636
637      2621, 1645, 1423, 2787, 1585, 1612, 4684, 2673, 2786, 2664,
638      2784, 2783, 2717, 2714, 2774, 2772, 2705, 2703, 2759, 2749,
639      2678, 2677, 2733, 2728, 2665, 2666, 2720, 4684, 2660, 2652,
640      2626, 2019, 2648, 4684, 2652, 2689, 2625, 2565, 2609, 2582,
641      2593, 2565,  682, 2582, 4684, 2457, 4684, 2620, 2585, 2698,
642      2591, 2540, 2533, 2568, 2015, 1599,  428, 2687, 2690, 2698,
643      2700, 2701, 2711, 2627, 4684, 2511, 2531, 1690, 2716, 2528,
644      2533, 2494, 2434, 2437, 4684, 2406, 2456, 2452, 2393, 2452,
645      2376, 2338, 2363, 2310, 2319,    0, 2270, 2725, 2297, 2228,
646      1771,  344, 2716, 2720, 2729, 2616, 2737, 2745, 2232, 2221,
647
648      1799, 2145, 2137, 2244, 2147, 1773, 2128, 2070, 2821, 2058,
649      2053, 2012, 1935,  754, 2897, 2742, 2759, 1975, 1983, 1884,
650      4684, 1844, 1816, 1888, 2973, 1962,    0, 1813, 1777, 1982,
651      2073, 3049, 2203, 2085, 2743, 2762, 1763, 1754, 2542, 1661,
652      1490, 1423, 1402, 2196,  586, 2207, 1411, 1374, 2763, 1230,
653      1152, 2736, 2537, 1164, 1136, 1120, 1129, 2035, 1938, 2409,
654      2753, 1002,  943, 2772, 2308,  929, 2208, 2408,    0,  938,
655       832,  830, 2036, 2768, 2784,    0, 2777,  772, 4684,  676,
656      2541,  730, 4684,  492,  392, 4684, 2200, 2827, 2810, 2786,
657       328,  314, 2293, 2674, 2802,  253, 2669, 1543, 2033, 2165,
658
659      2804, 2805, 2846, 2847, 2851, 2860, 2872, 2873, 2876, 2879,
660      2881, 2886, 2911, 2923, 2334,  158, 4684, 4684, 3122, 3142,
661      3156, 3170, 3190, 3210, 3227, 3247, 3267, 3286, 2025, 2188,
662      2219, 3305, 3325, 2392, 3345, 3365, 3382, 3402, 3422, 3442,
663      3462, 3482, 3502, 3522, 3535, 3555, 3575, 3595, 3615, 3624,
664      2398, 3640, 3657, 3677, 3694, 3714, 3734, 3754, 3774, 3794,
665      3814, 3834, 3854, 3874, 3894, 3907, 3923, 3938, 3958, 3978,
666      3998, 4015, 4031, 4048, 4068, 4085, 4105, 4125, 4145, 4165,
667      4185, 4205, 4225, 4241, 4256, 4276, 4296, 4316, 4336, 4356,
668      4376, 4396, 4416, 4432, 4452, 4472, 4492, 4508, 4523, 4543,
669
670      4563, 4583, 4603, 4623, 4643, 4663
671     } ;
672
673 static yyconst flex_int16_t yy_def[807] =
674     {   0,
675       718,  718,  718,  718,  718,  718,  719,  720,  718,  721,
676       719,  718,   12,  722,  719,   15,   15,   15,   15,   15,
677        15,   15,   15,   15,   15,  723,   15,   27,   27,   27,
678        27,   27,   27,   27,   27,   27,   27,   27,  719,  719,
679       719,  719,  719,  719,  724,  718,  725,  725,  718,   49,
680       722,  725,   52,   52,   52,   52,   52,   52,   52,   52,
681        52,   52,   52,   63,   63,   63,   63,   63,   63,   63,
682        63,   63,   63,   63,  725,  725,  725,  725,  725,  725,
683       724,  718,  718,  719,  726,  727,  726,  718,  718,  718,
684       718,  718,  719,  718,  719,  718,  728,  728,  719,  728,
685
686       718,   12,  718,  719,  722,  718,  729,  719,  730,  718,
687       731,  719,  718,  112,  112,  719,  719,  719,  112,  112,
688       108,  719,  112,  719,  112,  732,  723,  732,  733,  718,
689       719,  718,  734,  719,  718,  719,  719,  719,  719,  719,
690       719,  719,  719,  724,  735,  724,  718,  736,  737,  718,
691       737,  737,  718,  737,  718,  718,  737,  738,  737,  718,
692       731,  159,  162,  162,  737,  737,  737,  162,  162,  159,
693       737,  162,  737,  162,  159,  718,  734,  159,  718,  737,
694       737,  737,  737,  737,  737,  737,  737,  724,  718,  739,
695       740,  740,  741,  742,  739,  739,  743,  744,  718,  745,
696
697       745,  718,  718,  718,  719,  719,  718,  719,  718,  718,
698       718,  718,  719,  718,  718,  718,  719,  718,  719,  718,
699       719,  719,  718,  219,  718,  745,  718,  718,  718,  718,
700       718,  718,  719,  719,  719,  719,  719,  719,  719,  719,
701       719,  746,  747,  748,  749,  719,  750,  719,  751,  750,
702       719,  248,  718,  719,  752,  752,  719,  256,  719,  719,
703       719,  719,  719,  719,  718,  724,  718,  753,  718,  754,
704       755,  755,  755,  755,  756,  753,  757,  755,  755,  220,
705       755,  755,  279,  718,  226,  755,  755,  755,  755,  755,
706       755,  755,  755,  755,  755,  283,  751,  755,  296,  755,
707
708       295,  755,  755,  755,  755,  755,  755,  724,  718,  718,
709       758,  759,  760,  761,  758,  762,  718,  763,  764,  764,
710       765,  765,  718,  718,  718,  718,  718,  719,  718,  718,
711       718,  718,  718,  718,  718,  718,  719,  766,  718,  719,
712       719,  767,  767,  719,  766,  767,  719,  344,  718,  719,
713       718,  718,  718,  718,  718,  718,  719,  719,  719,  718,
714       719,  719,  719,  719,  719,  719,  768,  768,  769,  770,
715       771,  718,  719,  718,  772,  773,  718,  718,  773,  773,
716       719,  718,  719,  718,  718,  719,  719,  724,  718,  718,
717       718,  718,  718,  774,  718,  755,  775,  775,  755,  755,
718
719       399,  755,  345,  755,  402,  755,  755,  755,  755,  755,
720       755,  755,  755,  755,  755,  755,  776,  755,  755,  755,
721       755,  724,  718,  777,  778,  779,  780,  781,  782,  783,
722       784,  718,  345,  718,  785,  786,  787,  788,  789,  790,
723       718,  718,  718,  784,  784,  719,  718,  719,  718,  718,
724       718,  718,  718,  718,  719,  719,  718,  719,  718,  719,
725       719,  719,  719,  719,  791,  792,  718,  793,  718,  794,
726       794,  794,  719,  718,  718,  718,  718,  719,  718,  724,
727       718,  718,  718,  718,  718,  795,  796,  796,  755,  755,
728       755,  755,  755,  755,  755,  755,  755,  755,  755,  755,
729
730       724,  718,  779,  797,  780,  781,  718,  783,  718,  798,
731       785,  785,  786,  786,  787,  787,  788,  788,  789,  789,
732       790,  790,  718,  718,  798,  798,  719,  718,  718,  718,
733       718,  718,  718,  718,  719,  799,  718,  718,  718,  718,
734       719,  719,  719,  719,  718,  718,  718,  718,  718,  724,
735       718,  718,  718,  795,  795,  796,  796,  755,  755,  755,
736       755,  755,  755,  724,  718,  718,  797,  779,  783,  718,
737       718,  718,  718,  718,  718,  718,  799,  799,  718,  718,
738       718,  718,  719,  719,  719,  719,  719,  724,  718,  718,
739       796,  796,  755,  755,  755,  755,  755,  724,  718,  718,
740
741       718,  718,  718,  718,  718,  718,  718,  718,  800,  719,
742       718,  718,  796,  796,  801,  755,  724,  718,  718,  718,
743       718,  718,  802,  802,  800,  625,  719,  718,  718,  796,
744       796,  801,  802,  632,  755,  724,  718,  718,  802,  625,
745       625,  718,  718,  796,  796,  803,  632,  632,  724,  718,
746       718,  802,  802,  625,  625,  718,  718,  796,  796,  803,
747       803,  632,  632,  724,  718,  718,  802,  802,  625,  804,
748       718,  805,  796,  803,  803,  632,  724,  718,  718,  718,
749       802,  804,  718,  718,  805,  718,  796,  803,  803,  724,
750       718,  718,  796,  803,  724,  718,  796,  724,  806,  806,
751
752       806,  806,  806,  806,  806,  806,  806,  806,  806,  806,
753       806,  806,  806,  806,  806,  718,  718,    0,  718,  718,
754       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
755       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
756       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
757       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
758       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
759       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
760       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
761       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
762
763       718,  718,  718,  718,  718,  718
764     } ;
765
766 static yyconst flex_int16_t yy_nxt[4761] =
767     {   0,
768         4,    4,    4,    5,    4,    4,    6,    4,    7,    8,
769         4,    9,   10,    7,    4,    4,   11,   12,   13,   13,
770         4,   14,    4,    4,   15,   16,   17,   18,   15,   15,
771        19,   15,   15,   15,   15,   20,   21,   22,   21,   23,
772        24,   21,   21,   25,   21,   26,    4,    4,    4,   27,
773        28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
774        38,   39,   40,   41,   40,   40,   42,   43,   40,   40,
775        40,   44,   40,   40,   45,    4,    4,    4,    4,    5,
776         4,   46,    6,   46,    7,    8,    4,    9,   10,   47,
777         4,    4,   48,   49,   50,   50,    4,   51,    4,    4,
778
779        52,   53,   54,   55,   52,   52,   56,   52,   52,   52,
780        52,   57,   58,   59,   58,   60,   61,   58,   58,   62,
781        58,   26,    4,    4,    4,   63,   64,   65,   66,   67,
782        68,   69,   70,   71,   72,   73,   74,   75,   76,   77,
783        76,   76,   78,   79,   76,   76,   76,   80,   76,   76,
784        81,    4,   82,   83,   83,   83,   83,   86,   89,   90,
785       717,   92,  117,  107,   87,   87,   87,   87,  113,  106,
786       158,   93,   97,   94,   95,  107,  106,   82,   96,   97,
787        97,   98,   84,  214,  718,  215,   84,  107,  118,  718,
788       197,   99,  100,  101,  102,  102,  102,  102,  103,  107,
789
790       166,  139,  104,  104,  104,  104,  104,  104,  104,  104,
791        84,  104,   84,   84,  104,  104,  104,  104,   84,   84,
792        84,  104,   84,  487,  113,  114,  167,  104,  104,  104,
793       104,  104,  104,  104,  104,  104,  104,  104,  104,   84,
794       104,  104,  104,  104,  104,   84,   84,   84,   84,   84,
795        84,   84,  107,  392,  108,  198,  109,  110,  110,  110,
796       110,  111,  393,  113,  107,  119,  119,  119,  119,  119,
797       119,  119,  119,  119,  119,  119,  119,  119,  119,  119,
798       119,  163,  214,  121,  215,  108,  119,  119,  119,  119,
799       112,  112,  112,  112,  112,  112,  112,  112,  112,  112,
800
801       112,  112,  120,  113,  136,  136,  670,  122,  193,  194,
802       123,  135,  145,  108,  135,  135,  119,  119,  119,  119,
803       137,  136,  242,  135,  135,   84,  205,  206,  138,  124,
804       136,  136,  135,  135,  135,  136,  136,  150,  135,  135,
805       135,  270,  136,  136,  136,  136,  106,  116,  135,  135,
806       135,  135,  135,  135,  214,  130,  125,  126,  127,  127,
807       127,  126,  126,  126,  126,  126,  126,  126,  126,  126,
808       128,  126,  126,  117,  696,  136,  136,  126,  126,  126,
809       126,  135,  135,  135,  270,  147,  136,  136,  136,  136,
810       565,  135,  135,  135,  686,  135,  135,  135,  207,  118,
811
812       136,  136,  126,  130,  126,  126,  107,  113,  135,  135,
813       135,  107,  614,  140,  368,  107,  180,  180,  107,  168,
814       168,  168,  168,  107,  179,  179,  179,  107,  145,  107,
815       106,  126,  126,  131,   84,  718,  132,  132,  132,  132,
816       133,  107,  146,  146,  146,  146,  150,  130,  142,   92,
817       276,  277,  169,   84,   84,  168,  168,  168,  168,  151,
818       143,   94,  152,  141,  134,  150,  153,  191,  310,  135,
819       135,  136,  136,  136,  136,  136,  136,  136,  136,  136,
820       136,   97,  193,  311,  170,  592,  124,  168,  168,  168,
821       168,  149,  134,  718,  168,  168,  168,  168,  150,  180,
822
823       180,  147,   97,   97,   98,  179,  179,  179,  171,   84,
824       168,  168,  168,  168,  154,  100,  101,  155,  155,  155,
825       155,  156,   97,   97,   97,  157,  157,  157,  157,  157,
826       157,  157,  157,  149,  157,  149,  149,  157,  157,  157,
827       157,  149,  149,  149,  157,  149,  173,  172,  113,  692,
828       157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
829       157,  157,  149,  157,  157,  157,  157,  157,  149,  149,
830       149,  149,  149,  149,  149,   84,  193,  311,  107,  113,
831       159,  334,  109,  160,  160,  160,  160,  161,  106,   84,
832       107,  335,  168,  168,  168,  168,  179,  180,  335,  179,
833
834       179,  150,  180,  180,  182,  181,  179,  179,  179,  180,
835       180,  159,  179,  179,  179,  385,  162,  162,  162,  162,
836       162,  162,  162,  162,  162,  162,  162,  162,   83,   83,
837        83,   83,  174,  180,  180,  179,  179,  179,  166,  159,
838       175,  441,  718,  176,  176,  176,  176,  177,  659,  290,
839       165,  180,  180,  180,  180,  442,  179,  179,  179,  191,
840       179,  179,  179,   84,  167,  386,  195,  195,  195,  195,
841       196,  178,   97,   97,   97,  150,  179,  179,  180,  180,
842       180,  180,  180,  180,  180,  180,  180,  180,  313,  314,
843       356,  180,  180,  180,  180,   84,  356,  289,  107,  178,
844
845       179,  179,  179,  179,  179,   84,   84,  150,  107,  107,
846       107,  184,   84,   84,  113,  107,  107,  150,  150,   84,
847       107,  107,  107,  370,  150,  150,  145,  107,  107,  316,
848       317,  150,  683,   84,  107,  585,  183,  188,   97,  691,
849       146,  146,  146,  146,  202,  150,  203,   84,   84,  586,
850       718,  204,   97,   97,   97,  718,  106,  186,   84,  150,
851        84,  185,  276,  277,  210,  371,  211,  187,  271,  272,
852       150,  212,  150,  173,   84,   84,   84,   84,  257,  257,
853       257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
854       149,  149,  149,  149,  289,  457,  307,  316,  317,  147,
855
856       111,   84,  109,  200,  200,  200,  200,  111,   84,  273,
857        84,  631,  145,  150,  145,  261,  274,  292,  313,  314,
858       150,   84,  150,  262,  679,  308,  146,  146,  146,  146,
859       266,  111,  686,  150,  425,  426,  201,  201,  201,  201,
860       201,  201,  201,  201,  201,  201,  201,  201,  191,  310,
861       273,  288,  428,  194,  458,  318,  318,  318,  318,  111,
862       217,  217,  217,  217,  217,  217,  217,  217,  217,  217,
863       217,  217,   84,  336,  336,  336,  336,  219,  316,  317,
864        84,   84,   84,   84,  220,  147,  684,  147,  221,  221,
865       221,  221,  221,  221,  221,  221,  221,  221,  221,   84,
866
867        84,   84,   84,   84,   84,   84,   84,   84,  219,  337,
868       337,  337,  337,  222,  222,  222,  222,  222,  222,  222,
869       222,  222,  222,  222,  222,   84,   84,   84,   84,   84,
870        84,   84,   84,   84,   84,   84,  219,   84,  224,   84,
871       683,  225,  225,  225,  225,  226,   84,  301,  301,  301,
872       301,  150,   84,   84,   84,   84,   84,  385,  150,  435,
873       301,  301,  301,  301,  150,  150,  150,  150,  150,  224,
874       338,  338,  338,  338,  222,  222,  222,  222,  222,  222,
875       222,  222,  222,  222,  222,  222,  680,  293,  340,  340,
876       340,  340,  459,  304,  428,  194,  676,  224,  227,  407,
877
878       228,  341,  341,  341,  341,  229,  230,  384,  306,  273,
879       231,  191,  310,  360,  232,  425,  426,  459,  195,  195,
880       195,  195,  196,  227,  436,  228,  342,  342,  342,  342,
881       676,  229,  230,  504,  505,  460,  361,  231,  341,  341,
882       341,  341,  232,  126,  127,  127,  127,  126,  126,  126,
883       126,  126,  126,  126,  126,  126,  126,  126,  126,   84,
884       461,  361,  106,  126,  126,  126,  126,  301,  301,  301,
885       301,  150,  226,  357,   84,   84,  253,  226,  718,  226,
886       324,  324,  324,  324,  226,  718,  150,  150,  126,  130,
887       126,  126,   84,   84,   84,   84,   84,   84,   84,   84,
888
889        84,   84,   84,  226,  305,  428,  194,  437,  226,  718,
890       341,  341,  341,  341,  486,  397,  486,  126,  126,  126,
891       243,  243,  243,  244,  398,  126,  126,  126,  126,  126,
892       126,  226,  671,  126,  126,  415,  226,  718,  329,  126,
893       126,  343,  126,   84,  253,  358,  243,  243,  243,  244,
894       375,  375,  375,  375,  346,  150,  389,  341,  341,  341,
895       341,  390,  391,  477,  126,  130,  126,  256,  370,   84,
896        84,  145,  438,  670,  376,  376,  376,  376,   84,  349,
897       258,  150,  150,  396,  106,  388,  388,  388,  388,  669,
898       150,  130,  669,  126,  126,  246,  246,  246,  246,  246,
899
900       246,  246,  246,  246,  246,  246,  246,   84,  247,  366,
901       371,  378,  248,  478,  411,   84,   84,   84,   84,  249,
902       666,  250,  414,  251,  251,  251,  251,  251,  251,  251,
903       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
904       251,  251,  251,  252,  147,  488,  253,  477,  254,  254,
905       254,  254,  254,  254,  254,  254,  254,  254,  254,  254,
906       251,  251,  251,  251,  251,  251,  251,  251,  251,  251,
907       251,  252,  251,  135,  135,  135,  135,  135,  135,  135,
908       135,  135,  135,  135,  135,   84,  256,  504,  505,  145,
909        84,  428,  194,  257,  257,  257,  257,  382,  665,  258,
910
911       422,  259,  259,  259,  259,  259,  259,  259,  259,  259,
912       259,  259,  259,  259,  259,  259,  259,  259,  259,  259,
913       259,  259,  431,  431,  431,  431,   84,   84,   84,   84,
914       260,   84,   84,   84,   84,   84,   84,   84,   84,   84,
915        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
916        84,   97,   97,   97,  333,  555,  395,  555,   84,   84,
917        84,   84,  147,  149,  100,  412,  155,  155,  155,  155,
918       150,  150,  150,  150,  157,  157,  157,  157,  157,  157,
919       157,  157,  149,  157,  149,  149,  157,  157,  157,  157,
920       149,  149,  149,  157,  149,  443,  443,  443,  443,  157,
921
922       157,  157,  157,  157,  157,  157,  157,  157,  157,  157,
923       157,  149,  157,  157,  157,  157,  157,  149,  149,  149,
924       149,  149,  149,  149,   84,   84,   84,   84,  384,  368,
925       465,  385,  504,  505,  718,  663,  150,  150,  150,  150,
926        84,  718,  718,  718,  718,   84,  662,  718,  399,  399,
927       399,  399,  150,  400,  400,  400,  400,  150,  448,  448,
928       448,  448,  130,  130,  657,  278,  278,  278,  278,  278,
929       278,  278,  278,  278,  278,  278,  278,   84,  718,   84,
930        84,  420,  279,  656,  421,  149,  149,  149,  149,  280,
931       409,  150,  150,  281,  281,  281,  281,  281,  281,  281,
932
933       281,  281,  281,  281,  149,  149,  149,  149,  149,  149,
934       149,  149,  149,  279,  375,  375,  375,  375,  282,  282,
935       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
936       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
937       149,  279,  149,  283,   84,  699,  284,  284,  284,  284,
938       285,  655,  401,  401,  401,  401,  150,  149,  149,  149,
939       149,  149,  149,  149,  149,  149,  149,  149,  191,  310,
940       470,  470,  470,  470,  283,  430,  430,  430,  430,  282,
941       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
942       282,  191,  507,  535,  428,  194,  508,  510,  510,  510,
943
944       510,  106,  283,  295,  295,  295,  295,  295,  295,  295,
945       295,  295,  295,  295,  295,   84,  247,  718,  147,  535,
946       296,  504,  505,  149,  149,  149,  149,  297,  539,  250,
947       718,  298,  298,  298,  298,  298,  298,  298,  298,  298,
948       298,  298,  298,  298,  298,  298,  298,  298,  298,  298,
949       298,  299,  591,  540,  253,  718,  300,  300,  300,  300,
950       300,  300,  300,  300,  300,  300,  300,  300,  298,  298,
951       298,  298,  298,  298,  298,  298,  298,  298,  298,  299,
952       298,  179,  179,  179,  179,  179,  179,  179,  179,  179,
953       179,  179,  179,   84,  256,  343,  654,  565,  149,  504,
954
955       505,  301,  301,  301,  301,  150,  566,  258,  718,  302,
956       302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
957       302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
958       466,  466,  466,  718,  149,  149,  149,  149,  303,  149,
959       149,  149,  149,  149,  149,  149,  149,  149,  149,  149,
960       149,  149,  149,  149,  149,  149,  149,  149,  149,  221,
961       221,  221,  221,  221,  221,  221,  221,  221,  221,  221,
962        84,   84,  106,  106,  613,  467,  106,  465,  401,  401,
963       401,  401,  150,  150,  222,  222,  222,  222,  222,  222,
964       222,  222,  222,  222,  222,  222,  339,  339,  339,  339,
965
966       339,  339,  339,  339,  339,  339,  339,   84,  439,  253,
967       545,  651,  537,  407,  650,  417,  417,  417,  417,  150,
968       413,  323,  323,  323,  323,  323,  323,  323,  323,  323,
969       323,  323,  323,   84,  343,  556,   84,  557,  344,  537,
970       643,   84,   84,   84,   84,  345,  639,  346,  150,  347,
971       347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
972       347,  347,  347,  347,  347,  347,  347,  347,  347,  348,
973       642,  639,  349,  440,  350,  350,  350,  350,  350,  350,
974       350,  350,  350,  350,  350,  350,   84,   84,   84,   84,
975        84,   84,   84,   84,   84,   84,   84,  344,   84,  126,
976
977       243,  243,  243,  244,  379,  126,  126,  126,  126,  126,
978       126,  360,  638,  126,  126,   84,   84,  380,  639,  126,
979       126,   84,  126,  401,  401,  401,  401,  150,  150,  401,
980       401,  401,  401,  150,  410,   84,  621,  106,  718,  379,
981       106,  673,  382,  639,  126,  130,  126,  150,  476,  439,
982        84,  718,  718,  335,  345,   92,  718,   84,  408,  410,
983       335,  345,  150,  718,  210,  481,  211,   94,   84,  150,
984       349,  212,   96,  126,  126,  256,  718,  718,  408,  273,
985       150,  415,  718,  718,  106,  345,  640,  718,  258,  630,
986       259,  259,  259,  259,  259,  259,  259,  259,  259,  259,
987
988       259,  259,  259,  259,  259,  259,  259,  259,  259,  259,
989       259,  641,  273,  345,  440,  718,  555,  395,  555,  260,
990       373,  373,  373,  373,  373,  373,  373,  373,  373,  373,
991       373,  373,  379,  145,   84,  701,  637,  106,  106,  644,
992       216,  216,  273,  565,  501,  380,  150,  381,  381,  381,
993       381,  381,  381,  381,  381,  381,  381,  381,  381,  381,
994       381,  381,  381,  381,  381,  381,  381,  381,  523,  629,
995       382,  575,  444,   84,  471,  106,  383,   84,   84,   84,
996       524,   84,   84,   84,   84,  445,  534,  472,  672,  150,
997       687,  150,   84,  281,  281,  281,  281,  281,  281,  281,
998
999       281,  281,  281,  281,  150,   84,  147,  628,  265,  647,
1000       447,  627,  474,  490,  490,  490,  490,  150,  282,  282,
1001       282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
1002        84,  343,  718,  562,  648,  402,  645,  623,  149,  149,
1003       149,  149,  403,  491,  346,  718,  404,  404,  404,  404,
1004       404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
1005       404,  404,  404,  404,  404,  404,  405,  701,  623,  349,
1006       718,  406,  406,  406,  406,  406,  406,  406,  406,  406,
1007       406,  406,  406,  149,  149,  149,  149,  149,  149,  149,
1008       149,  149,  149,  149,  402,  149,   84,  256,  106,   84,
1009
1010       622,  382,  106,  218,  218,  604,  646,  619,  150,  395,
1011       258,  150,  302,  302,  302,  302,  302,  302,  302,  302,
1012       302,  302,  302,  302,  302,  302,  302,  302,  302,  302,
1013       302,  302,  302,  639,  223,  223,  681,  661,  639,  572,
1014       265,  303,  416,  416,  416,  416,  416,  416,  416,  416,
1015       416,  416,  416,  416,  379,  444,  658,  693,  639,  466,
1016       466,  466,  661,  639,  546,  546,  546,  380,  718,  418,
1017       418,  418,  418,  418,  418,  418,  418,  418,  418,  418,
1018       418,  418,  418,  418,  418,  418,  418,  418,  418,  418,
1019        84,  145,  382,  718,  618,  106,  612,  620,  419,  343,
1020
1021       611,   84,  150,  345,  467,  480,  480,  480,  480,  547,
1022       345,  621,  346,  150,  432,  432,  432,  432,  432,  432,
1023       432,  432,  432,  432,  432,  432,  432,  432,  432,  432,
1024       432,  432,  432,  432,  433,  497,  701,  349,  610,  434,
1025       434,  434,  434,  434,  434,  434,  434,  434,  434,  434,
1026       434,  457,  492,  697,   84,  482,   84,   84,   84,  531,
1027       447,  678,  345,  343,  147,  483,  150,  101,  150,  150,
1028       150,  586,  103,  531,  531,  679,  346,  609,  347,  347,
1029       347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
1030       347,  347,  347,  347,  347,  347,  347,  347,  347,  498,
1031
1032        84,  349,  444,  609,  496,  608,  477,  255,  255,  716,
1033       493,  395,  150,  374,  374,  445,  607,  446,  446,  446,
1034       446,  446,  446,  446,  446,  446,  446,  446,  446,  446,
1035       446,  446,  446,  446,  446,  446,  446,  446,  639,  661,
1036       447,  350,  350,  350,  350,  350,  350,  350,  350,  350,
1037       350,  350,  350,   84,  343,  606,  500,  605,  546,  546,
1038       546,  681,  578,  639,  661,  150,  578,  346,  604,  404,
1039       404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
1040       404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
1041        84,  471,  349,  444,  603,   84,  602,  601,  417,  417,
1042
1043       417,  417,  150,  547,  472,  536,  445,  150,  489,  489,
1044       489,  489,  489,  489,  489,  489,  489,  489,  489,  489,
1045       489,  489,  489,  489,  489,  489,  489,  489,  489,  474,
1046       718,  447,   84,   84,  113,  537,  600,   84,  528,   84,
1047       561,  568,   84,  718,  150,  150,  538,   84,  471,  150,
1048       471,  150,  149,  145,  150,  149,  149,  149,  149,  150,
1049       494,  472,  537,  718,  599,  550,  652,  639,  718,  559,
1050       395,  639,  639,  406,  406,  406,  406,  406,  406,  406,
1051       406,  406,  406,  406,  406,  495,  474,  525,  718,   84,
1052       590,  653,  639,  589,  267,  559,  639,  639,  668,  382,
1053
1054       526,  150,  527,  527,  527,  527,  527,  527,  527,  527,
1055       527,  527,  527,  527,  527,  527,  527,  527,  527,  527,
1056       527,  527,  527,  145,   84,  528,  551,   84,  525,  145,
1057       474,  587,  584,  583,  564,  582,  150,  581,  580,  150,
1058       598,  526,  563,  558,  558,  558,  558,  558,  558,  558,
1059       558,  558,  558,  558,  558,  558,  558,  558,  558,  558,
1060       558,  558,  558,  558,  457,   84,  528,  113,   84,   84,
1061       474,  106,   84,  525,  718,  525,  395,  150,  579,  531,
1062       150,  150,  191,  310,  150,  560,  526,  718,  718,  569,
1063       569,  569,  569,  531,  531,   84,  147,  528,   84,  578,
1064
1065       145,  139,  147,  576,  661,  574,   84,  150,   84,   84,
1066       150,  528,  718,  718,  588,  588,  588,  588,  150,   84,
1067       150,  150,  672,  573,   84,  191,  507,  145,   84,  661,
1068       528,  150,  569,  569,  569,  569,  150,   84,  593,  183,
1069       150,  588,  588,  588,  588,   84,  572,  145,  571,  150,
1070        84,   84,  522,  522,  595,  395,  615,  150,  617,  520,
1071       597,  145,  150,  150,  145,  145,  639,  594,  596,  520,
1072       395,  667,  636,  147,  145,  649,  664,  674,  518,  145,
1073       518,  596,  516,  661,  516,  677,  395,  615,  145,  514,
1074       690,  639,  514,  512,  512,  635,  447,  568,  661,  695,
1075
1076       551,  553,  675,  688,  145,  616,  701,  701,  661,  552,
1077       214,  207,  395,  384,  661,  698,  549,  702,  703,  382,
1078       147,  624,  624,  661,  624,  624,  624,  624,  624,  395,
1079       624,  624,  624,  624,  147,  624,  624,  147,  147,  661,
1080       661,  624,  624,  624,  624,  689,  474,  147,  701,  701,
1081       469,  626,  147,  701,  113,  694,  544,  661,  543,  704,
1082       705,  147,  701,  694,  706,  661,  624,  624,  624,  624,
1083       542,  541,  457,  707,  701,  701,  626,  147,  701,  265,
1084       265,  701,  661,  701,  113,  708,  709,  534,  701,  710,
1085       533,  532,  711,  530,  712,  624,  624,  624,  624,  713,
1086
1087       624,  624,  624,  624,  624,  625,  624,  624,  624,  624,
1088       529,  624,  624,  701,  447,  442,  522,  633,  624,  624,
1089       624,  265,  265,  520,  714,  701,  265,  634,  518,  516,
1090       514,  512,  349,  349,  310,  265,  715,  502,  349,  270,
1091       395,  485,  624,  624,  624,  624,  484,  265,  265,   88,
1092       208,  265,  634,  479,  265,  382,  265,  384,  253,  469,
1093       464,  265,  463,  462,  208,  456,  455,  454,  453,  452,
1094       451,  624,  624,  624,  624,  450,  624,  624,  624,  624,
1095       624,  449,  624,  624,  624,  624,  265,  624,  624,  349,
1096       349,  214,  214,  624,  624,  624,  624,  208,  265,  207,
1097
1098       207,  207,  322,  626,  322,  320,  320,  423,  253,  270,
1099       270,  270,  269,  395,  269,  366,  387,  358,  624,  624,
1100       624,  624,  357,  384,  256,  253,  253,  247,  626,  365,
1101       364,  363,  362,  359,  355,  354,  353,  352,  351,  333,
1102       333,  332,  331,  330,  329,  329,  328,  624,  624,  624,
1103       624,  327,  624,  624,  624,  624,  624,  625,  624,  624,
1104       624,  624,  326,  624,  624,  325,  322,  320,  309,  633,
1105       624,  624,  624,  270,  294,  292,  291,  290,  287,  634,
1106       286,  270,  270,  269,  267,  265,  264,  239,  208,  263,
1107       237,  130,  241,  240,  624,  624,  624,  624,  239,  208,
1108
1109       238,  237,  236,  236,  634,  235,  234,  233,  106,  214,
1110       213,  207,  208,  207,  199,  191,  189,  165,  164,  148,
1111       116,  115,  106,  624,  624,   84,   88,  718,  718,   84,
1112        84,  718,  718,   84,   84,   84,  718,   84,   84,   84,
1113        84,   84,   85,   85,   85,   85,   85,  718,   85,   85,
1114        85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
1115        85,   85,   91,   91,  718,  718,  718,   91,   91,   91,
1116       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
1117       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
1118       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
1119
1120       129,  129,  129,  129,  129,  129,  129,  129,  129,  129,
1121       144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
1122       144,  144,  144,  144,  144,  144,  144,  144,  144,  144,
1123       149,  718,  718,  718,  149,  149,  149,  718,  149,  149,
1124       149,  718,  149,  149,  149,  149,  149,  190,  190,  190,
1125       190,  190,  718,  190,  190,  190,  190,  190,  190,  190,
1126       190,  190,  190,  190,  190,  190,  190,  192,  192,  192,
1127       192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
1128       192,  192,  192,  192,  192,  192,  192,  209,  209,  718,
1129       718,  718,  718,  718,  718,  718,  718,  209,  718,  718,
1130
1131       718,  209,  209,  718,  209,  126,  126,  126,  126,  126,
1132       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
1133       126,  126,  126,  126,  126,  245,  245,  245,  245,  245,
1134       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
1135       245,  245,  245,  245,  245,  145,  145,  145,  145,  145,
1136       145,  145,  145,  145,  145,  145,  145,  145,  145,  145,
1137       145,  145,  145,  145,  145,  268,  268,  268,  268,  268,
1138       268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
1139       268,  268,  268,  268,  268,  149,  718,  718,  718,  149,
1140       149,  149,  718,  149,  149,  149,  718,  149,  149,  149,
1141
1142       149,  149,  275,  275,  275,  275,  275,  275,  275,  275,
1143       275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
1144       275,  275,  190,  190,  190,  190,  190,  190,  190,  190,
1145       190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
1146       190,  190,  192,  192,  192,  192,  192,  192,  192,  192,
1147       192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
1148       192,  192,  312,  312,  312,  312,  312,  312,  312,  312,
1149       312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
1150       312,  312,  315,  315,  315,  315,  315,  315,  315,  315,
1151       315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
1152
1153       315,  315,  319,  319,  718,  319,  319,  319,  319,  319,
1154       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
1155       319,  319,  321,  321,  718,  321,  321,  321,  321,  321,
1156       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
1157       321,  321,  323,  718,  323,  718,  718,  718,  323,  718,
1158       323,  323,  718,  718,  323,  367,  367,  367,  367,  367,
1159       367,  367,  367,  367,  367,  367,  367,  367,  367,  367,
1160       367,  367,  367,  367,  367,  126,  126,  126,  126,  126,
1161       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
1162       126,  126,  126,  126,  126,  369,  369,  369,  369,  369,
1163
1164       369,  369,  369,  369,  369,  369,  369,  369,  369,  369,
1165       369,  369,  369,  369,  369,  245,  245,  245,  245,  245,
1166       245,  245,  245,  245,  245,  245,  245,  245,  245,  245,
1167       245,  245,  245,  245,  245,  372,  372,  372,  718,  372,
1168       372,  372,  372,  372,  377,  718,  718,  718,  377,  718,
1169       377,  377,  377,  377,  718,  718,  377,  268,  268,  268,
1170       268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
1171       268,  268,  268,  268,  268,  268,  268,  394,  394,  394,
1172       394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
1173       394,  394,  394,  394,  394,  394,  394,  149,  718,  718,
1174
1175       718,  149,  149,  149,  718,  149,  149,  149,  718,  149,
1176       149,  149,  149,  149,  275,  275,  275,  275,  275,  275,
1177       275,  275,  275,  275,  275,  275,  275,  275,  275,  275,
1178       275,  275,  275,  275,  105,  105,  105,  105,  105,  105,
1179       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
1180       105,  105,  105,  105,  315,  315,  315,  315,  315,  315,
1181       315,  315,  315,  315,  315,  315,  315,  315,  315,  315,
1182       315,  315,  315,  315,  312,  312,  312,  312,  312,  312,
1183       312,  312,  312,  312,  312,  312,  312,  312,  312,  312,
1184       312,  312,  312,  312,  424,  424,  424,  424,  424,  424,
1185
1186       424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
1187       424,  424,  424,  424,  427,  427,  427,  427,  427,  427,
1188       427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
1189       427,  427,  427,  427,  429,  429,  429,  429,  429,  429,
1190       429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
1191       429,  429,  429,  429,  190,  190,  190,  190,  190,  190,
1192       190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
1193       190,  190,  190,  190,  319,  319,  718,  319,  319,  319,
1194       319,  319,  319,  319,  319,  319,  319,  319,  319,  319,
1195       319,  319,  319,  319,  321,  321,  718,  321,  321,  321,
1196
1197       321,  321,  321,  321,  321,  321,  321,  321,  321,  321,
1198       321,  321,  321,  321,  434,  718,  434,  718,  718,  718,
1199       434,  718,  434,  434,  718,  718,  434,  432,  718,  718,
1200       718,  718,  718,  432,  432,  432,  432,  432,  367,  367,
1201       367,  367,  367,  367,  367,  367,  367,  367,  367,  367,
1202       367,  367,  367,  367,  367,  367,  367,  367,  369,  369,
1203       369,  369,  369,  369,  369,  369,  369,  369,  369,  369,
1204       369,  369,  369,  369,  369,  369,  369,  369,  126,  126,
1205       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
1206       126,  126,  126,  126,  126,  126,  126,  126,  468,  468,
1207
1208       468,  468,  468,  468,  468,  468,  468,  468,  468,  468,
1209       468,  468,  468,  468,  468,  468,  468,  468,  473,  473,
1210       718,  718,  473,  473,  718,  473,  473,  473,  473,  473,
1211       473,  473,  473,  473,  473,  475,  718,  718,  718,  718,
1212       718,  475,  475,  475,  475,  475,  718,  475,  394,  394,
1213       394,  394,  394,  394,  394,  394,  394,  394,  394,  394,
1214       394,  394,  394,  394,  394,  394,  394,  394,  105,  105,
1215       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
1216       105,  105,  105,  105,  105,  105,  105,  105,  499,  499,
1217       718,  718,  499,  499,  499,  499,  499,  499,  499,  499,
1218
1219       499,  499,  499,  499,  499,  424,  424,  424,  424,  424,
1220       424,  424,  424,  424,  424,  424,  424,  424,  424,  424,
1221       424,  424,  424,  424,  424,  425,  425,  425,  425,  425,
1222       425,  425,  425,  425,  425,  425,  425,  425,  425,  425,
1223       425,  425,  425,  425,  425,  503,  503,  503,  503,  503,
1224       503,  503,  503,  503,  503,  503,  503,  503,  503,  503,
1225       503,  503,  503,  503,  503,  427,  427,  427,  427,  427,
1226       427,  427,  427,  427,  427,  427,  427,  427,  427,  427,
1227       427,  427,  427,  427,  427,  506,  506,  506,  506,  506,
1228       506,  506,  506,  506,  506,  506,  506,  506,  506,  506,
1229
1230       506,  506,  506,  506,  506,  429,  429,  429,  429,  429,
1231       429,  429,  429,  429,  429,  429,  429,  429,  429,  429,
1232       429,  429,  429,  429,  429,  190,  190,  190,  190,  190,
1233       190,  190,  190,  190,  190,  190,  190,  190,  190,  190,
1234       190,  190,  190,  190,  190,  509,  718,  718,  718,  718,
1235       718,  509,  509,  509,  509,  509,  511,  511,  718,  511,
1236       511,  511,  511,  511,  511,  511,  511,  511,  511,  511,
1237       511,  511,  511,  511,  511,  511,  513,  513,  718,  513,
1238       513,  513,  513,  513,  513,  513,  513,  513,  513,  513,
1239       513,  513,  513,  513,  513,  513,  515,  515,  718,  515,
1240
1241       515,  515,  515,  515,  515,  515,  515,  515,  515,  515,
1242       515,  515,  515,  515,  515,  515,  517,  517,  718,  517,
1243       517,  517,  517,  517,  517,  517,  517,  517,  517,  517,
1244       517,  517,  517,  517,  517,  517,  519,  519,  718,  519,
1245       519,  519,  519,  519,  519,  519,  519,  519,  519,  519,
1246       519,  519,  519,  519,  519,  519,  521,  521,  718,  521,
1247       521,  521,  521,  521,  521,  521,  521,  521,  521,  521,
1248       521,  521,  521,  521,  521,  521,  367,  367,  367,  367,
1249       367,  367,  367,  367,  367,  367,  367,  367,  367,  367,
1250       367,  367,  367,  367,  367,  367,  126,  126,  126,  126,
1251
1252       126,  126,  126,  126,  126,  126,  126,  126,  126,  126,
1253       126,  126,  126,  126,  126,  126,  468,  468,  468,  468,
1254       468,  468,  468,  468,  468,  468,  468,  468,  468,  468,
1255       468,  468,  468,  468,  468,  468,  548,  718,  718,  718,
1256       718,  718,  548,  548,  548,  548,  548,  548,  548,  548,
1257       548,  548,  554,  554,  554,  554,  554,  554,  554,  554,
1258       554,  554,  554,  554,  554,  554,  554,  554,  554,  554,
1259       554,  554,  105,  105,  105,  105,  105,  105,  105,  105,
1260       105,  105,  105,  105,  105,  105,  105,  105,  105,  105,
1261       105,  105,  567,  567,  567,  567,  718,  567,  567,  567,
1262
1263       567,  567,  567,  567,  567,  567,  567,  567,  567,  567,
1264       567,  567,  570,  718,  718,  718,  718,  718,  570,  570,
1265       570,  570,  570,  577,  577,  718,  577,  577,  577,  577,
1266       577,  577,  577,  577,  577,  577,  577,  577,  577,  577,
1267       577,  577,  577,  625,  625,  718,  625,  625,  625,  625,
1268       625,  625,  625,  625,  625,  625,  625,  625,  625,  625,
1269       625,  625,  625,  632,  632,  718,  632,  632,  632,  632,
1270       632,  632,  632,  632,  632,  632,  632,  632,  632,  632,
1271       632,  632,  632,  624,  624,  718,  624,  624,  624,  624,
1272       624,  624,  624,  624,  624,  624,  624,  624,  624,  624,
1273
1274       624,  624,  624,  660,  660,  660,  660,  660,  660,  660,
1275       660,  660,  660,  660,  660,  660,  660,  660,  660,  660,
1276       660,  660,  660,  682,  682,  682,  682,  682,  682,  682,
1277       682,  682,  682,  682,  682,  682,  682,  682,  682,  682,
1278       682,  682,  682,  685,  685,  685,  685,  685,  685,  685,
1279       685,  685,  685,  685,  685,  685,  685,  685,  685,  685,
1280       685,  685,  685,  700,  700,  700,  700,  700,  700,  700,
1281       700,  700,  700,  700,  700,  700,  700,  700,  700,  700,
1282       700,  700,  700,    3,  718,  718,  718,  718,  718,  718,
1283       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1284
1285       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1286       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1287       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1288       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1289       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1290       718,  718,  718,  718,  718,  718,  718,  718,  718,  718
1291     } ;
1292
1293 static yyconst flex_int16_t yy_chk[4761] =
1294     {   0,
1295         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1296         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1297         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1298         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1299         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1300         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1301         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
1302         1,    1,    1,    1,    1,    1,    2,    2,    2,    2,
1303         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1304         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1305
1306         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1307         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1308         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1309         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1310         2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
1311         2,    2,    5,    6,    6,    6,    6,    8,   10,   10,
1312       716,   11,   19,   39,    8,    8,    8,    8,   16,   51,
1313        51,   11,   13,   11,   11,   39,  397,    5,   11,   12,
1314        12,   12,   13,  101,   13,  101,   12,   40,   19,   13,
1315        88,   12,   12,   12,   12,   12,   12,   12,   12,   40,
1316
1317        56,   39,   12,   12,   12,   12,   12,   12,   12,   12,
1318        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
1319        12,   12,   12,  397,   53,   16,   56,   12,   12,   12,
1320        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
1321        12,   12,   12,   12,   12,   12,   12,   12,   12,   12,
1322        12,   12,   15,  269,   15,   88,   15,   15,   15,   15,
1323        15,   15,  269,   28,   15,   21,   21,   21,   21,   20,
1324        20,   20,   20,   23,   23,   23,   23,   24,   24,   24,
1325        24,   53,  331,   22,  331,   15,   22,   22,   22,   22,
1326        15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
1327
1328        15,   15,   20,   25,   38,   38,  696,   22,   86,   86,
1329        23,   28,  144,   15,   38,   38,   25,   25,   25,   25,
1330        28,   29,  128,   29,   29,   47,   93,   93,   29,   24,
1331        30,   30,   30,   30,   30,   31,   31,   47,   31,   31,
1332        31,  156,   37,   37,   32,   32,  592,   30,   32,   32,
1333        32,   37,   37,   37,  156,  128,   25,   26,   26,   26,
1334        26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
1335        26,   26,   26,   33,  692,   34,   34,   26,   26,   26,
1336        26,   34,   34,   34,  153,  144,   33,   33,   35,   35,
1337       691,   33,   33,   33,  685,   35,   35,   35,  153,   33,
1338
1339        36,   36,   26,   26,   26,   26,   42,   44,   36,   36,
1340        36,   41,  592,   41,  242,   44,   72,   72,   42,   57,
1341        57,   57,   57,   41,   72,   72,   72,   44,   45,   43,
1342       557,   26,   26,   27,  149,   27,   27,   27,   27,   27,
1343        27,   43,   45,   45,   45,   45,  149,  242,   42,   48,
1344       158,  158,   57,  157,   48,   58,   58,   58,   58,   48,
1345        44,   48,   48,   41,   27,  157,   48,  190,  190,   27,
1346        27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
1347        27,   50,  191,  191,   59,  557,   43,   59,   59,   59,
1348        59,   50,   27,   50,   61,   61,   61,   61,   50,   70,
1349
1350        70,   45,   49,   49,   49,   70,   70,   70,   59,   49,
1351        60,   60,   60,   60,   49,   49,   49,   49,   49,   49,
1352        49,   49,   97,   97,   97,   49,   49,   49,   49,   49,
1353        49,   49,   49,   49,   49,   49,   49,   49,   49,   49,
1354        49,   49,   49,   49,   49,   49,   61,   60,   64,  684,
1355        49,   49,   49,   49,   49,   49,   49,   49,   49,   49,
1356        49,   49,   49,   49,   49,   49,   49,   49,   49,   49,
1357        49,   49,   49,   49,   49,   52,  192,  192,   52,   62,
1358        52,  215,   52,   52,   52,   52,   52,   52,  645,  183,
1359        52,  215,   62,   62,   62,   62,   64,   65,  215,   65,
1360
1361        65,  183,   68,   68,   65,   64,   68,   68,   68,   67,
1362        67,   52,   67,   67,   67,  260,   52,   52,   52,   52,
1363        52,   52,   52,   52,   52,   52,   52,   52,   83,   83,
1364        83,   83,   62,   66,   66,   66,   66,   66,   69,   52,
1365        63,  335,   63,   63,   63,   63,   63,   63,  645,  183,
1366        66,   69,   69,   71,   71,  335,   69,   69,   69,   87,
1367        71,   71,   71,  166,   69,  260,   87,   87,   87,   87,
1368        87,   63,  100,  100,  100,  166,   63,   63,   63,   63,
1369        63,   63,   63,   63,   63,   63,   63,   63,  193,  193,
1370       232,   73,   73,   74,   74,   75,  232,  166,   75,   63,
1371
1372        73,   73,   73,   74,   74,   76,   77,   75,   76,   77,
1373        75,   77,   78,   79,   80,   78,   79,   76,   77,   80,
1374        76,   77,   80,  244,   78,   79,   81,   78,   79,  194,
1375       194,   80,  682,  167,   80,  543,   75,   81,  102,  680,
1376        81,   81,   81,   81,   92,  167,   92,  187,  102,  543,
1377       102,   92,   98,   98,   98,  102,  614,   78,  186,  187,
1378       151,   77,  275,  275,   98,  244,   98,   80,  151,  151,
1379       186,   98,  151,   79,  119,  119,  119,  119,  136,  136,
1380       136,  136,  137,  137,  137,  137,  138,  138,  138,  138,
1381       168,  168,  168,  168,  167,  359,  187,  311,  311,   81,
1382
1383        91,  152,   91,   91,   91,   91,   91,   91,  154,  152,
1384       165,  614,  146,  152,  188,  137,  154,  186,  312,  312,
1385       154,  171,  165,  138,  678,  188,  146,  146,  146,  146,
1386       146,   91,  672,  171,  313,  313,   91,   91,   91,   91,
1387        91,   91,   91,   91,   91,   91,   91,   91,  196,  196,
1388       171,  165,  314,  314,  359,  196,  196,  196,  196,   91,
1389       108,  108,  108,  108,  108,  108,  108,  108,  108,  108,
1390       108,  108,  110,  216,  216,  216,  216,  110,  315,  315,
1391       110,  110,  110,  110,  110,  146,  671,  188,  110,  110,
1392       110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
1393
1394       110,  110,  110,  110,  110,  110,  110,  110,  110,  217,
1395       217,  217,  217,  110,  110,  110,  110,  110,  110,  110,
1396       110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
1397       110,  110,  110,  110,  110,  110,  110,  110,  112,  180,
1398       670,  112,  112,  112,  112,  112,  173,  180,  180,  180,
1399       180,  180,  181,  184,  185,  273,  304,  378,  173,  329,
1400       181,  181,  181,  181,  181,  184,  185,  273,  304,  112,
1401       218,  218,  218,  218,  112,  112,  112,  112,  112,  112,
1402       112,  112,  112,  112,  112,  112,  666,  173,  221,  221,
1403       221,  221,  360,  181,  316,  316,  663,  112,  113,  304,
1404
1405       113,  222,  222,  222,  222,  113,  113,  378,  184,  185,
1406       113,  195,  195,  236,  113,  424,  424,  360,  195,  195,
1407       195,  195,  195,  113,  329,  113,  223,  223,  223,  223,
1408       662,  113,  113,  426,  426,  361,  236,  113,  233,  233,
1409       233,  233,  113,  127,  127,  127,  127,  127,  127,  127,
1410       127,  127,  127,  127,  127,  127,  127,  127,  127,  182,
1411       361,  236,  277,  127,  127,  127,  127,  182,  182,  182,
1412       182,  182,  200,  233,  298,  307,  298,  201,  226,  200,
1413       201,  201,  201,  201,  201,  226,  298,  307,  127,  127,
1414       127,  127,  224,  224,  224,  224,  224,  224,  224,  224,
1415
1416       224,  224,  224,  200,  182,  427,  427,  333,  201,  226,
1417       234,  234,  234,  234,  395,  277,  395,  127,  127,  129,
1418       129,  129,  129,  129,  277,  129,  129,  129,  129,  129,
1419       129,  200,  657,  129,  129,  307,  201,  226,  272,  129,
1420       129,  342,  129,  272,  254,  234,  243,  243,  243,  243,
1421       254,  254,  254,  254,  342,  272,  267,  241,  241,  241,
1422       241,  267,  267,  383,  129,  129,  129,  255,  369,  290,
1423       293,  266,  333,  656,  255,  255,  255,  255,  271,  342,
1424       255,  290,  293,  271,  398,  266,  266,  266,  266,  655,
1425       271,  243,  654,  129,  129,  131,  131,  131,  131,  131,
1426
1427       131,  131,  131,  131,  131,  131,  131,  132,  132,  241,
1428       369,  255,  132,  383,  290,  132,  132,  132,  132,  132,
1429       651,  132,  293,  132,  132,  132,  132,  132,  132,  132,
1430       132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
1431       132,  132,  132,  132,  266,  398,  132,  476,  132,  132,
1432       132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
1433       132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
1434       132,  132,  132,  134,  134,  134,  134,  134,  134,  134,
1435       134,  134,  134,  134,  134,  135,  135,  428,  428,  308,
1436       135,  429,  429,  135,  135,  135,  135,  476,  650,  135,
1437
1438       308,  135,  135,  135,  135,  135,  135,  135,  135,  135,
1439       135,  135,  135,  135,  135,  135,  135,  135,  135,  135,
1440       135,  135,  323,  323,  323,  323,  135,  135,  135,  135,
1441       135,  135,  135,  135,  135,  135,  135,  135,  135,  135,
1442       135,  135,  135,  135,  135,  135,  135,  135,  135,  135,
1443       135,  155,  155,  155,  274,  486,  486,  486,  155,  274,
1444       291,  400,  308,  155,  155,  291,  155,  155,  155,  155,
1445       155,  274,  291,  400,  155,  155,  155,  155,  155,  155,
1446       155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
1447       155,  155,  155,  155,  155,  339,  339,  339,  339,  155,
1448
1449       155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
1450       155,  155,  155,  155,  155,  155,  155,  155,  155,  155,
1451       155,  155,  155,  155,  159,  303,  302,  288,  302,  367,
1452       368,  303,  503,  503,  256,  648,  159,  303,  302,  288,
1453       278,  256,  256,  256,  256,  281,  647,  256,  278,  278,
1454       278,  278,  278,  281,  281,  281,  281,  281,  350,  350,
1455       350,  350,  367,  368,  643,  159,  159,  159,  159,  159,
1456       159,  159,  159,  159,  159,  159,  159,  160,  256,  306,
1457       411,  303,  160,  642,  306,  160,  160,  160,  160,  160,
1458       288,  306,  411,  160,  160,  160,  160,  160,  160,  160,
1459
1460       160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
1461       160,  160,  160,  160,  373,  373,  373,  373,  160,  160,
1462       160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
1463       160,  160,  160,  160,  160,  160,  160,  160,  160,  160,
1464       160,  160,  160,  162,  282,  698,  162,  162,  162,  162,
1465       162,  641,  282,  282,  282,  282,  282,  283,  283,  283,
1466       283,  283,  283,  283,  283,  283,  283,  283,  318,  318,
1467       374,  374,  374,  374,  162,  318,  318,  318,  318,  162,
1468       162,  162,  162,  162,  162,  162,  162,  162,  162,  162,
1469       162,  430,  430,  456,  505,  505,  430,  434,  434,  434,
1470
1471       434,  556,  162,  175,  175,  175,  175,  175,  175,  175,
1472       175,  175,  175,  175,  175,  176,  176,  343,  698,  456,
1473       176,  506,  506,  176,  176,  176,  176,  176,  459,  176,
1474       343,  176,  176,  176,  176,  176,  176,  176,  176,  176,
1475       176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
1476       176,  176,  556,  459,  176,  343,  176,  176,  176,  176,
1477       176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
1478       176,  176,  176,  176,  176,  176,  176,  176,  176,  176,
1479       176,  178,  178,  178,  178,  178,  178,  178,  178,  178,
1480       178,  178,  178,  179,  179,  346,  640,  502,  179,  568,
1481
1482       568,  179,  179,  179,  179,  179,  502,  179,  346,  179,
1483       179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
1484       179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
1485       370,  370,  370,  346,  179,  179,  179,  179,  179,  179,
1486       179,  179,  179,  179,  179,  179,  179,  179,  179,  179,
1487       179,  179,  179,  179,  179,  179,  179,  179,  179,  219,
1488       219,  219,  219,  219,  219,  219,  219,  219,  219,  219,
1489       286,  292,  488,  591,  591,  370,  487,  465,  286,  286,
1490       286,  286,  286,  292,  219,  219,  219,  219,  219,  219,
1491       219,  219,  219,  219,  219,  219,  220,  220,  220,  220,
1492
1493       220,  220,  220,  220,  220,  220,  220,  300,  601,  300,
1494       465,  638,  606,  286,  637,  300,  300,  300,  300,  300,
1495       292,  220,  220,  220,  220,  220,  220,  220,  220,  220,
1496       220,  220,  220,  225,  225,  487,  420,  488,  225,  606,
1497       629,  225,  225,  225,  225,  225,  623,  225,  420,  225,
1498       225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
1499       225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
1500       628,  623,  225,  601,  225,  225,  225,  225,  225,  225,
1501       225,  225,  225,  225,  225,  225,  225,  225,  225,  225,
1502       225,  225,  225,  225,  225,  225,  225,  225,  225,  245,
1503
1504       245,  245,  245,  245,  376,  245,  245,  245,  245,  245,
1505       245,  289,  622,  245,  245,  287,  289,  376,  624,  245,
1506       245,  294,  245,  287,  287,  287,  287,  287,  289,  294,
1507       294,  294,  294,  294,  289,  305,  620,  613,  379,  380,
1508       659,  659,  376,  624,  245,  245,  245,  305,  376,  334,
1509       412,  379,  380,  334,  338,  390,  345,  421,  287,  289,
1510       334,  338,  412,  345,  482,  390,  482,  390,  404,  421,
1511       404,  482,  390,  245,  245,  246,  379,  380,  305,  412,
1512       404,  294,  379,  380,  630,  338,  626,  345,  246,  613,
1513       246,  246,  246,  246,  246,  246,  246,  246,  246,  246,
1514
1515       246,  246,  246,  246,  246,  246,  246,  246,  246,  246,
1516       246,  626,  421,  338,  334,  345,  555,  555,  555,  246,
1517       248,  248,  248,  248,  248,  248,  248,  248,  248,  248,
1518       248,  248,  257,  422,  396,  699,  619,  658,  673,  630,
1519       729,  729,  396,  618,  422,  257,  396,  257,  257,  257,
1520       257,  257,  257,  257,  257,  257,  257,  257,  257,  257,
1521       257,  257,  257,  257,  257,  257,  257,  257,  442,  612,
1522       257,  532,  431,  375,  375,  631,  257,  279,  375,  496,
1523       442,  375,  375,  375,  375,  431,  532,  375,  658,  279,
1524       673,  496,  407,  279,  279,  279,  279,  279,  279,  279,
1525
1526       279,  279,  279,  279,  407,  406,  422,  611,  699,  634,
1527       431,  610,  375,  406,  406,  406,  406,  406,  279,  279,
1528       279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
1529       284,  284,  444,  496,  634,  284,  631,  608,  284,  284,
1530       284,  284,  284,  407,  284,  444,  284,  284,  284,  284,
1531       284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
1532       284,  284,  284,  284,  284,  284,  284,  700,  607,  284,
1533       444,  284,  284,  284,  284,  284,  284,  284,  284,  284,
1534       284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
1535       284,  284,  284,  284,  284,  284,  295,  295,  644,  418,
1536
1537       605,  418,  687,  730,  730,  603,  633,  602,  295,  646,
1538       295,  418,  295,  295,  295,  295,  295,  295,  295,  295,
1539       295,  295,  295,  295,  295,  295,  295,  295,  295,  295,
1540       295,  295,  295,  633,  731,  731,  667,  646,  667,  600,
1541       700,  295,  296,  296,  296,  296,  296,  296,  296,  296,
1542       296,  296,  296,  296,  301,  445,  644,  687,  633,  466,
1543       466,  466,  646,  667,  469,  469,  469,  301,  445,  301,
1544       301,  301,  301,  301,  301,  301,  301,  301,  301,  301,
1545       301,  301,  301,  301,  301,  301,  301,  301,  301,  301,
1546       414,  388,  301,  445,  599,  693,  590,  604,  301,  324,
1547
1548       589,  408,  414,  324,  466,  388,  388,  388,  388,  469,
1549       324,  604,  324,  408,  324,  324,  324,  324,  324,  324,
1550       324,  324,  324,  324,  324,  324,  324,  324,  324,  324,
1551       324,  324,  324,  324,  324,  414,  715,  324,  587,  324,
1552       324,  324,  324,  324,  324,  324,  324,  324,  324,  324,
1553       324,  409,  408,  693,  415,  391,  409,  413,  489,  451,
1554       489,  665,  324,  337,  388,  391,  415,  391,  409,  413,
1555       489,  585,  391,  451,  451,  665,  337,  584,  337,  337,
1556       337,  337,  337,  337,  337,  337,  337,  337,  337,  337,
1557       337,  337,  337,  337,  337,  337,  337,  337,  337,  415,
1558
1559       419,  337,  341,  583,  413,  582,  419,  734,  734,  715,
1560       409,  660,  419,  751,  751,  341,  581,  341,  341,  341,
1561       341,  341,  341,  341,  341,  341,  341,  341,  341,  341,
1562       341,  341,  341,  341,  341,  341,  341,  341,  668,  660,
1563       341,  344,  344,  344,  344,  344,  344,  344,  344,  344,
1564       344,  344,  344,  399,  399,  580,  419,  579,  546,  546,
1565       546,  668,  578,  668,  660,  399,  577,  399,  576,  399,
1566       399,  399,  399,  399,  399,  399,  399,  399,  399,  399,
1567       399,  399,  399,  399,  399,  399,  399,  399,  399,  399,
1568       416,  470,  399,  401,  574,  495,  573,  572,  416,  416,
1569
1570       416,  416,  416,  546,  470,  457,  401,  495,  401,  401,
1571       401,  401,  401,  401,  401,  401,  401,  401,  401,  401,
1572       401,  401,  401,  401,  401,  401,  401,  401,  401,  470,
1573       471,  401,  402,  500,  491,  457,  571,  410,  570,  491,
1574       495,  567,  492,  471,  402,  500,  457,  417,  417,  410,
1575       472,  491,  417,  480,  492,  417,  417,  417,  417,  417,
1576       410,  417,  457,  472,  566,  480,  639,  653,  471,  492,
1577       554,  681,  639,  402,  402,  402,  402,  402,  402,  402,
1578       402,  402,  402,  402,  402,  410,  417,  448,  472,  497,
1579       553,  639,  653,  552,  551,  492,  681,  639,  653,  549,
1580
1581       448,  497,  448,  448,  448,  448,  448,  448,  448,  448,
1582       448,  448,  448,  448,  448,  448,  448,  448,  448,  448,
1583       448,  448,  448,  501,  596,  448,  480,  490,  490,  564,
1584       548,  544,  542,  541,  501,  540,  596,  539,  538,  490,
1585       564,  490,  497,  490,  490,  490,  490,  490,  490,  490,
1586       490,  490,  490,  490,  490,  490,  490,  490,  490,  490,
1587       490,  490,  490,  490,  493,  494,  490,  498,  499,  493,
1588       499,  697,  498,  510,  525,  526,  694,  494,  537,  531,
1589       499,  493,  508,  508,  498,  494,  510,  525,  526,  508,
1590       508,  508,  508,  531,  531,  558,  501,  558,  559,  536,
1591
1592       550,  535,  564,  533,  694,  530,  560,  558,  561,  562,
1593       559,  510,  525,  526,  550,  550,  550,  550,  560,  563,
1594       561,  562,  697,  529,  593,  569,  569,  588,  594,  694,
1595       527,  563,  569,  569,  569,  569,  593,  595,  560,  559,
1596       594,  588,  588,  588,  588,  597,  524,  598,  523,  595,
1597       616,  635,  522,  521,  562,  661,  593,  597,  598,  520,
1598       563,  617,  616,  635,  636,  649,  652,  561,  562,  519,
1599       674,  652,  617,  550,  664,  636,  649,  661,  518,  677,
1600       517,  595,  516,  661,  515,  664,  675,  594,  690,  514,
1601       677,  652,  513,  512,  511,  616,  509,  504,  674,  690,
1602
1603       588,  485,  661,  674,  695,  597,  701,  702,  661,  484,
1604       483,  481,  689,  479,  675,  695,  477,  701,  702,  475,
1605       598,  609,  609,  674,  609,  609,  609,  609,  609,  688,
1606       609,  609,  609,  609,  617,  609,  609,  636,  649,  675,
1607       689,  609,  609,  609,  609,  675,  473,  664,  703,  704,
1608       468,  609,  677,  705,  464,  688,  463,  688,  462,  703,
1609       704,  690,  706,  689,  705,  689,  609,  609,  609,  609,
1610       461,  460,  458,  706,  707,  708,  609,  695,  709,  701,
1611       702,  710,  688,  711,  455,  707,  708,  454,  712,  709,
1612       453,  452,  710,  450,  711,  609,  609,  615,  615,  712,
1613
1614       615,  615,  615,  615,  615,  615,  615,  615,  615,  615,
1615       449,  615,  615,  713,  446,  441,  440,  615,  615,  615,
1616       615,  703,  704,  439,  713,  714,  705,  615,  438,  437,
1617       436,  435,  433,  432,  425,  706,  714,  423,  405,  403,
1618       394,  393,  615,  615,  615,  615,  392,  707,  708,  389,
1619       387,  709,  615,  385,  710,  381,  711,  377,  372,  371,
1620       366,  712,  365,  364,  363,  358,  357,  356,  355,  354,
1621       353,  615,  615,  625,  625,  352,  625,  625,  625,  625,
1622       625,  351,  625,  625,  625,  625,  713,  625,  625,  348,
1623       347,  332,  330,  625,  625,  625,  625,  328,  714,  327,
1624
1625       326,  325,  322,  625,  321,  320,  319,  309,  299,  297,
1626       285,  280,  276,  270,  268,  264,  263,  262,  625,  625,
1627       625,  625,  261,  259,  258,  252,  251,  250,  625,  240,
1628       239,  238,  237,  235,  231,  230,  229,  228,  227,  214,
1629       213,  212,  211,  210,  207,  206,  205,  625,  625,  632,
1630       632,  204,  632,  632,  632,  632,  632,  632,  632,  632,
1631       632,  632,  203,  632,  632,  202,  198,  197,  189,  632,
1632       632,  632,  632,  177,  174,  172,  170,  169,  164,  632,
1633       163,  161,  150,  148,  147,  145,  143,  142,  141,  140,
1634       139,  126,  125,  124,  632,  632,  632,  632,  123,  122,
1635
1636       121,  120,  118,  117,  632,  116,  115,  114,  105,  103,
1637        99,   96,   95,   94,   90,   85,   82,   55,   54,   46,
1638        18,   17,   14,  632,  632,  719,    9,    3,    0,  719,
1639       719,    0,    0,  719,  719,  719,    0,  719,  719,  719,
1640       719,  719,  720,  720,  720,  720,  720,    0,  720,  720,
1641       720,  720,  720,  720,  720,  720,  720,  720,  720,  720,
1642       720,  720,  721,  721,    0,    0,    0,  721,  721,  721,
1643       722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
1644       722,  722,  722,  722,  722,  722,  722,  722,  722,  722,
1645       723,  723,  723,  723,  723,  723,  723,  723,  723,  723,
1646
1647       723,  723,  723,  723,  723,  723,  723,  723,  723,  723,
1648       724,  724,  724,  724,  724,  724,  724,  724,  724,  724,
1649       724,  724,  724,  724,  724,  724,  724,  724,  724,  724,
1650       725,    0,    0,    0,  725,  725,  725,    0,  725,  725,
1651       725,    0,  725,  725,  725,  725,  725,  726,  726,  726,
1652       726,  726,    0,  726,  726,  726,  726,  726,  726,  726,
1653       726,  726,  726,  726,  726,  726,  726,  727,  727,  727,
1654       727,  727,  727,  727,  727,  727,  727,  727,  727,  727,
1655       727,  727,  727,  727,  727,  727,  727,  728,  728,    0,
1656         0,    0,    0,    0,    0,    0,    0,  728,    0,    0,
1657
1658         0,  728,  728,    0,  728,  732,  732,  732,  732,  732,
1659       732,  732,  732,  732,  732,  732,  732,  732,  732,  732,
1660       732,  732,  732,  732,  732,  733,  733,  733,  733,  733,
1661       733,  733,  733,  733,  733,  733,  733,  733,  733,  733,
1662       733,  733,  733,  733,  733,  735,  735,  735,  735,  735,
1663       735,  735,  735,  735,  735,  735,  735,  735,  735,  735,
1664       735,  735,  735,  735,  735,  736,  736,  736,  736,  736,
1665       736,  736,  736,  736,  736,  736,  736,  736,  736,  736,
1666       736,  736,  736,  736,  736,  737,    0,    0,    0,  737,
1667       737,  737,    0,  737,  737,  737,    0,  737,  737,  737,
1668
1669       737,  737,  738,  738,  738,  738,  738,  738,  738,  738,
1670       738,  738,  738,  738,  738,  738,  738,  738,  738,  738,
1671       738,  738,  739,  739,  739,  739,  739,  739,  739,  739,
1672       739,  739,  739,  739,  739,  739,  739,  739,  739,  739,
1673       739,  739,  740,  740,  740,  740,  740,  740,  740,  740,
1674       740,  740,  740,  740,  740,  740,  740,  740,  740,  740,
1675       740,  740,  741,  741,  741,  741,  741,  741,  741,  741,
1676       741,  741,  741,  741,  741,  741,  741,  741,  741,  741,
1677       741,  741,  742,  742,  742,  742,  742,  742,  742,  742,
1678       742,  742,  742,  742,  742,  742,  742,  742,  742,  742,
1679
1680       742,  742,  743,  743,    0,  743,  743,  743,  743,  743,
1681       743,  743,  743,  743,  743,  743,  743,  743,  743,  743,
1682       743,  743,  744,  744,    0,  744,  744,  744,  744,  744,
1683       744,  744,  744,  744,  744,  744,  744,  744,  744,  744,
1684       744,  744,  745,    0,  745,    0,    0,    0,  745,    0,
1685       745,  745,    0,    0,  745,  746,  746,  746,  746,  746,
1686       746,  746,  746,  746,  746,  746,  746,  746,  746,  746,
1687       746,  746,  746,  746,  746,  747,  747,  747,  747,  747,
1688       747,  747,  747,  747,  747,  747,  747,  747,  747,  747,
1689       747,  747,  747,  747,  747,  748,  748,  748,  748,  748,
1690
1691       748,  748,  748,  748,  748,  748,  748,  748,  748,  748,
1692       748,  748,  748,  748,  748,  749,  749,  749,  749,  749,
1693       749,  749,  749,  749,  749,  749,  749,  749,  749,  749,
1694       749,  749,  749,  749,  749,  750,  750,  750,    0,  750,
1695       750,  750,  750,  750,  752,    0,    0,    0,  752,    0,
1696       752,  752,  752,  752,    0,    0,  752,  753,  753,  753,
1697       753,  753,  753,  753,  753,  753,  753,  753,  753,  753,
1698       753,  753,  753,  753,  753,  753,  753,  754,  754,  754,
1699       754,  754,  754,  754,  754,  754,  754,  754,  754,  754,
1700       754,  754,  754,  754,  754,  754,  754,  755,    0,    0,
1701
1702         0,  755,  755,  755,    0,  755,  755,  755,    0,  755,
1703       755,  755,  755,  755,  756,  756,  756,  756,  756,  756,
1704       756,  756,  756,  756,  756,  756,  756,  756,  756,  756,
1705       756,  756,  756,  756,  757,  757,  757,  757,  757,  757,
1706       757,  757,  757,  757,  757,  757,  757,  757,  757,  757,
1707       757,  757,  757,  757,  758,  758,  758,  758,  758,  758,
1708       758,  758,  758,  758,  758,  758,  758,  758,  758,  758,
1709       758,  758,  758,  758,  759,  759,  759,  759,  759,  759,
1710       759,  759,  759,  759,  759,  759,  759,  759,  759,  759,
1711       759,  759,  759,  759,  760,  760,  760,  760,  760,  760,
1712
1713       760,  760,  760,  760,  760,  760,  760,  760,  760,  760,
1714       760,  760,  760,  760,  761,  761,  761,  761,  761,  761,
1715       761,  761,  761,  761,  761,  761,  761,  761,  761,  761,
1716       761,  761,  761,  761,  762,  762,  762,  762,  762,  762,
1717       762,  762,  762,  762,  762,  762,  762,  762,  762,  762,
1718       762,  762,  762,  762,  763,  763,  763,  763,  763,  763,
1719       763,  763,  763,  763,  763,  763,  763,  763,  763,  763,
1720       763,  763,  763,  763,  764,  764,    0,  764,  764,  764,
1721       764,  764,  764,  764,  764,  764,  764,  764,  764,  764,
1722       764,  764,  764,  764,  765,  765,    0,  765,  765,  765,
1723
1724       765,  765,  765,  765,  765,  765,  765,  765,  765,  765,
1725       765,  765,  765,  765,  766,    0,  766,    0,    0,    0,
1726       766,    0,  766,  766,    0,    0,  766,  767,    0,    0,
1727         0,    0,    0,  767,  767,  767,  767,  767,  768,  768,
1728       768,  768,  768,  768,  768,  768,  768,  768,  768,  768,
1729       768,  768,  768,  768,  768,  768,  768,  768,  769,  769,
1730       769,  769,  769,  769,  769,  769,  769,  769,  769,  769,
1731       769,  769,  769,  769,  769,  769,  769,  769,  770,  770,
1732       770,  770,  770,  770,  770,  770,  770,  770,  770,  770,
1733       770,  770,  770,  770,  770,  770,  770,  770,  771,  771,
1734
1735       771,  771,  771,  771,  771,  771,  771,  771,  771,  771,
1736       771,  771,  771,  771,  771,  771,  771,  771,  772,  772,
1737         0,    0,  772,  772,    0,  772,  772,  772,  772,  772,
1738       772,  772,  772,  772,  772,  773,    0,    0,    0,    0,
1739         0,  773,  773,  773,  773,  773,    0,  773,  774,  774,
1740       774,  774,  774,  774,  774,  774,  774,  774,  774,  774,
1741       774,  774,  774,  774,  774,  774,  774,  774,  775,  775,
1742       775,  775,  775,  775,  775,  775,  775,  775,  775,  775,
1743       775,  775,  775,  775,  775,  775,  775,  775,  776,  776,
1744         0,    0,  776,  776,  776,  776,  776,  776,  776,  776,
1745
1746       776,  776,  776,  776,  776,  777,  777,  777,  777,  777,
1747       777,  777,  777,  777,  777,  777,  777,  777,  777,  777,
1748       777,  777,  777,  777,  777,  778,  778,  778,  778,  778,
1749       778,  778,  778,  778,  778,  778,  778,  778,  778,  778,
1750       778,  778,  778,  778,  778,  779,  779,  779,  779,  779,
1751       779,  779,  779,  779,  779,  779,  779,  779,  779,  779,
1752       779,  779,  779,  779,  779,  780,  780,  780,  780,  780,
1753       780,  780,  780,  780,  780,  780,  780,  780,  780,  780,
1754       780,  780,  780,  780,  780,  781,  781,  781,  781,  781,
1755       781,  781,  781,  781,  781,  781,  781,  781,  781,  781,
1756
1757       781,  781,  781,  781,  781,  782,  782,  782,  782,  782,
1758       782,  782,  782,  782,  782,  782,  782,  782,  782,  782,
1759       782,  782,  782,  782,  782,  783,  783,  783,  783,  783,
1760       783,  783,  783,  783,  783,  783,  783,  783,  783,  783,
1761       783,  783,  783,  783,  783,  784,    0,    0,    0,    0,
1762         0,  784,  784,  784,  784,  784,  785,  785,    0,  785,
1763       785,  785,  785,  785,  785,  785,  785,  785,  785,  785,
1764       785,  785,  785,  785,  785,  785,  786,  786,    0,  786,
1765       786,  786,  786,  786,  786,  786,  786,  786,  786,  786,
1766       786,  786,  786,  786,  786,  786,  787,  787,    0,  787,
1767
1768       787,  787,  787,  787,  787,  787,  787,  787,  787,  787,
1769       787,  787,  787,  787,  787,  787,  788,  788,    0,  788,
1770       788,  788,  788,  788,  788,  788,  788,  788,  788,  788,
1771       788,  788,  788,  788,  788,  788,  789,  789,    0,  789,
1772       789,  789,  789,  789,  789,  789,  789,  789,  789,  789,
1773       789,  789,  789,  789,  789,  789,  790,  790,    0,  790,
1774       790,  790,  790,  790,  790,  790,  790,  790,  790,  790,
1775       790,  790,  790,  790,  790,  790,  791,  791,  791,  791,
1776       791,  791,  791,  791,  791,  791,  791,  791,  791,  791,
1777       791,  791,  791,  791,  791,  791,  792,  792,  792,  792,
1778
1779       792,  792,  792,  792,  792,  792,  792,  792,  792,  792,
1780       792,  792,  792,  792,  792,  792,  793,  793,  793,  793,
1781       793,  793,  793,  793,  793,  793,  793,  793,  793,  793,
1782       793,  793,  793,  793,  793,  793,  794,    0,    0,    0,
1783         0,    0,  794,  794,  794,  794,  794,  794,  794,  794,
1784       794,  794,  795,  795,  795,  795,  795,  795,  795,  795,
1785       795,  795,  795,  795,  795,  795,  795,  795,  795,  795,
1786       795,  795,  796,  796,  796,  796,  796,  796,  796,  796,
1787       796,  796,  796,  796,  796,  796,  796,  796,  796,  796,
1788       796,  796,  797,  797,  797,  797,    0,  797,  797,  797,
1789
1790       797,  797,  797,  797,  797,  797,  797,  797,  797,  797,
1791       797,  797,  798,    0,    0,    0,    0,    0,  798,  798,
1792       798,  798,  798,  799,  799,    0,  799,  799,  799,  799,
1793       799,  799,  799,  799,  799,  799,  799,  799,  799,  799,
1794       799,  799,  799,  800,  800,    0,  800,  800,  800,  800,
1795       800,  800,  800,  800,  800,  800,  800,  800,  800,  800,
1796       800,  800,  800,  801,  801,    0,  801,  801,  801,  801,
1797       801,  801,  801,  801,  801,  801,  801,  801,  801,  801,
1798       801,  801,  801,  802,  802,    0,  802,  802,  802,  802,
1799       802,  802,  802,  802,  802,  802,  802,  802,  802,  802,
1800
1801       802,  802,  802,  803,  803,  803,  803,  803,  803,  803,
1802       803,  803,  803,  803,  803,  803,  803,  803,  803,  803,
1803       803,  803,  803,  804,  804,  804,  804,  804,  804,  804,
1804       804,  804,  804,  804,  804,  804,  804,  804,  804,  804,
1805       804,  804,  804,  805,  805,  805,  805,  805,  805,  805,
1806       805,  805,  805,  805,  805,  805,  805,  805,  805,  805,
1807       805,  805,  805,  806,  806,  806,  806,  806,  806,  806,
1808       806,  806,  806,  806,  806,  806,  806,  806,  806,  806,
1809       806,  806,  806,  718,  718,  718,  718,  718,  718,  718,
1810       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1811
1812       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1813       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1814       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1815       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1816       718,  718,  718,  718,  718,  718,  718,  718,  718,  718,
1817       718,  718,  718,  718,  718,  718,  718,  718,  718,  718
1818     } ;
1819
1820 extern int yy_flex_debug;
1821 int yy_flex_debug = 0;
1822
1823 static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
1824 static char *yy_full_match;
1825 static int yy_lp;
1826 static int yy_looking_for_trail_begin = 0;
1827 static int yy_full_lp;
1828 static int *yy_full_state;
1829 #define YY_TRAILING_MASK 0x2000
1830 #define YY_TRAILING_HEAD_MASK 0x4000
1831 #define REJECT \
1832 { \
1833 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
1834 yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
1835 (yy_lp) = (yy_full_lp); /* restore orig. accepting pos. */ \
1836 (yy_state_ptr) = (yy_full_state); /* restore orig. state */ \
1837 yy_current_state = *(yy_state_ptr); /* restore curr. state */ \
1838 ++(yy_lp); \
1839 goto find_rule; \
1840 }
1841
1842 #define yymore() yymore_used_but_not_detected
1843 #define YY_MORE_ADJ 0
1844 #define YY_RESTORE_YY_MORE_OFFSET
1845 char *yytext;
1846 #line 1 "parser.l"
1847 #line 8 "parser.l"
1848 /*
1849  * parser.l -- lex parser of algebraic chess moves for XBoard
1850  *
1851  * Copyright 1991 by Digital Equipment Corporation, Maynard,
1852  * Massachusetts.
1853  *
1854  * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005,
1855  * 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1856  *
1857  * The following terms apply to Digital Equipment Corporation's copyright
1858  * interest in XBoard:
1859  * ------------------------------------------------------------------------
1860  * All Rights Reserved
1861  *
1862  * Permission to use, copy, modify, and distribute this software and its
1863  * documentation for any purpose and without fee is hereby granted,
1864  * provided that the above copyright notice appear in all copies and that
1865  * both that copyright notice and this permission notice appear in
1866  * supporting documentation, and that the name of Digital not be
1867  * used in advertising or publicity pertaining to distribution of the
1868  * software without specific, written prior permission.
1869  *
1870  * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
1871  * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
1872  * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
1873  * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
1874  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
1875  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
1876  * SOFTWARE.
1877  * ------------------------------------------------------------------------
1878  *
1879  * The following terms apply to the enhanced version of XBoard
1880  * distributed by the Free Software Foundation:
1881  * ------------------------------------------------------------------------
1882  *
1883  * GNU XBoard is free software: you can redistribute it and/or modify
1884  * it under the terms of the GNU General Public License as published by
1885  * the Free Software Foundation, either version 3 of the License, or (at
1886  * your option) any later version.
1887  *
1888  * GNU XBoard is distributed in the hope that it will be useful, but
1889  * WITHOUT ANY WARRANTY; without even the implied warranty of
1890  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1891  * General Public License for more details.
1892  *
1893  * You should have received a copy of the GNU General Public License
1894  * along with this program. If not, see http://www.gnu.org/licenses/.  
1895  *
1896  *------------------------------------------------------------------------
1897  ** See the file ChangeLog for a revision history.  */
1898
1899 /* This parser handles all forms of promotion.
1900  * The parser resolves ambiguous moves by searching and check-testing.
1901  * It also parses comments of the form [anything] or (anything).
1902  *
1903  * [HGM] Parser extensively modified for bigger boards, Shogi-like syntax,
1904  * and unknow pieces. All pieces are now mandatory upper case, but can be
1905  * any letter A-Z. Files must be lower case (as before), but can run upto 'l'.
1906  * Ranks can be 0-9. The parser returns 0 for off-board files and ranks.
1907  * For an unknown piece (as mover or promotion piece) it returns
1908  * IllegalMove, like it does when the piece doesn't match.
1909  * Promotions can now also be appended Shogi-style, a bare '=' or '^',
1910  * and this is then returned as promotion character. The piece indicator
1911  * can be prefixed by a '+' to indicate it is a promoted piece.
1912  */
1913
1914 #include "config.h"
1915
1916 #define NO_CONSTRAINT   -1
1917 #undef YYLMAX
1918 #define YYLMAX                  4096
1919 #define UNPUT_BUF_SIZE          YYLMAX
1920
1921 #ifdef FLEX_SCANNER
1922 /* yytext is probably a char*, but could be a char[].  yy_text is set
1923    in YY_DECL below, because if yytext is a char*, its value is not
1924    constant. */
1925 char *yy_text;
1926 #else /*!FLEX_SCANNER*/
1927 /* yytext is definitely a char[], so yy_text can be set here, statically. */
1928 char *yy_text = (char *) yytext;
1929 #endif
1930
1931 #ifdef FLEX_SCANNER
1932 /* This is flex */
1933 /* [AP] use prototypes in function declarations */
1934 #define YY_USE_PROTOS
1935
1936 #ifdef YY_USE_PROTOS
1937 #define YY_PROTO(proto) proto
1938 #else
1939 #define YY_PROTO(proto) ()
1940 #endif
1941 /* end of [AP] fix */
1942
1943 #undef YY_INPUT
1944 #define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size)
1945 #undef YY_DECL
1946 #define YY_DECL                     \
1947     int _yylex YY_PROTO((void));    \
1948     int yylex YY_PROTO((void))      \
1949     {                               \
1950         int result = _yylex();      \
1951         yy_text = (char *) yytext;  \
1952         return(result);             \
1953     }                               \
1954     int _yylex YY_PROTO((void))
1955 #else
1956 /* This is lex */
1957 #undef input
1958 #undef output
1959 #undef unput
1960 #endif
1961
1962 /* The includes must be here, below the #undef input */
1963
1964 #include <ctype.h>
1965
1966 #if STDC_HEADERS
1967 # include <stdlib.h>
1968 # include <string.h>
1969 #else /* not STDC_HEADERS */
1970 # if HAVE_STRING_H
1971 #  include <string.h>
1972 # else /* not HAVE_STRING_H */
1973 #  include <strings.h>
1974 # endif /* not HAVE_STRING_H */
1975 #endif /* not STDC_HEADERS */
1976
1977 #if HAVE_UNISTD_H
1978 # include <unistd.h>
1979 #endif
1980
1981 #if defined(_amigados)
1982 # include <errno.h>
1983 # if HAVE_FCNTL_H
1984 #  include <fcntl.h>    /*  isatty() prototype  */
1985 # endif /*  HAVE_FCNTL_H        */
1986 #endif  /*  defined(_amigados)  */
1987
1988 #include "common.h"
1989 #include "backend.h"
1990 #include "frontend.h"
1991 #include "parser.h"
1992 #include "moves.h"
1993
1994 extern int PosFlags P((int));
1995
1996 extern Board    boards[MAX_MOVES];
1997 int             yyboardindex;
1998 int             yyskipmoves = FALSE;
1999 char            currentMoveString[YYLMAX];
2000 #ifndef FLEX_SCANNER
2001 char            unputBuffer[UNPUT_BUF_SIZE];
2002 int             unputCount = 0;
2003 #endif
2004
2005 #ifdef FLEX_SCANNER
2006 void my_yy_input P((char *buf, int *result, int max_size));
2007 #else /*!FLEX_SCANNER*/
2008 static int input P((void));
2009 static void output P((int ch));
2010 static void unput P((int ch));
2011 int yylook P((void));
2012 int yyback P((int *, int));
2013 #endif
2014 #undef yywrap
2015 int yywrap P((void));
2016 extern void CopyBoard P((Board to, Board from));
2017
2018 #line 2019 "parser.c"
2019
2020 #define INITIAL 0
2021
2022 #ifndef YY_NO_UNISTD_H
2023 /* Special case for "unistd.h", since it is non-ANSI. We include it way
2024  * down here because we want the user's section 1 to have been scanned first.
2025  * The user has a chance to override it with an option.
2026  */
2027 #include <unistd.h>
2028 #endif
2029
2030 #ifndef YY_EXTRA_TYPE
2031 #define YY_EXTRA_TYPE void *
2032 #endif
2033
2034 static int yy_init_globals (void );
2035
2036 /* Macros after this point can all be overridden by user definitions in
2037  * section 1.
2038  */
2039
2040 #ifndef YY_SKIP_YYWRAP
2041 #ifdef __cplusplus
2042 extern "C" int yywrap (void );
2043 #else
2044 extern int yywrap (void );
2045 #endif
2046 #endif
2047
2048     static void yyunput (int c,char *buf_ptr  );
2049     
2050 #ifndef yytext_ptr
2051 static void yy_flex_strncpy (char *,yyconst char *,int );
2052 #endif
2053
2054 #ifdef YY_NEED_STRLEN
2055 static int yy_flex_strlen (yyconst char * );
2056 #endif
2057
2058 #ifndef YY_NO_INPUT
2059
2060 #ifdef __cplusplus
2061 static int yyinput (void );
2062 #else
2063 static int input (void );
2064 #endif
2065
2066 #endif
2067
2068 /* Amount of stuff to slurp up with each read. */
2069 #ifndef YY_READ_BUF_SIZE
2070 #define YY_READ_BUF_SIZE 8192
2071 #endif
2072
2073 /* Copy whatever the last rule matched to the standard output. */
2074 #ifndef ECHO
2075 /* This used to be an fputs(), but since the string might contain NUL's,
2076  * we now use fwrite().
2077  */
2078 #define ECHO fwrite( yytext, yyleng, 1, yyout )
2079 #endif
2080
2081 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
2082  * is returned in "result".
2083  */
2084 #ifndef YY_INPUT
2085 #define YY_INPUT(buf,result,max_size) \
2086         if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
2087                 { \
2088                 int c = '*'; \
2089                 int n; \
2090                 for ( n = 0; n < max_size && \
2091                              (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
2092                         buf[n] = (char) c; \
2093                 if ( c == '\n' ) \
2094                         buf[n++] = (char) c; \
2095                 if ( c == EOF && ferror( yyin ) ) \
2096                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
2097                 result = n; \
2098                 } \
2099         else \
2100                 { \
2101                 errno=0; \
2102                 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
2103                         { \
2104                         if( errno != EINTR) \
2105                                 { \
2106                                 YY_FATAL_ERROR( "input in flex scanner failed" ); \
2107                                 break; \
2108                                 } \
2109                         errno=0; \
2110                         clearerr(yyin); \
2111                         } \
2112                 }\
2113 \
2114
2115 #endif
2116
2117 /* No semi-colon after return; correct usage is to write "yyterminate();" -
2118  * we don't want an extra ';' after the "return" because that will cause
2119  * some compilers to complain about unreachable statements.
2120  */
2121 #ifndef yyterminate
2122 #define yyterminate() return YY_NULL
2123 #endif
2124
2125 /* Number of entries by which start-condition stack grows. */
2126 #ifndef YY_START_STACK_INCR
2127 #define YY_START_STACK_INCR 25
2128 #endif
2129
2130 /* Report a fatal error. */
2131 #ifndef YY_FATAL_ERROR
2132 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
2133 #endif
2134
2135 /* end tables serialization structures and prototypes */
2136
2137 /* Default declaration of generated scanner - a define so the user can
2138  * easily add parameters.
2139  */
2140 #ifndef YY_DECL
2141 #define YY_DECL_IS_OURS 1
2142
2143 extern int yylex (void);
2144
2145 #define YY_DECL int yylex (void)
2146 #endif /* !YY_DECL */
2147
2148 /* Code executed at the beginning of each rule, after yytext and yyleng
2149  * have been set up.
2150  */
2151 #ifndef YY_USER_ACTION
2152 #define YY_USER_ACTION
2153 #endif
2154
2155 /* Code executed at the end of each rule. */
2156 #ifndef YY_BREAK
2157 #define YY_BREAK break;
2158 #endif
2159
2160 #define YY_RULE_SETUP \
2161         if ( yyleng > 0 ) \
2162                 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
2163                                 (yytext[yyleng - 1] == '\n'); \
2164         YY_USER_ACTION
2165
2166 /** The main scanner function which does all the work.
2167  */
2168 YY_DECL
2169 {
2170         register yy_state_type yy_current_state;
2171         register char *yy_cp, *yy_bp;
2172         register int yy_act;
2173     
2174 #line 179 "parser.l"
2175
2176
2177 #line 2178 "parser.c"
2178
2179         if ( !(yy_init) )
2180                 {
2181                 (yy_init) = 1;
2182
2183 #ifdef YY_USER_INIT
2184                 YY_USER_INIT;
2185 #endif
2186
2187         /* Create the reject buffer large enough to save one state per allowed character. */
2188         if ( ! (yy_state_buf) )
2189             (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  );
2190             if ( ! (yy_state_buf) )
2191                 YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
2192
2193                 if ( ! (yy_start) )
2194                         (yy_start) = 1; /* first start state */
2195
2196                 if ( ! yyin )
2197                         yyin = stdin;
2198
2199                 if ( ! yyout )
2200                         yyout = stdout;
2201
2202                 if ( ! YY_CURRENT_BUFFER ) {
2203                         yyensure_buffer_stack ();
2204                         YY_CURRENT_BUFFER_LVALUE =
2205                                 yy_create_buffer(yyin,YY_BUF_SIZE );
2206                 }
2207
2208                 yy_load_buffer_state( );
2209                 }
2210
2211         while ( 1 )             /* loops until end-of-file is reached */
2212                 {
2213                 yy_cp = (yy_c_buf_p);
2214
2215                 /* Support of yytext. */
2216                 *yy_cp = (yy_hold_char);
2217
2218                 /* yy_bp points to the position in yy_ch_buf of the start of
2219                  * the current run.
2220                  */
2221                 yy_bp = yy_cp;
2222
2223                 yy_current_state = (yy_start);
2224                 yy_current_state += YY_AT_BOL();
2225
2226                 (yy_state_ptr) = (yy_state_buf);
2227                 *(yy_state_ptr)++ = yy_current_state;
2228
2229 yy_match:
2230                 do
2231                         {
2232                         register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
2233                         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2234                                 {
2235                                 yy_current_state = (int) yy_def[yy_current_state];
2236                                 if ( yy_current_state >= 719 )
2237                                         yy_c = yy_meta[(unsigned int) yy_c];
2238                                 }
2239                         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2240                         *(yy_state_ptr)++ = yy_current_state;
2241                         ++yy_cp;
2242                         }
2243                 while ( yy_base[yy_current_state] != 4684 );
2244
2245 yy_find_action:
2246                 yy_current_state = *--(yy_state_ptr);
2247                 (yy_lp) = yy_accept[yy_current_state];
2248 find_rule: /* we branch to this label when backing up */
2249                 for ( ; ; ) /* until we find what rule we matched */
2250                         {
2251                         if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
2252                                 {
2253                                 yy_act = yy_acclist[(yy_lp)];
2254                                 if ( yy_act & YY_TRAILING_HEAD_MASK ||
2255                                      (yy_looking_for_trail_begin) )
2256                                         {
2257                                         if ( yy_act == (yy_looking_for_trail_begin) )
2258                                                 {
2259                                                 (yy_looking_for_trail_begin) = 0;
2260                                                 yy_act &= ~YY_TRAILING_HEAD_MASK;
2261                                                 break;
2262                                                 }
2263                                         }
2264                                 else if ( yy_act & YY_TRAILING_MASK )
2265                                         {
2266                                         (yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;
2267                                         (yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;
2268                                         }
2269                                 else
2270                                         {
2271                                         (yy_full_match) = yy_cp;
2272                                         (yy_full_state) = (yy_state_ptr);
2273                                         (yy_full_lp) = (yy_lp);
2274                                         break;
2275                                         }
2276                                 ++(yy_lp);
2277                                 goto find_rule;
2278                                 }
2279                         --yy_cp;
2280                         yy_current_state = *--(yy_state_ptr);
2281                         (yy_lp) = yy_accept[yy_current_state];
2282                         }
2283
2284                 YY_DO_BEFORE_ACTION;
2285
2286 do_action:      /* This label is used only to access EOF actions. */
2287
2288                 switch ( yy_act )
2289         { /* beginning of action switch */
2290 case 1:
2291 YY_RULE_SETUP
2292 #line 181 "parser.l"
2293 {
2294     /*
2295      * Fully-qualified algebraic move, possibly with promotion
2296      */
2297     int skip1 = 0, skip2 = 0, skip3 = 0, promoted = 0;
2298     ChessSquare piece;
2299     ChessMove result;
2300     char c;
2301     
2302     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2303
2304     if (yytext[0] == '+') skip1 = skip3 = promoted = 1; /* [HGM] Shogi promoted */
2305
2306     /* remove the / */
2307     if (yytext[1+skip1] == '/')  skip1++; 
2308     
2309     /* remove the [xX:-] */
2310     if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') ||
2311         (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1;
2312     
2313     currentMoveString[0] = yytext[1+skip1];
2314     currentMoveString[1] = yytext[2+skip1];
2315     currentMoveString[2] = yytext[3+skip1+skip2];
2316     currentMoveString[3] = yytext[4+skip1+skip2];
2317     currentMoveString[4] = NULLCHAR;
2318     
2319     if (appData.debugMode) {
2320         fprintf(debugFP, "Parser Qa1b2: yyleng=%d\n",
2321         yyleng);
2322     }
2323
2324     if (yyleng-skip1-skip2 > 5) { char c;
2325         if (yytext[yyleng-1] == ')') {
2326             c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2327         } else {
2328             c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2329         }
2330         currentMoveString[5] = NULLCHAR;
2331     }
2332
2333     if (appData.debugMode) {
2334         fprintf(debugFP, "parser: %s\n", currentMoveString);
2335     }
2336     /* [HGM] do not allow values beyond board size */
2337     if(currentMoveString[1] - ONE >= BOARD_HEIGHT ||
2338        currentMoveString[1] - ONE <  0            ||
2339        currentMoveString[0] - AAA >= BOARD_RGHT   ||
2340        currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2341        currentMoveString[3] - ONE <  0            ||
2342        currentMoveString[2] - AAA >= BOARD_RGHT   ||
2343        currentMoveString[0] - AAA <  BOARD_LEFT   ||
2344        currentMoveString[2] - AAA <  BOARD_LEFT     )
2345       return ImpossibleMove;
2346
2347     piece = boards[yyboardindex]
2348       [currentMoveString[1] - ONE][currentMoveString[0] - AAA];
2349     if(PieceToChar(piece) == '+' && appData.icsActive) promoted = 1, yytext[skip3] = PieceToChar(DEMOTED piece); // trust ICS
2350     if(promoted) piece = (ChessSquare) (DEMOTED piece);
2351     c = PieceToChar(piece);
2352     if(c == '~') c = PieceToChar((ChessSquare) (DEMOTED piece));
2353     if (ToLower(yytext[skip3]) != ToLower(c))
2354       return (int) IllegalMove;
2355
2356     result = LegalityTest(boards[yyboardindex],
2357                           PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
2358                           currentMoveString[1] - ONE,
2359                           currentMoveString[0] - AAA,
2360                           currentMoveString[3] - ONE,
2361                           currentMoveString[2] - AAA,
2362                           currentMoveString[4]);
2363
2364     if (currentMoveString[4] == NULLCHAR) {
2365       if(result == WhitePromotion  || result == BlackPromotion) {
2366         if(gameInfo.variant == VariantCourier || gameInfo.variant == VariantShatranj)
2367             currentMoveString[4] = PieceToChar(BlackFerz);
2368         else if(gameInfo.variant == VariantGreat)
2369             currentMoveString[4] = PieceToChar(BlackMan);
2370         else if(gameInfo.variant == VariantShogi)
2371             currentMoveString[4] = '^';
2372         else
2373             currentMoveString[4] = PieceToChar(BlackQueen);
2374       } else if(result == WhiteNonPromotion  || result == BlackNonPromotion)
2375             currentMoveString[4] = '=';
2376       currentMoveString[5] = NULLCHAR;
2377     }
2378
2379     return (int) result;
2380 }
2381         YY_BREAK
2382 case 2:
2383 YY_RULE_SETUP
2384 #line 270 "parser.l"
2385 {
2386     /*
2387      * Simple algebraic move, possibly with promotion
2388      * [HGM] Engine moves are received in this format, with lower-case promoChar!
2389      */
2390     int skip = 0;
2391     ChessMove result;
2392
2393     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2394
2395     /* remove the [xX:-] */
2396     if ((yytext[2] == 'x') || (yytext[2] == 'X') ||
2397         (yytext[2] == '-') || (yytext[2] == ':')) skip = 1;
2398
2399     currentMoveString[0] = yytext[0];
2400     currentMoveString[1] = yytext[1];
2401     currentMoveString[2] = yytext[2+skip];
2402     currentMoveString[3] = yytext[3+skip];
2403     currentMoveString[4] = NULLCHAR;
2404
2405     if (yyleng-skip > 4) { char c;
2406         if (yytext[yyleng-1] == ')') {
2407             c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2408         } else {
2409             c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2410         }
2411         currentMoveString[5] = NULLCHAR;
2412     }
2413
2414     /* [HGM] do not allow values beyond board size */
2415     if(currentMoveString[1] - ONE >= BOARD_HEIGHT ||
2416        currentMoveString[1] - ONE <  0            ||
2417        currentMoveString[0] - AAA >= BOARD_RGHT   ||
2418        currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2419        currentMoveString[3] - ONE <  0            ||
2420        currentMoveString[2] - AAA >= BOARD_RGHT   ||
2421        currentMoveString[0] - AAA <  BOARD_LEFT   ||
2422        currentMoveString[2] - AAA <  BOARD_LEFT     )
2423       return ImpossibleMove;
2424
2425     result = LegalityTest(boards[yyboardindex],
2426                           PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
2427                           currentMoveString[1] - ONE,
2428                           currentMoveString[0] - AAA,
2429                           currentMoveString[3] - ONE,
2430                           currentMoveString[2] - AAA,
2431                           currentMoveString[4]);
2432
2433     if (currentMoveString[4] == NULLCHAR) {
2434       if(result == WhitePromotion  || result == BlackPromotion) {
2435         if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)
2436             currentMoveString[4] = PieceToChar(BlackFerz);
2437         else if(gameInfo.variant == VariantGreat)
2438             currentMoveString[4] = PieceToChar(BlackMan);
2439         else if(gameInfo.variant == VariantShogi)
2440             currentMoveString[4] = '^'; // Queen might not be defined in mini variants!
2441         else
2442             currentMoveString[4] = PieceToChar(BlackQueen);
2443       } else if(result == WhiteNonPromotion  || result == BlackNonPromotion)
2444             currentMoveString[4] = '=';
2445       currentMoveString[5] = NULLCHAR;
2446     } else if(appData.testLegality && // strip off unnecessary and false promo characters
2447        !(result == WhitePromotion  || result == BlackPromotion ||
2448          result == WhiteNonPromotion || result == BlackNonPromotion)) currentMoveString[4] = NULLCHAR;
2449
2450     return (int) result;
2451 }
2452         YY_BREAK
2453 case 3:
2454 YY_RULE_SETUP
2455 #line 338 "parser.l"
2456 {
2457     /*
2458      * Simple algebraic move, in capitals
2459      * [HGM] Some Xiangqi engines use this format ('ICCS notation'). So no promotions!
2460      */
2461     int skip = 0;
2462     ChessMove result;
2463
2464     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2465
2466     /* remove the [xX:-] */
2467     if ((yytext[2] == 'x') || (yytext[2] == 'X') ||
2468         (yytext[2] == '-') || (yytext[2] == ':')) skip = 1;
2469
2470     currentMoveString[0] = yytext[0]+32;
2471     currentMoveString[1] = yytext[1];
2472     currentMoveString[2] = yytext[2+skip]+32;
2473     currentMoveString[3] = yytext[3+skip];
2474     currentMoveString[4] = NULLCHAR;
2475
2476     /* [HGM] do not allow values beyond board size */
2477     if(currentMoveString[1] - ONE >= BOARD_HEIGHT ||
2478        currentMoveString[1] - ONE <  0            ||
2479        currentMoveString[0] - AAA >= BOARD_RGHT   ||
2480        currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2481        currentMoveString[3] - ONE <  0            ||
2482        currentMoveString[2] - AAA >= BOARD_RGHT   ||
2483        currentMoveString[0] - AAA <  BOARD_LEFT   ||
2484        currentMoveString[2] - AAA <  BOARD_LEFT     )
2485       return ImpossibleMove;
2486
2487     result = LegalityTest(boards[yyboardindex],
2488                           PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
2489                           currentMoveString[1] - ONE,
2490                           currentMoveString[0] - AAA,
2491                           currentMoveString[3] - ONE,
2492                           currentMoveString[2] - AAA,
2493                           currentMoveString[4]);
2494
2495     return (int) result;
2496 }
2497         YY_BREAK
2498 case 4:
2499 YY_RULE_SETUP
2500 #line 380 "parser.l"
2501 {
2502     /*
2503      * Pawn move, possibly with promotion
2504      */
2505     DisambiguateClosure cl;
2506     int skip = 0; char c;
2507
2508     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2509
2510     /* remove the =() */
2511     if (yytext[2] == '=' && yytext[3] != NULLCHAR) skip++;
2512     if (yytext[2+skip] == '(') skip++;
2513
2514     cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
2515     cl.rfIn = -1;
2516     cl.ffIn = yytext[0] - AAA;
2517     cl.rtIn = yytext[1] - ONE;
2518     cl.ftIn = yytext[0] - AAA;
2519     c = cl.promoCharIn = ToLower(yytext[2+skip]);
2520
2521     /* [HGM] do not allow values beyond board size */
2522     if(cl.rtIn >= BOARD_HEIGHT ||
2523        cl.rtIn <  0            ||
2524        cl.ffIn >= BOARD_RGHT   ||
2525        cl.ftIn <  BOARD_LEFT     )
2526       return ImpossibleMove;
2527
2528     Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
2529
2530     currentMoveString[0] = cl.ff + AAA;
2531     currentMoveString[1] = cl.rf + ONE;
2532     currentMoveString[2] = cl.ft + AAA;
2533     currentMoveString[3] = cl.rt + ONE;
2534     currentMoveString[4] = cl.promoChar;
2535     currentMoveString[5] = NULLCHAR;
2536
2537     return (int) cl.kind;
2538 }
2539         YY_BREAK
2540 case 5:
2541 YY_RULE_SETUP
2542 #line 420 "parser.l"
2543 {
2544     /*
2545      * Pawn capture, possibly with promotion, possibly ambiguous
2546      */
2547     DisambiguateClosure cl;
2548     int skip1 = 0, skip2 = 0; char c;
2549
2550     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2551
2552     /* remove trailing ep or e.p. (nonstandard PGN) */
2553     if (yytext[yyleng-1] == 'p') {
2554       yyleng -= 2;
2555       yytext[yyleng] = NULLCHAR;
2556     } else if (yytext[yyleng-1] == '.') {
2557       yyleng -= 4;
2558       yytext[yyleng] = NULLCHAR;
2559     }
2560
2561     /* remove the [xX:-] and =() */
2562     if ((yytext[1] == 'x') || (yytext[1] == 'X')
2563         || (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1;
2564     if (yytext[2+skip1] == '=' && yytext[3+skip1] != NULLCHAR) skip2++;
2565     if (yytext[2+skip1+skip2] == '(') skip2++;
2566
2567     cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
2568     cl.rfIn = -1;
2569     cl.ffIn = yytext[0] - AAA;
2570     cl.rtIn = -1;
2571     cl.ftIn = yytext[1+skip1] - AAA;
2572     c = cl.promoCharIn = yytext[2+skip1+skip2];
2573
2574     /* [HGM] do not allow values beyond board size */
2575     if(cl.ffIn >= BOARD_RGHT  ||
2576        cl.ffIn <  BOARD_LEFT  ||
2577        cl.ftIn >= BOARD_RGHT  ||
2578        cl.ftIn <  BOARD_LEFT     )
2579       return ImpossibleMove;
2580
2581     Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
2582
2583     currentMoveString[0] = cl.ff + AAA;
2584     currentMoveString[1] = cl.rf + ONE;
2585     currentMoveString[2] = cl.ft + AAA;
2586     currentMoveString[3] = cl.rt + ONE;
2587     currentMoveString[4] = cl.promoChar;
2588     currentMoveString[5] = NULLCHAR;
2589
2590     return (int) cl.kind;
2591 }
2592         YY_BREAK
2593 case 6:
2594 YY_RULE_SETUP
2595 #line 470 "parser.l"
2596 {
2597     /*
2598      * unambiguously abbreviated Pawn capture, possibly with promotion
2599      */
2600     int skip = 0;
2601     ChessMove result; char c;
2602
2603     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2604
2605     /* remove trailing ep or e.p. (nonstandard PGN) */
2606     if (yytext[yyleng-1] == 'p') {
2607       yyleng -= 2;
2608       yytext[yyleng] = NULLCHAR;
2609     } else if (yytext[yyleng-1] == '.') {
2610       yyleng -= 4;
2611       yytext[yyleng] = NULLCHAR;
2612     }
2613
2614     /* remove the [xX:-] */
2615     if ((yytext[1] == 'x') || (yytext[1] == 'X')
2616         || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1;
2617
2618     currentMoveString[0] = yytext[0];
2619     currentMoveString[2] = yytext[1+skip];
2620     currentMoveString[3] = yytext[2+skip];
2621
2622     /* [HGM] do not allow values beyond board size */
2623     if(currentMoveString[0] - AAA >= BOARD_RGHT   ||
2624        currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2625        currentMoveString[3] - ONE <  0            ||
2626        currentMoveString[2] - AAA >= BOARD_RGHT   ||
2627        currentMoveString[0] - AAA <  BOARD_LEFT   ||
2628        currentMoveString[2] - AAA <  BOARD_LEFT     )
2629       return ImpossibleMove;
2630
2631     if (gameInfo.variant == VariantXiangqi && /* [HGM] In Xiangqi rank stays same */
2632          currentMoveString[0] != currentMoveString[2] ) {
2633         currentMoveString[1] = yytext[2+skip];
2634     } else 
2635     if (WhiteOnMove(yyboardindex)) {
2636         if (yytext[2+skip] == ONE) return (int) ImpossibleMove;
2637         currentMoveString[1] = yytext[2+skip] - 1;
2638         if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != WhitePawn) 
2639                 return ImpossibleMove;
2640     } else {
2641         currentMoveString[1] = currentMoveString[3] + 1;
2642         if (currentMoveString[3] == ONE+BOARD_HEIGHT-1) return (int) ImpossibleMove;
2643         if(boards[yyboardindex][currentMoveString[1]-ONE][currentMoveString[0]-AAA] != BlackPawn) 
2644                 return ImpossibleMove;
2645     }
2646     if (yyleng-skip > 3) {
2647         if (yytext[yyleng-1] == ')')
2648           c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2649         else
2650           c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2651         currentMoveString[5] = NULLCHAR;
2652         if(c != '=' && c != '^' && CharToPiece(c) == EmptySquare)
2653             return ImpossibleMove;
2654     } else {
2655         currentMoveString[4] = NULLCHAR;
2656     }
2657
2658     result = LegalityTest(boards[yyboardindex],
2659                           PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
2660                           currentMoveString[1] - ONE,
2661                           currentMoveString[0] - AAA,
2662                           currentMoveString[3] - ONE,
2663                           currentMoveString[2] - AAA,
2664                           currentMoveString[4]);
2665
2666     if (currentMoveString[4] == NULLCHAR) {
2667       if(result == WhitePromotion  || result == BlackPromotion) {
2668         currentMoveString[4] = PieceToChar(BlackQueen);
2669         // [HGM] shatranj: take care of variants without Queen
2670         if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantCourier || gameInfo.variant == VariantMakruk)
2671             currentMoveString[4] = PieceToChar(BlackFerz);
2672         if(gameInfo.variant == VariantGreat)
2673             currentMoveString[4] = PieceToChar(BlackMan);
2674         if(gameInfo.variant == VariantShogi)
2675             currentMoveString[4] = '^';
2676       } else if(result == WhiteNonPromotion  || result == BlackNonPromotion)
2677             currentMoveString[4] = '=';
2678       currentMoveString[5] = NULLCHAR;
2679     }
2680
2681     if (result != IllegalMove) return (int) result;
2682
2683     /* Special case: improperly written en passant capture */
2684     if (WhiteOnMove(yyboardindex)) {
2685         if (currentMoveString[3] == '5') {
2686             currentMoveString[1] = '5';
2687             currentMoveString[3] = '6';
2688         } else {
2689             return (int) IllegalMove;
2690         }
2691     } else {
2692         if (currentMoveString[3] == '4') {
2693             currentMoveString[1] = '4';
2694             currentMoveString[3] = '3';
2695         } else {
2696             return (int) IllegalMove;
2697         }
2698     }
2699
2700     result = LegalityTest(boards[yyboardindex],
2701                           PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.!
2702                           currentMoveString[1] - ONE,
2703                           currentMoveString[0] - AAA,
2704                           currentMoveString[3] - ONE,
2705                           currentMoveString[2] - AAA,
2706                           currentMoveString[4]);
2707
2708     if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant)
2709       return (int) result;
2710     else
2711       return (int) IllegalMove;
2712 }
2713         YY_BREAK
2714 case 7:
2715 YY_RULE_SETUP
2716 #line 588 "parser.l"
2717 {
2718     /*
2719      * piece move, possibly ambiguous
2720      */
2721     DisambiguateClosure cl;
2722     int skip = 0, skip2 = 0, promoted = 0;
2723
2724     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2725
2726     if(yytext[0] == '+') promoted = skip = skip2 = 1;
2727
2728     /* remove the [xX:-] */
2729     if ((yytext[1+skip] == 'x') || (yytext[1+skip] == 'X')
2730         || (yytext[1+skip] == ':') || (yytext[1+skip] == '-')) skip++;
2731
2732     if (WhiteOnMove(yyboardindex)) {
2733         cl.pieceIn = CharToPiece(ToUpper(yytext[skip2]));
2734     } else {
2735         cl.pieceIn = CharToPiece(ToLower(yytext[skip2]));
2736     }
2737     if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn);
2738
2739     cl.rfIn = -1;
2740     cl.ffIn = -1;
2741     cl.rtIn = yytext[2+skip] - ONE;
2742     cl.ftIn = yytext[1+skip] - AAA;
2743     cl.promoCharIn = NULLCHAR;
2744
2745     if(yyleng-skip > 3) /* [HGM] can have Shogi-style promotion */
2746         cl.promoCharIn = yytext[yyleng-1-(yytext[yyleng-1]==')')];
2747
2748     if (appData.debugMode) {
2749         fprintf(debugFP, "Parser Qa1: yyleng=%d,  %d(%d,%d)-(%d,%d) = %d (%c)\n",
2750         yyleng,
2751         cl.pieceIn,cl.ffIn,cl.rfIn,cl.ftIn,cl.rtIn,cl.promoCharIn,cl.promoCharIn?cl.promoCharIn:' ');
2752     }
2753
2754     /* [HGM] but do not allow values beyond board size */
2755     if(cl.rtIn >= BOARD_HEIGHT ||
2756        cl.rtIn <  0            ||
2757        cl.ftIn >= BOARD_RGHT   ||
2758        cl.ftIn <  BOARD_LEFT     )
2759       return ImpossibleMove;
2760
2761     Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
2762
2763     currentMoveString[0] = cl.ff + AAA;
2764     currentMoveString[1] = cl.rf + ONE;
2765     currentMoveString[2] = cl.ft + AAA;
2766     currentMoveString[3] = cl.rt + ONE;
2767     currentMoveString[4] = cl.promoChar;
2768     currentMoveString[5] = NULLCHAR;
2769
2770     return (int) cl.kind;
2771 }
2772         YY_BREAK
2773 case 8:
2774 YY_RULE_SETUP
2775 #line 644 "parser.l"
2776 {
2777     /*
2778      * piece move with rank or file disambiguator
2779      */
2780     DisambiguateClosure cl;
2781     int skip = 0, skip2 = 0; int promoted=0;
2782
2783     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2784
2785     if(yytext[0]=='+') promoted = skip = skip2 = 1;
2786
2787     /* remove the [xX:-] */
2788     if ((yytext[2+skip] == 'x') || (yytext[2+skip] == 'X')
2789         || (yytext[2+skip] == ':') || (yytext[2+skip] == '-')) skip++;
2790
2791     if (WhiteOnMove(yyboardindex)) {
2792         cl.pieceIn = CharToPiece(ToUpper(yytext[skip2]));
2793     } else {
2794         cl.pieceIn = CharToPiece(ToLower(yytext[skip2]));
2795     }
2796     if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn);
2797
2798     if (isalpha(yytext[1+skip2])) {
2799         cl.rfIn = -1;
2800         cl.ffIn = yytext[1+skip2] - AAA;
2801        
2802         if(cl.ffIn >= BOARD_RGHT ||
2803            cl.ffIn <  BOARD_LEFT   ) return 0;
2804     } else {
2805         cl.rfIn = yytext[1+skip2] - ONE;
2806         cl.ffIn = -1;
2807         if(cl.rfIn >= BOARD_HEIGHT ||
2808            cl.rfIn <  0) return 0;
2809     }
2810     cl.rtIn = yytext[3+skip] - ONE;
2811     cl.ftIn = yytext[2+skip] - AAA;
2812     cl.promoCharIn = NULLCHAR;
2813
2814     if(yyleng-skip > 4) /* [HGM] can have Shogi-style promotion */
2815         cl.promoCharIn = yytext[yyleng-1-(yytext[yyleng-1]==')')];
2816
2817     /* [HGM] do not allow values beyond board size */
2818     if(cl.rtIn >= BOARD_HEIGHT ||
2819        cl.rtIn <  0            ||
2820        cl.ftIn >= BOARD_RGHT   ||
2821        cl.ftIn <  BOARD_LEFT     )
2822       return ImpossibleMove;
2823
2824     Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
2825
2826     currentMoveString[0] = cl.ff + AAA;
2827     currentMoveString[1] = cl.rf + ONE;
2828     currentMoveString[2] = cl.ft + AAA;
2829     currentMoveString[3] = cl.rt + ONE;
2830     currentMoveString[4] = cl.promoChar;
2831     currentMoveString[5] = NULLCHAR;
2832
2833     return (int) cl.kind;
2834 }
2835         YY_BREAK
2836 case 9:
2837 YY_RULE_SETUP
2838 #line 704 "parser.l"
2839 {
2840     int rf, ff, rt, ft;
2841
2842     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2843
2844     /* [HGM] all squares referenced to board edges in stead of absolute */
2845     if (WhiteOnMove(yyboardindex)) {
2846         if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) {
2847             /* ICS wild castling */
2848             rf = 0;
2849             ff = (BOARD_WIDTH-1)>>1;
2850             rt = 0;
2851             ft = BOARD_RGHT-3;
2852         } else {
2853             rf = 0;
2854             ff = BOARD_WIDTH>>1;
2855             rt = 0;
2856             ft = BOARD_LEFT+2;
2857         }
2858     } else{ 
2859         if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) {
2860             /* ICS wild castling */
2861             rf = BOARD_HEIGHT-1;
2862             ff = (BOARD_WIDTH-1)>>1;
2863             rt = BOARD_HEIGHT-1;
2864             ft = BOARD_RGHT-3;
2865         } else {
2866             rf = BOARD_HEIGHT-1;
2867             ff = BOARD_WIDTH>>1;
2868             rt = BOARD_HEIGHT-1;
2869             ft = BOARD_LEFT+2;
2870         }
2871     }
2872     if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
2873
2874         if (WhiteOnMove(yyboardindex)) {
2875             ff = initialRights[2];
2876             ft = initialRights[1];
2877         } else {
2878             ff = initialRights[5];
2879             ft = initialRights[4];
2880         }
2881         if (appData.debugMode) 
2882         {
2883           fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);
2884         };
2885         if(ff < 0 || ft < 0) return 0;
2886     }
2887     sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE);
2888     if (appData.debugMode) {
2889         fprintf(debugFP, "long castling %d %d\n", ff, ft);
2890     }
2891     return (int) LegalityTest(boards[yyboardindex],
2892                               PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
2893                               rf, ff, rt, ft, NULLCHAR);
2894 }
2895         YY_BREAK
2896 case 10:
2897 YY_RULE_SETUP
2898 #line 761 "parser.l"
2899 {
2900     int rf, ff, rt, ft;
2901
2902     if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2903
2904     if (WhiteOnMove(yyboardindex)) {
2905         if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) {
2906             /* ICS wild castling */
2907             rf = 0;
2908             ff = (BOARD_WIDTH-1)>>1;
2909             rt = 0;
2910             ft = BOARD_LEFT+1;
2911         } else {
2912             rf = 0;
2913             ff = BOARD_WIDTH>>1;
2914             rt = 0;
2915             ft = BOARD_RGHT-2;
2916         }
2917     } else {
2918         if (boards[yyboardindex][BOARD_HEIGHT-1][(BOARD_WIDTH-1)>>1] == BlackKing) {
2919             /* ICS wild castling */
2920             rf = BOARD_HEIGHT-1;
2921             ff = (BOARD_WIDTH-1)>>1;
2922             rt = BOARD_HEIGHT-1;
2923             ft = BOARD_LEFT+1;
2924         } else {
2925             rf = BOARD_HEIGHT-1;
2926             ff = BOARD_WIDTH>>1;
2927             rt = BOARD_HEIGHT-1;
2928             ft = BOARD_RGHT-2;
2929         }
2930     }
2931     if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
2932         if (WhiteOnMove(yyboardindex)) {
2933             ff = initialRights[2];
2934             ft = initialRights[0];
2935         } else {
2936             ff = initialRights[5];
2937             ft = initialRights[3];
2938         }
2939     if (appData.debugMode) {
2940         fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft);
2941     }
2942         if(ff < 0 || ft < 0) return 0;
2943     }
2944     sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE);
2945     if (appData.debugMode) {
2946         fprintf(debugFP, "short castling %d %d\n", ff, ft);
2947     }
2948
2949     return (int) LegalityTest(boards[yyboardindex],
2950                               PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
2951                               rf, ff, rt, ft, NULLCHAR);
2952 }
2953         YY_BREAK
2954 case 11:
2955 YY_RULE_SETUP
2956 #line 816 "parser.l"
2957 {
2958     /* Bughouse piece drop. */
2959     currentMoveString[1] = '@';
2960     currentMoveString[2] = yytext[2];
2961     currentMoveString[3] = yytext[3];
2962     currentMoveString[4] = NULLCHAR;
2963
2964     if (appData.debugMode) {
2965         fprintf(debugFP, "Drop: %s\n", currentMoveString);
2966     }
2967     /* [HGM] do not allow values beyond board size */
2968     if(currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2969        currentMoveString[2] - AAA >= BOARD_WIDTH     )
2970       return ImpossibleMove;
2971
2972     if (WhiteOnMove(yyboardindex)) {
2973         currentMoveString[0] = ToUpper(yytext[0]);
2974     } else {
2975         currentMoveString[0] = ToLower(yytext[0]);
2976     }
2977     return LegalityTest(boards[yyboardindex], PosFlags(yyboardindex), DROP_RANK, // [HGM] does drops now too
2978                         CharToPiece(currentMoveString[0]), currentMoveString[3] - ONE, currentMoveString[2] - AAA, NULLCHAR);
2979 }
2980         YY_BREAK
2981 case 12:
2982 YY_RULE_SETUP
2983 #line 840 "parser.l"
2984 {
2985     if (WhiteOnMove(yyboardindex))
2986       return (int) BlackWins;
2987     else
2988       return (int) WhiteWins;
2989 }
2990         YY_BREAK
2991 case 13:
2992 YY_RULE_SETUP
2993 #line 847 "parser.l"
2994 {
2995     return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
2996 }
2997         YY_BREAK
2998 case 14:
2999 YY_RULE_SETUP
3000 #line 851 "parser.l"
3001 {
3002     return (int) GameUnfinished;
3003 }
3004         YY_BREAK
3005 case 15:
3006 YY_RULE_SETUP
3007 #line 855 "parser.l"
3008 {
3009     return (int) GameIsDrawn;
3010 }
3011         YY_BREAK
3012 case 16:
3013 YY_RULE_SETUP
3014 #line 859 "parser.l"
3015 {
3016     return (int) GameIsDrawn;
3017 }
3018         YY_BREAK
3019 case 17:
3020 YY_RULE_SETUP
3021 #line 863 "parser.l"
3022 {
3023     if (WhiteOnMove(yyboardindex))
3024       return (int) BlackWins;
3025     else
3026       return (int) WhiteWins;
3027 }
3028         YY_BREAK
3029 case 18:
3030 YY_RULE_SETUP
3031 #line 870 "parser.l"
3032 {
3033     if (WhiteOnMove(yyboardindex))
3034       return (int) BlackWins;
3035     else
3036       return (int) WhiteWins;
3037 }
3038         YY_BREAK
3039 case 19:
3040 YY_RULE_SETUP
3041 #line 877 "parser.l"
3042 {
3043     return (int) GameIsDrawn;
3044 }
3045         YY_BREAK
3046 case 20:
3047 YY_RULE_SETUP
3048 #line 881 "parser.l"
3049 {
3050     return (int) GameIsDrawn;
3051 }
3052         YY_BREAK
3053 case 21:
3054 YY_RULE_SETUP
3055 #line 885 "parser.l"
3056
3057     return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins);
3058 }
3059         YY_BREAK
3060 case 22:
3061 YY_RULE_SETUP
3062 #line 889 "parser.l"
3063
3064     return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
3065 }
3066         YY_BREAK
3067 case 23:
3068 YY_RULE_SETUP
3069 #line 893 "parser.l"
3070
3071     return (int) WhiteWins;
3072 }
3073         YY_BREAK
3074 case 24:
3075 YY_RULE_SETUP
3076 #line 897 "parser.l"
3077
3078     return (int) BlackWins;
3079 }
3080         YY_BREAK
3081 case 25:
3082 YY_RULE_SETUP
3083 #line 901 "parser.l"
3084 {
3085     return (int) GameIsDrawn;
3086 }
3087         YY_BREAK
3088 case 26:
3089 YY_RULE_SETUP
3090 #line 905 "parser.l"
3091 {
3092     return (int) GameUnfinished;
3093 }
3094         YY_BREAK
3095 case 27:
3096 /* rule 27 can match eol */
3097 YY_RULE_SETUP
3098 #line 909 "parser.l"
3099 {
3100     /* move numbers */
3101     if ((yyleng == 1) && (yytext[0] == '1'))
3102       return (int) MoveNumberOne;
3103 }
3104         YY_BREAK
3105 case 28:
3106 YY_RULE_SETUP
3107 #line 915 "parser.l"
3108 {
3109     /* elapsed time indication, e.g. (0:12) or {10:21.071} */ 
3110     return (int) ElapsedTime;
3111 }
3112         YY_BREAK
3113 case 29:
3114 /* rule 29 can match eol */
3115 YY_RULE_SETUP
3116 #line 920 "parser.l"
3117 {
3118     /* position diagram enclosed in [-- --] */
3119     return (int) PositionDiagram;
3120 }
3121         YY_BREAK
3122 case 30:
3123 /* rule 30 can match eol */
3124 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
3125 (yy_c_buf_p) = yy_cp -= 1;
3126 YY_DO_BEFORE_ACTION; /* set up yytext again */
3127 YY_RULE_SETUP
3128 #line 925 "parser.l"
3129 {
3130     /* position diagram enclosed in {-- --} */
3131     return (int) PositionDiagram;
3132 }
3133         YY_BREAK
3134 case 31:
3135 /* rule 31 can match eol */
3136 YY_RULE_SETUP
3137 #line 930 "parser.l"
3138 {
3139     return (int) PGNTag;
3140 }    
3141         YY_BREAK
3142 case 32:
3143 YY_RULE_SETUP
3144 #line 934 "parser.l"
3145 {
3146     return (int) GNUChessGame;
3147 }
3148         YY_BREAK
3149 case 33:
3150 /* rule 33 can match eol */
3151 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
3152 (yy_c_buf_p) = yy_cp -= 1;
3153 YY_DO_BEFORE_ACTION; /* set up yytext again */
3154 YY_RULE_SETUP
3155 #line 938 "parser.l"
3156 {
3157     return (int) XBoardGame;
3158 }
3159         YY_BREAK
3160 case 34:
3161 YY_RULE_SETUP
3162 #line 942 "parser.l"
3163 {                               /* numeric annotation glyph */
3164     return (int) NAG;
3165 }
3166         YY_BREAK
3167 case 35:
3168 /* rule 35 can match eol */
3169 YY_RULE_SETUP
3170 #line 946 "parser.l"
3171 {                               /* anything in {} */
3172     return (int) Comment; 
3173 }
3174         YY_BREAK
3175 case 36:
3176 *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */
3177 (yy_c_buf_p) = yy_cp -= 1;
3178 YY_DO_BEFORE_ACTION; /* set up yytext again */
3179 YY_RULE_SETUP
3180 #line 950 "parser.l"
3181 {                                          /* ; to end of line */
3182     return (int) Comment;
3183 }
3184         YY_BREAK
3185 case 37:
3186 /* rule 37 can match eol */
3187 YY_RULE_SETUP
3188 #line 954 "parser.l"
3189 {                               /* anything in [] */
3190     return (int) Comment; 
3191 }
3192         YY_BREAK
3193 case 38:
3194 /* rule 38 can match eol */
3195 YY_RULE_SETUP
3196 #line 958 "parser.l"
3197 { /* very nested () */
3198     return (int) Comment; 
3199 }
3200         YY_BREAK
3201 case 39:
3202 /* rule 39 can match eol */
3203 YY_RULE_SETUP
3204 #line 962 "parser.l"
3205 {                               /* >=2 chars in () */
3206     return (int) Comment; 
3207 }       
3208         YY_BREAK
3209 case 40:
3210 /* rule 40 can match eol */
3211 YY_RULE_SETUP
3212 #line 966 "parser.l"
3213 {
3214         /* Skip mail headers */
3215 }
3216         YY_BREAK
3217 case 41:
3218 YY_RULE_SETUP
3219 #line 970 "parser.l"
3220 {
3221         /* Skip random words */
3222 }
3223         YY_BREAK
3224 case 42:
3225 /* rule 42 can match eol */
3226 YY_RULE_SETUP
3227 #line 974 "parser.l"
3228 {
3229         /* Skip everything else */
3230 }
3231         YY_BREAK
3232 case 43:
3233 YY_RULE_SETUP
3234 #line 978 "parser.l"
3235 ECHO;
3236         YY_BREAK
3237 #line 3238 "parser.c"
3238                         case YY_STATE_EOF(INITIAL):
3239                                 yyterminate();
3240
3241         case YY_END_OF_BUFFER:
3242                 {
3243                 /* Amount of text matched not including the EOB char. */
3244                 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
3245
3246                 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3247                 *yy_cp = (yy_hold_char);
3248                 YY_RESTORE_YY_MORE_OFFSET
3249
3250                 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
3251                         {
3252                         /* We're scanning a new file or input source.  It's
3253                          * possible that this happened because the user
3254                          * just pointed yyin at a new source and called
3255                          * yylex().  If so, then we have to assure
3256                          * consistency between YY_CURRENT_BUFFER and our
3257                          * globals.  Here is the right place to do so, because
3258                          * this is the first action (other than possibly a
3259                          * back-up) that will match for the new input source.
3260                          */
3261                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3262                         YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
3263                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
3264                         }
3265
3266                 /* Note that here we test for yy_c_buf_p "<=" to the position
3267                  * of the first EOB in the buffer, since yy_c_buf_p will
3268                  * already have been incremented past the NUL character
3269                  * (since all states make transitions on EOB to the
3270                  * end-of-buffer state).  Contrast this with the test
3271                  * in input().
3272                  */
3273                 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
3274                         { /* This was really a NUL. */
3275                         yy_state_type yy_next_state;
3276
3277                         (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
3278
3279                         yy_current_state = yy_get_previous_state(  );
3280
3281                         /* Okay, we're now positioned to make the NUL
3282                          * transition.  We couldn't have
3283                          * yy_get_previous_state() go ahead and do it
3284                          * for us because it doesn't know how to deal
3285                          * with the possibility of jamming (and we don't
3286                          * want to build jamming into it because then it
3287                          * will run more slowly).
3288                          */
3289
3290                         yy_next_state = yy_try_NUL_trans( yy_current_state );
3291
3292                         yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3293
3294                         if ( yy_next_state )
3295                                 {
3296                                 /* Consume the NUL. */
3297                                 yy_cp = ++(yy_c_buf_p);
3298                                 yy_current_state = yy_next_state;
3299                                 goto yy_match;
3300                                 }
3301
3302                         else
3303                                 {
3304                                 yy_cp = (yy_c_buf_p);
3305                                 goto yy_find_action;
3306                                 }
3307                         }
3308
3309                 else switch ( yy_get_next_buffer(  ) )
3310                         {
3311                         case EOB_ACT_END_OF_FILE:
3312                                 {
3313                                 (yy_did_buffer_switch_on_eof) = 0;
3314
3315                                 if ( yywrap( ) )
3316                                         {
3317                                         /* Note: because we've taken care in
3318                                          * yy_get_next_buffer() to have set up
3319                                          * yytext, we can now set up
3320                                          * yy_c_buf_p so that if some total
3321                                          * hoser (like flex itself) wants to
3322                                          * call the scanner after we return the
3323                                          * YY_NULL, it'll still work - another
3324                                          * YY_NULL will get returned.
3325                                          */
3326                                         (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
3327
3328                                         yy_act = YY_STATE_EOF(YY_START);
3329                                         goto do_action;
3330                                         }
3331
3332                                 else
3333                                         {
3334                                         if ( ! (yy_did_buffer_switch_on_eof) )
3335                                                 YY_NEW_FILE;
3336                                         }
3337                                 break;
3338                                 }
3339
3340                         case EOB_ACT_CONTINUE_SCAN:
3341                                 (yy_c_buf_p) =
3342                                         (yytext_ptr) + yy_amount_of_matched_text;
3343
3344                                 yy_current_state = yy_get_previous_state(  );
3345
3346                                 yy_cp = (yy_c_buf_p);
3347                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3348                                 goto yy_match;
3349
3350                         case EOB_ACT_LAST_MATCH:
3351                                 (yy_c_buf_p) =
3352                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
3353
3354                                 yy_current_state = yy_get_previous_state(  );
3355
3356                                 yy_cp = (yy_c_buf_p);
3357                                 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
3358                                 goto yy_find_action;
3359                         }
3360                 break;
3361                 }
3362
3363         default:
3364                 YY_FATAL_ERROR(
3365                         "fatal flex scanner internal error--no action found" );
3366         } /* end of action switch */
3367                 } /* end of scanning one token */
3368 } /* end of yylex */
3369
3370 /* yy_get_next_buffer - try to read in a new buffer
3371  *
3372  * Returns a code representing an action:
3373  *      EOB_ACT_LAST_MATCH -
3374  *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3375  *      EOB_ACT_END_OF_FILE - end of file
3376  */
3377 static int yy_get_next_buffer (void)
3378 {
3379         register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
3380         register char *source = (yytext_ptr);
3381         register int number_to_move, i;
3382         int ret_val;
3383
3384         if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
3385                 YY_FATAL_ERROR(
3386                 "fatal flex scanner internal error--end of buffer missed" );
3387
3388         if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
3389                 { /* Don't try to fill the buffer, so this is an EOF. */
3390                 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
3391                         {
3392                         /* We matched a single character, the EOB, so
3393                          * treat this as a final EOF.
3394                          */
3395                         return EOB_ACT_END_OF_FILE;
3396                         }
3397
3398                 else
3399                         {
3400                         /* We matched some text prior to the EOB, first
3401                          * process it.
3402                          */
3403                         return EOB_ACT_LAST_MATCH;
3404                         }
3405                 }
3406
3407         /* Try to read more data. */
3408
3409         /* First move last chars to start of buffer. */
3410         number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
3411
3412         for ( i = 0; i < number_to_move; ++i )
3413                 *(dest++) = *(source++);
3414
3415         if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
3416                 /* don't do the read, it's not guaranteed to return an EOF,
3417                  * just force an EOF
3418                  */
3419                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
3420
3421         else
3422                 {
3423                         int num_to_read =
3424                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
3425
3426                 while ( num_to_read <= 0 )
3427                         { /* Not enough room in the buffer - grow it. */
3428
3429                         YY_FATAL_ERROR(
3430 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3431
3432                         }
3433
3434                 if ( num_to_read > YY_READ_BUF_SIZE )
3435                         num_to_read = YY_READ_BUF_SIZE;
3436
3437                 /* Read in more data. */
3438                 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
3439                         (yy_n_chars), (size_t) num_to_read );
3440
3441                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3442                 }
3443
3444         if ( (yy_n_chars) == 0 )
3445                 {
3446                 if ( number_to_move == YY_MORE_ADJ )
3447                         {
3448                         ret_val = EOB_ACT_END_OF_FILE;
3449                         yyrestart(yyin  );
3450                         }
3451
3452                 else
3453                         {
3454                         ret_val = EOB_ACT_LAST_MATCH;
3455                         YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
3456                                 YY_BUFFER_EOF_PENDING;
3457                         }
3458                 }
3459
3460         else
3461                 ret_val = EOB_ACT_CONTINUE_SCAN;
3462
3463         if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
3464                 /* Extend the array by 50%, plus the number we really need. */
3465                 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
3466                 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
3467                 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3468                         YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
3469         }
3470
3471         (yy_n_chars) += number_to_move;
3472         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
3473         YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
3474
3475         (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
3476
3477         return ret_val;
3478 }
3479
3480 /* yy_get_previous_state - get the state just before the EOB char was reached */
3481
3482     static yy_state_type yy_get_previous_state (void)
3483 {
3484         register yy_state_type yy_current_state;
3485         register char *yy_cp;
3486     
3487         yy_current_state = (yy_start);
3488         yy_current_state += YY_AT_BOL();
3489
3490         (yy_state_ptr) = (yy_state_buf);
3491         *(yy_state_ptr)++ = yy_current_state;
3492
3493         for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
3494                 {
3495                 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
3496                 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3497                         {
3498                         yy_current_state = (int) yy_def[yy_current_state];
3499                         if ( yy_current_state >= 719 )
3500                                 yy_c = yy_meta[(unsigned int) yy_c];
3501                         }
3502                 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3503                 *(yy_state_ptr)++ = yy_current_state;
3504                 }
3505
3506         return yy_current_state;
3507 }
3508
3509 /* yy_try_NUL_trans - try to make a transition on the NUL character
3510  *
3511  * synopsis
3512  *      next_state = yy_try_NUL_trans( current_state );
3513  */
3514     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
3515 {
3516         register int yy_is_jam;
3517     
3518         register YY_CHAR yy_c = 1;
3519         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3520                 {
3521                 yy_current_state = (int) yy_def[yy_current_state];
3522                 if ( yy_current_state >= 719 )
3523                         yy_c = yy_meta[(unsigned int) yy_c];
3524                 }
3525         yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3526         yy_is_jam = (yy_current_state == 718);
3527         if ( ! yy_is_jam )
3528                 *(yy_state_ptr)++ = yy_current_state;
3529
3530         return yy_is_jam ? 0 : yy_current_state;
3531 }
3532
3533     static void yyunput (int c, register char * yy_bp )
3534 {
3535         register char *yy_cp;
3536     
3537     yy_cp = (yy_c_buf_p);
3538
3539         /* undo effects of setting up yytext */
3540         *yy_cp = (yy_hold_char);
3541
3542         if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3543                 { /* need to shift things up to make room */
3544                 /* +2 for EOB chars. */
3545                 register int number_to_move = (yy_n_chars) + 2;
3546                 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
3547                                         YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
3548                 register char *source =
3549                                 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
3550
3551                 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
3552                         *--dest = *--source;
3553
3554                 yy_cp += (int) (dest - source);
3555                 yy_bp += (int) (dest - source);
3556                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
3557                         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
3558
3559                 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
3560                         YY_FATAL_ERROR( "flex scanner push-back overflow" );
3561                 }
3562
3563         *--yy_cp = (char) c;
3564
3565         (yytext_ptr) = yy_bp;
3566         (yy_hold_char) = *yy_cp;
3567         (yy_c_buf_p) = yy_cp;
3568 }
3569
3570 #ifndef YY_NO_INPUT
3571 #ifdef __cplusplus
3572     static int yyinput (void)
3573 #else
3574     static int input  (void)
3575 #endif
3576
3577 {
3578         int c;
3579     
3580         *(yy_c_buf_p) = (yy_hold_char);
3581
3582         if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
3583                 {
3584                 /* yy_c_buf_p now points to the character we want to return.
3585                  * If this occurs *before* the EOB characters, then it's a
3586                  * valid NUL; if not, then we've hit the end of the buffer.
3587                  */
3588                 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
3589                         /* This was really a NUL. */
3590                         *(yy_c_buf_p) = '\0';
3591
3592                 else
3593                         { /* need more input */
3594                         int offset = (yy_c_buf_p) - (yytext_ptr);
3595                         ++(yy_c_buf_p);
3596
3597                         switch ( yy_get_next_buffer(  ) )
3598                                 {
3599                                 case EOB_ACT_LAST_MATCH:
3600                                         /* This happens because yy_g_n_b()
3601                                          * sees that we've accumulated a
3602                                          * token and flags that we need to
3603                                          * try matching the token before
3604                                          * proceeding.  But for input(),
3605                                          * there's no matching to consider.
3606                                          * So convert the EOB_ACT_LAST_MATCH
3607                                          * to EOB_ACT_END_OF_FILE.
3608                                          */
3609
3610                                         /* Reset buffer status. */
3611                                         yyrestart(yyin );
3612
3613                                         /*FALLTHROUGH*/
3614
3615                                 case EOB_ACT_END_OF_FILE:
3616                                         {
3617                                         if ( yywrap( ) )
3618                                                 return EOF;
3619
3620                                         if ( ! (yy_did_buffer_switch_on_eof) )
3621                                                 YY_NEW_FILE;
3622 #ifdef __cplusplus
3623                                         return yyinput();
3624 #else
3625                                         return input();
3626 #endif
3627                                         }
3628
3629                                 case EOB_ACT_CONTINUE_SCAN:
3630                                         (yy_c_buf_p) = (yytext_ptr) + offset;
3631                                         break;
3632                                 }
3633                         }
3634                 }
3635
3636         c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
3637         *(yy_c_buf_p) = '\0';   /* preserve yytext */
3638         (yy_hold_char) = *++(yy_c_buf_p);
3639
3640         YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
3641
3642         return c;
3643 }
3644 #endif  /* ifndef YY_NO_INPUT */
3645
3646 /** Immediately switch to a different input stream.
3647  * @param input_file A readable stream.
3648  * 
3649  * @note This function does not reset the start condition to @c INITIAL .
3650  */
3651     void yyrestart  (FILE * input_file )
3652 {
3653     
3654         if ( ! YY_CURRENT_BUFFER ){
3655         yyensure_buffer_stack ();
3656                 YY_CURRENT_BUFFER_LVALUE =
3657             yy_create_buffer(yyin,YY_BUF_SIZE );
3658         }
3659
3660         yy_init_buffer(YY_CURRENT_BUFFER,input_file );
3661         yy_load_buffer_state( );
3662 }
3663
3664 /** Switch to a different input buffer.
3665  * @param new_buffer The new input buffer.
3666  * 
3667  */
3668     void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
3669 {
3670     
3671         /* TODO. We should be able to replace this entire function body
3672          * with
3673          *              yypop_buffer_state();
3674          *              yypush_buffer_state(new_buffer);
3675      */
3676         yyensure_buffer_stack ();
3677         if ( YY_CURRENT_BUFFER == new_buffer )
3678                 return;
3679
3680         if ( YY_CURRENT_BUFFER )
3681                 {
3682                 /* Flush out information for old buffer. */
3683                 *(yy_c_buf_p) = (yy_hold_char);
3684                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3685                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3686                 }
3687
3688         YY_CURRENT_BUFFER_LVALUE = new_buffer;
3689         yy_load_buffer_state( );
3690
3691         /* We don't actually know whether we did this switch during
3692          * EOF (yywrap()) processing, but the only time this flag
3693          * is looked at is after yywrap() is called, so it's safe
3694          * to go ahead and always set it.
3695          */
3696         (yy_did_buffer_switch_on_eof) = 1;
3697 }
3698
3699 static void yy_load_buffer_state  (void)
3700 {
3701         (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
3702         (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
3703         yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
3704         (yy_hold_char) = *(yy_c_buf_p);
3705 }
3706
3707 /** Allocate and initialize an input buffer state.
3708  * @param file A readable stream.
3709  * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3710  * 
3711  * @return the allocated buffer state.
3712  */
3713     YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
3714 {
3715         YY_BUFFER_STATE b;
3716     
3717         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
3718         if ( ! b )
3719                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3720
3721         b->yy_buf_size = size;
3722
3723         /* yy_ch_buf has to be 2 characters longer than the size given because
3724          * we need to put in 2 end-of-buffer characters.
3725          */
3726         b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
3727         if ( ! b->yy_ch_buf )
3728                 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3729
3730         b->yy_is_our_buffer = 1;
3731
3732         yy_init_buffer(b,file );
3733
3734         return b;
3735 }
3736
3737 /** Destroy the buffer.
3738  * @param b a buffer created with yy_create_buffer()
3739  * 
3740  */
3741     void yy_delete_buffer (YY_BUFFER_STATE  b )
3742 {
3743     
3744         if ( ! b )
3745                 return;
3746
3747         if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
3748                 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
3749
3750         if ( b->yy_is_our_buffer )
3751                 yyfree((void *) b->yy_ch_buf  );
3752
3753         yyfree((void *) b  );
3754 }
3755
3756 #ifndef __cplusplus
3757 extern int isatty (int );
3758 #endif /* __cplusplus */
3759     
3760 /* Initializes or reinitializes a buffer.
3761  * This function is sometimes called more than once on the same buffer,
3762  * such as during a yyrestart() or at EOF.
3763  */
3764     static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
3765
3766 {
3767         int oerrno = errno;
3768     
3769         yy_flush_buffer(b );
3770
3771         b->yy_input_file = file;
3772         b->yy_fill_buffer = 1;
3773
3774     /* If b is the current buffer, then yy_init_buffer was _probably_
3775      * called from yyrestart() or through yy_get_next_buffer.
3776      * In that case, we don't want to reset the lineno or column.
3777      */
3778     if (b != YY_CURRENT_BUFFER){
3779         b->yy_bs_lineno = 1;
3780         b->yy_bs_column = 0;
3781     }
3782
3783         b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3784     
3785         errno = oerrno;
3786 }
3787
3788 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3789  * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3790  * 
3791  */
3792     void yy_flush_buffer (YY_BUFFER_STATE  b )
3793 {
3794         if ( ! b )
3795                 return;
3796
3797         b->yy_n_chars = 0;
3798
3799         /* We always need two end-of-buffer characters.  The first causes
3800          * a transition to the end-of-buffer state.  The second causes
3801          * a jam in that state.
3802          */
3803         b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3804         b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3805
3806         b->yy_buf_pos = &b->yy_ch_buf[0];
3807
3808         b->yy_at_bol = 1;
3809         b->yy_buffer_status = YY_BUFFER_NEW;
3810
3811         if ( b == YY_CURRENT_BUFFER )
3812                 yy_load_buffer_state( );
3813 }
3814
3815 /** Pushes the new state onto the stack. The new state becomes
3816  *  the current state. This function will allocate the stack
3817  *  if necessary.
3818  *  @param new_buffer The new state.
3819  *  
3820  */
3821 void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
3822 {
3823         if (new_buffer == NULL)
3824                 return;
3825
3826         yyensure_buffer_stack();
3827
3828         /* This block is copied from yy_switch_to_buffer. */
3829         if ( YY_CURRENT_BUFFER )
3830                 {
3831                 /* Flush out information for old buffer. */
3832                 *(yy_c_buf_p) = (yy_hold_char);
3833                 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
3834                 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
3835                 }
3836
3837         /* Only push if top exists. Otherwise, replace top. */
3838         if (YY_CURRENT_BUFFER)
3839                 (yy_buffer_stack_top)++;
3840         YY_CURRENT_BUFFER_LVALUE = new_buffer;
3841
3842         /* copied from yy_switch_to_buffer. */
3843         yy_load_buffer_state( );
3844         (yy_did_buffer_switch_on_eof) = 1;
3845 }
3846
3847 /** Removes and deletes the top of the stack, if present.
3848  *  The next element becomes the new top.
3849  *  
3850  */
3851 void yypop_buffer_state (void)
3852 {
3853         if (!YY_CURRENT_BUFFER)
3854                 return;
3855
3856         yy_delete_buffer(YY_CURRENT_BUFFER );
3857         YY_CURRENT_BUFFER_LVALUE = NULL;
3858         if ((yy_buffer_stack_top) > 0)
3859                 --(yy_buffer_stack_top);
3860
3861         if (YY_CURRENT_BUFFER) {
3862                 yy_load_buffer_state( );
3863                 (yy_did_buffer_switch_on_eof) = 1;
3864         }
3865 }
3866
3867 /* Allocates the stack if it does not exist.
3868  *  Guarantees space for at least one push.
3869  */
3870 static void yyensure_buffer_stack (void)
3871 {
3872         int num_to_alloc;
3873     
3874         if (!(yy_buffer_stack)) {
3875
3876                 /* First allocation is just for 2 elements, since we don't know if this
3877                  * scanner will even need a stack. We use 2 instead of 1 to avoid an
3878                  * immediate realloc on the next call.
3879          */
3880                 num_to_alloc = 1;
3881                 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
3882                                                                 (num_to_alloc * sizeof(struct yy_buffer_state*)
3883                                                                 );
3884                 if ( ! (yy_buffer_stack) )
3885                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3886                                                                   
3887                 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3888                                 
3889                 (yy_buffer_stack_max) = num_to_alloc;
3890                 (yy_buffer_stack_top) = 0;
3891                 return;
3892         }
3893
3894         if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
3895
3896                 /* Increase the buffer to prepare for a possible push. */
3897                 int grow_size = 8 /* arbitrary grow size */;
3898
3899                 num_to_alloc = (yy_buffer_stack_max) + grow_size;
3900                 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
3901                                                                 ((yy_buffer_stack),
3902                                                                 num_to_alloc * sizeof(struct yy_buffer_state*)
3903                                                                 );
3904                 if ( ! (yy_buffer_stack) )
3905                         YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
3906
3907                 /* zero only the new slots.*/
3908                 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
3909                 (yy_buffer_stack_max) = num_to_alloc;
3910         }
3911 }
3912
3913 /** Setup the input buffer state to scan directly from a user-specified character buffer.
3914  * @param base the character buffer
3915  * @param size the size in bytes of the character buffer
3916  * 
3917  * @return the newly allocated buffer state object. 
3918  */
3919 YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
3920 {
3921         YY_BUFFER_STATE b;
3922     
3923         if ( size < 2 ||
3924              base[size-2] != YY_END_OF_BUFFER_CHAR ||
3925              base[size-1] != YY_END_OF_BUFFER_CHAR )
3926                 /* They forgot to leave room for the EOB's. */
3927                 return 0;
3928
3929         b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
3930         if ( ! b )
3931                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
3932
3933         b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
3934         b->yy_buf_pos = b->yy_ch_buf = base;
3935         b->yy_is_our_buffer = 0;
3936         b->yy_input_file = 0;
3937         b->yy_n_chars = b->yy_buf_size;
3938         b->yy_is_interactive = 0;
3939         b->yy_at_bol = 1;
3940         b->yy_fill_buffer = 0;
3941         b->yy_buffer_status = YY_BUFFER_NEW;
3942
3943         yy_switch_to_buffer(b  );
3944
3945         return b;
3946 }
3947
3948 /** Setup the input buffer state to scan a string. The next call to yylex() will
3949  * scan from a @e copy of @a str.
3950  * @param yystr a NUL-terminated string to scan
3951  * 
3952  * @return the newly allocated buffer state object.
3953  * @note If you want to scan bytes that may contain NUL values, then use
3954  *       yy_scan_bytes() instead.
3955  */
3956 YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
3957 {
3958     
3959         return yy_scan_bytes(yystr,strlen(yystr) );
3960 }
3961
3962 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
3963  * scan from a @e copy of @a bytes.
3964  * @param bytes the byte buffer to scan
3965  * @param len the number of bytes in the buffer pointed to by @a bytes.
3966  * 
3967  * @return the newly allocated buffer state object.
3968  */
3969 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
3970 {
3971         YY_BUFFER_STATE b;
3972         char *buf;
3973         yy_size_t n;
3974         int i;
3975     
3976         /* Get memory for full buffer, including space for trailing EOB's. */
3977         n = _yybytes_len + 2;
3978         buf = (char *) yyalloc(n  );
3979         if ( ! buf )
3980                 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3981
3982         for ( i = 0; i < _yybytes_len; ++i )
3983                 buf[i] = yybytes[i];
3984
3985         buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
3986
3987         b = yy_scan_buffer(buf,n );
3988         if ( ! b )
3989                 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3990
3991         /* It's okay to grow etc. this buffer, and we should throw it
3992          * away when we're done.
3993          */
3994         b->yy_is_our_buffer = 1;
3995
3996         return b;
3997 }
3998
3999 #ifndef YY_EXIT_FAILURE
4000 #define YY_EXIT_FAILURE 2
4001 #endif
4002
4003 static void yy_fatal_error (yyconst char* msg )
4004 {
4005         (void) fprintf( stderr, "%s\n", msg );
4006         exit( YY_EXIT_FAILURE );
4007 }
4008
4009 /* Redefine yyless() so it works in section 3 code. */
4010
4011 #undef yyless
4012 #define yyless(n) \
4013         do \
4014                 { \
4015                 /* Undo effects of setting up yytext. */ \
4016         int yyless_macro_arg = (n); \
4017         YY_LESS_LINENO(yyless_macro_arg);\
4018                 yytext[yyleng] = (yy_hold_char); \
4019                 (yy_c_buf_p) = yytext + yyless_macro_arg; \
4020                 (yy_hold_char) = *(yy_c_buf_p); \
4021                 *(yy_c_buf_p) = '\0'; \
4022                 yyleng = yyless_macro_arg; \
4023                 } \
4024         while ( 0 )
4025
4026 /* Accessor  methods (get/set functions) to struct members. */
4027
4028 /** Get the current line number.
4029  * 
4030  */
4031 int yyget_lineno  (void)
4032 {
4033         
4034     return yylineno;
4035 }
4036
4037 /** Get the input stream.
4038  * 
4039  */
4040 FILE *yyget_in  (void)
4041 {
4042         return yyin;
4043 }
4044
4045 /** Get the output stream.
4046  * 
4047  */
4048 FILE *yyget_out  (void)
4049 {
4050         return yyout;
4051 }
4052
4053 /** Get the length of the current token.
4054  * 
4055  */
4056 int yyget_leng  (void)
4057 {
4058         return yyleng;
4059 }
4060
4061 /** Get the current token.
4062  * 
4063  */
4064
4065 char *yyget_text  (void)
4066 {
4067         return yytext;
4068 }
4069
4070 /** Set the current line number.
4071  * @param line_number
4072  * 
4073  */
4074 void yyset_lineno (int  line_number )
4075 {
4076     
4077     yylineno = line_number;
4078 }
4079
4080 /** Set the input stream. This does not discard the current
4081  * input buffer.
4082  * @param in_str A readable stream.
4083  * 
4084  * @see yy_switch_to_buffer
4085  */
4086 void yyset_in (FILE *  in_str )
4087 {
4088         yyin = in_str ;
4089 }
4090
4091 void yyset_out (FILE *  out_str )
4092 {
4093         yyout = out_str ;
4094 }
4095
4096 int yyget_debug  (void)
4097 {
4098         return yy_flex_debug;
4099 }
4100
4101 void yyset_debug (int  bdebug )
4102 {
4103         yy_flex_debug = bdebug ;
4104 }
4105
4106 static int yy_init_globals (void)
4107 {
4108         /* Initialization is the same as for the non-reentrant scanner.
4109      * This function is called from yylex_destroy(), so don't allocate here.
4110      */
4111
4112     (yy_buffer_stack) = 0;
4113     (yy_buffer_stack_top) = 0;
4114     (yy_buffer_stack_max) = 0;
4115     (yy_c_buf_p) = (char *) 0;
4116     (yy_init) = 0;
4117     (yy_start) = 0;
4118
4119     (yy_state_buf) = 0;
4120     (yy_state_ptr) = 0;
4121     (yy_full_match) = 0;
4122     (yy_lp) = 0;
4123
4124 /* Defined in main.c */
4125 #ifdef YY_STDINIT
4126     yyin = stdin;
4127     yyout = stdout;
4128 #else
4129     yyin = (FILE *) 0;
4130     yyout = (FILE *) 0;
4131 #endif
4132
4133     /* For future reference: Set errno on error, since we are called by
4134      * yylex_init()
4135      */
4136     return 0;
4137 }
4138
4139 /* yylex_destroy is for both reentrant and non-reentrant scanners. */
4140 int yylex_destroy  (void)
4141 {
4142     
4143     /* Pop the buffer stack, destroying each element. */
4144         while(YY_CURRENT_BUFFER){
4145                 yy_delete_buffer(YY_CURRENT_BUFFER  );
4146                 YY_CURRENT_BUFFER_LVALUE = NULL;
4147                 yypop_buffer_state();
4148         }
4149
4150         /* Destroy the stack itself. */
4151         yyfree((yy_buffer_stack) );
4152         (yy_buffer_stack) = NULL;
4153
4154     yyfree ( (yy_state_buf) );
4155     (yy_state_buf)  = NULL;
4156
4157     /* Reset the globals. This is important in a non-reentrant scanner so the next time
4158      * yylex() is called, initialization will occur. */
4159     yy_init_globals( );
4160
4161     return 0;
4162 }
4163
4164 /*
4165  * Internal utility routines.
4166  */
4167
4168 #ifndef yytext_ptr
4169 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
4170 {
4171         register int i;
4172         for ( i = 0; i < n; ++i )
4173                 s1[i] = s2[i];
4174 }
4175 #endif
4176
4177 #ifdef YY_NEED_STRLEN
4178 static int yy_flex_strlen (yyconst char * s )
4179 {
4180         register int n;
4181         for ( n = 0; s[n]; ++n )
4182                 ;
4183
4184         return n;
4185 }
4186 #endif
4187
4188 void *yyalloc (yy_size_t  size )
4189 {
4190         return (void *) malloc( size );
4191 }
4192
4193 void *yyrealloc  (void * ptr, yy_size_t  size )
4194 {
4195         /* The cast to (char *) in the following accommodates both
4196          * implementations that use char* generic pointers, and those
4197          * that use void* generic pointers.  It works with the latter
4198          * because both ANSI C and C++ allow castless assignment from
4199          * any pointer type to void*, and deal with argument conversions
4200          * as though doing an assignment.
4201          */
4202         return (void *) realloc( (char *) ptr, size );
4203 }
4204
4205 void yyfree (void * ptr )
4206 {
4207         free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
4208 }
4209
4210 #define YYTABLES_NAME "yytables"
4211
4212 #line 978 "parser.l"
4213
4214
4215
4216
4217 static char *StringToLex;
4218
4219 #ifndef FLEX_SCANNER
4220 static FILE *lexFP;
4221
4222 static int input()
4223 {
4224     int ret;
4225     
4226     if (StringToLex != NULL) {
4227         ret = *StringToLex;
4228         if (ret == NULLCHAR)
4229           ret = EOF;
4230         else
4231           StringToLex++;
4232     } else if (unputCount > 0) {
4233         ret = unputBuffer[--unputCount];
4234     } else {
4235         ret = fgetc(lexFP);
4236     }    
4237
4238     if (ret == EOF) 
4239       return 0;
4240     else
4241       return ret;
4242 }
4243
4244 /*
4245  * Return offset of next pattern within current file
4246  */
4247 int yyoffset()
4248 {
4249     int offset = ftell(lexFP) - unputCount;
4250
4251     if (offset < 0) {
4252         offset = 0;
4253     }
4254     return(offset);
4255 }
4256  
4257 static void output(ch)
4258      int ch;
4259 {
4260     if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unmatched character '%c' (0%o)\n",
4261             ch, ch);
4262 }
4263
4264 static void unput(ch)
4265      int ch;
4266 {
4267     if (ch == 0) return;
4268     if (StringToLex != NULL) {
4269         StringToLex--;
4270     } else {
4271         if (unputCount >= UNPUT_BUF_SIZE)
4272           if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",
4273                   ch, ch);
4274         unputBuffer[unputCount++] = ch;
4275     }
4276 }
4277
4278 /* Get ready to lex from a new file.  Kludge below sticks
4279    an artificial newline at the front of the file, which the
4280    above grammar ignores, but which makes ^ at start of pattern
4281    match at the real start of the file.
4282 */
4283 void yynewfile(f)
4284      FILE *f;
4285 {
4286     lexFP = f;
4287     StringToLex = NULL;
4288     unputCount = 0;
4289     unput('\n'); /* kludge */
4290 }
4291
4292 /* Get ready to lex from a string.  ^ at start of pattern WON'T
4293    match at the start of the string!
4294 */
4295 void yynewstr(s)
4296      char *s;
4297 {
4298     lexFP = NULL;
4299     StringToLex = s;
4300     unputCount = 0;
4301 }
4302 #endif /*!FLEX_SCANNER*/
4303
4304 #ifdef FLEX_SCANNER
4305 void my_yy_input(buf, result, max_size)
4306      char *buf;
4307      int *result;
4308      int max_size;
4309 {
4310     int count;
4311
4312     if (StringToLex != NULL) {
4313         count = 0;
4314         while (*StringToLex != NULLCHAR) {
4315             *buf++ = *StringToLex++;
4316             count++;
4317         }
4318         *result = count;
4319         return;
4320     } else {
4321         count = fread(buf, 1, max_size, yyin);
4322         if (count == 0) {
4323             *result = YY_NULL;
4324         } else {
4325             *result = count;
4326         }
4327         return;
4328     }    
4329 }
4330
4331 static YY_BUFFER_STATE my_file_buffer = NULL;
4332
4333 /*
4334     Return offset of next pattern in the current file.
4335 */
4336 int yyoffset()
4337 {
4338     int pos = yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf;
4339
4340     return(ftell(YY_CURRENT_BUFFER->yy_input_file) -
4341          yy_n_chars + pos);
4342 }
4343
4344
4345 void yynewstr(s)
4346      char *s;
4347 {
4348     if (my_file_buffer != NULL)
4349       yy_delete_buffer(my_file_buffer);
4350     StringToLex = s;
4351     my_file_buffer = yy_create_buffer(stdin,YY_BUF_SIZE);
4352     yy_switch_to_buffer(my_file_buffer);
4353 }
4354
4355 void yynewfile(f)
4356      FILE *f;
4357 {
4358     if (my_file_buffer != NULL)
4359       yy_delete_buffer(my_file_buffer);
4360     StringToLex = NULL;
4361     my_file_buffer = yy_create_buffer(f,YY_BUF_SIZE);
4362     yy_switch_to_buffer(my_file_buffer);
4363 }
4364 #endif /*FLEX_SCANNER*/
4365
4366 int yywrap()
4367 {
4368     return TRUE;
4369 }
4370
4371 /* Parse a move from the given string s */
4372 /* ^ at start of pattern WON'T work here unless using flex */
4373 ChessMove yylexstr(boardIndex, s, text, len)
4374      int boardIndex, len;
4375      char *s, *text;
4376 {
4377     ChessMove ret;
4378     char *oldStringToLex;
4379 #ifdef FLEX_SCANNER
4380     YY_BUFFER_STATE buffer, oldBuffer;
4381 #endif
4382     
4383     yyboardindex = boardIndex;
4384     oldStringToLex = StringToLex;
4385     StringToLex = s;
4386 #ifdef FLEX_SCANNER
4387     buffer = yy_create_buffer(stdin,YY_BUF_SIZE);
4388     oldBuffer = YY_CURRENT_BUFFER;
4389     yy_switch_to_buffer(buffer);
4390 #endif /*FLEX_SCANNER*/
4391
4392     ret = (ChessMove) yylex();
4393      strncpy(text, yy_text, len-1); // [HGM] vari: yy_text is not available to caller after buffer switch ?!?
4394      text[len-1] = NULLCHAR;
4395
4396 #ifdef FLEX_SCANNER
4397     if (oldBuffer != NULL) 
4398       yy_switch_to_buffer(oldBuffer);
4399     yy_delete_buffer(buffer);
4400 #endif /*FLEX_SCANNER*/
4401     StringToLex = oldStringToLex;
4402
4403     return ret;
4404 }
4405