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