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