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