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