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