1 /* A lexical scanner generated by flex */
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 $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
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
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
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.
79 #define BEGIN yy_start = 1 + 2 *
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
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state *YY_BUFFER_STATE;
102 extern FILE *yyin, *yyout;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
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:
112 * if ( condition_holds )
115 * do_something_else();
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.
122 /* Return all but the first 'n' matched characters back to the input stream. */
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 */ \
135 #define unput(c) yyunput( c, yytext_ptr )
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).
141 typedef unsigned int yy_size_t;
144 struct yy_buffer_state
148 char *yy_ch_buf; /* input buffer */
149 char *yy_buf_pos; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
154 yy_size_t yy_buf_size;
156 /* Number of characters read into yy_ch_buf, not including EOB
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
165 int yy_is_our_buffer;
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
172 int yy_is_interactive;
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
180 /* Whether to try to fill the input buffer when we reach the
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.
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.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer = 0;
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
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char;
213 static int yy_n_chars; /* number of characters read into yy_ch_buf */
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 */
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 ...
226 static int yy_did_buffer_switch_on_eof;
228 void yyrestart YY_PROTO(( FILE *input_file ));
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 )
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 ));
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 * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
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; \
255 #define yy_set_bol(at_bol) \
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; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
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;
270 #define yytext_ptr yytext
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[] ));
277 /* Done after the current pattern has been matched and before the
278 * corresponding action - sets up yytext.
280 #define YY_DO_BEFORE_ACTION \
281 yytext_ptr = yy_bp; \
282 yyleng = (int) (yy_cp - yy_bp); \
283 yy_hold_char = *yy_cp; \
287 #define YY_NUM_RULES 42
288 #define YY_END_OF_BUFFER 43
289 static yyconst short int yy_acclist[602] =
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,
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,
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,
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,
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,
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,
360 static yyconst short int yy_accept[689] =
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,
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,
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,
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,
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,
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,
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
439 static yyconst int yy_ec[256] =
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,
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,
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,
471 static yyconst int yy_meta[74] =
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,
483 static yyconst short int yy_base[767] =
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,
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,
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,
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,
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,
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,
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,
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
571 static yyconst short int yy_def[767] =
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,
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,
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,
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,
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,
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,
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,
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
659 static yyconst short int yy_nxt[3889] =
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
1090 static yyconst short int yy_chk[3889] =
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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,
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
1521 static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
1522 static char *yy_full_match;
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
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 */ \
1539 #define yymore() yymore_used_but_not_detected
1540 #define YY_MORE_ADJ 0
1541 #define YY_RESTORE_YY_MORE_OFFSET
1545 * parser.l -- lex parser of algebraic chess moves for XBoard
1547 * Copyright 1991 by Digital Equipment Corporation, Maynard,
1550 * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005,
1551 * 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
1553 * The following terms apply to Digital Equipment Corporation's copyright
1554 * interest in XBoard:
1555 * ------------------------------------------------------------------------
1556 * All Rights Reserved
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.
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
1573 * ------------------------------------------------------------------------
1575 * The following terms apply to the enhanced version of XBoard
1576 * distributed by the Free Software Foundation:
1577 * ------------------------------------------------------------------------
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.
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.
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/.
1592 *------------------------------------------------------------------------
1593 ** See the file ChangeLog for a revision history. */
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).
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.
1612 #define NO_CONSTRAINT -1
1615 #define UNPUT_BUF_SIZE YYLMAX
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
1622 #else /*!FLEX_SCANNER*/
1623 /* yytext is definitely a char[], so yy_text can be set here, statically. */
1624 char *yy_text = (char *) yytext;
1629 /* [AP] use prototypes in function declarations */
1630 #define YY_USE_PROTOS
1632 #ifdef YY_USE_PROTOS
1633 #define YY_PROTO(proto) proto
1635 #define YY_PROTO(proto) ()
1637 /* end of [AP] fix */
1640 #define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size)
1643 int _yylex YY_PROTO((void)); \
1644 int yylex YY_PROTO((void)) \
1646 int result = _yylex(); \
1647 yy_text = (char *) yytext; \
1650 int _yylex YY_PROTO((void))
1658 /* The includes must be here, below the #undef input */
1663 # include <stdlib.h>
1664 # include <string.h>
1665 #else /* not STDC_HEADERS */
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 */
1674 # include <unistd.h>
1677 #if defined(_amigados)
1680 # include <fcntl.h> /* isatty() prototype */
1681 # endif /* HAVE_FCNTL_H */
1682 #endif /* defined(_amigados) */
1685 #include "backend.h"
1686 #include "frontend.h"
1690 extern int PosFlags P((int));
1692 extern Board boards[MAX_MOVES];
1694 int yyskipmoves = FALSE;
1695 char currentMoveString[YYLMAX];
1696 #ifndef FLEX_SCANNER
1697 char unputBuffer[UNPUT_BUF_SIZE];
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));
1711 int yywrap P((void));
1712 extern void CopyBoard P((Board to, Board from));
1715 /* Macros after this point can all be overridden by user definitions in
1719 #ifndef YY_SKIP_YYWRAP
1721 extern "C" int yywrap YY_PROTO(( void ));
1723 extern int yywrap YY_PROTO(( void ));
1728 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
1732 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
1735 #ifdef YY_NEED_STRLEN
1736 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
1741 static int yyinput YY_PROTO(( void ));
1743 static int input YY_PROTO(( void ));
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 ));
1754 #ifndef YY_NO_POP_STATE
1755 static void yy_pop_state YY_PROTO(( void ));
1757 #ifndef YY_NO_TOP_STATE
1758 static int yy_top_state YY_PROTO(( void ));
1762 #define YY_NO_PUSH_STATE 1
1763 #define YY_NO_POP_STATE 1
1764 #define YY_NO_TOP_STATE 1
1767 #ifdef YY_MALLOC_DECL
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).
1782 /* Amount of stuff to slurp up with each read. */
1783 #ifndef YY_READ_BUF_SIZE
1784 #define YY_READ_BUF_SIZE 8192
1787 /* Copy whatever the last rule matched to the standard output. */
1790 /* This used to be an fputs(), but since the string might contain NUL's,
1791 * we now use fwrite().
1793 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
1796 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1797 * is returned in "result".
1800 #define YY_INPUT(buf,result,max_size) \
1801 if ( yy_current_buffer->yy_is_interactive ) \
1804 for ( n = 0; n < max_size && \
1805 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1806 buf[n] = (char) c; \
1808 buf[n++] = (char) c; \
1809 if ( c == EOF && ferror( yyin ) ) \
1810 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1813 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
1814 && ferror( yyin ) ) \
1815 YY_FATAL_ERROR( "input in flex scanner failed" );
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.
1823 #define yyterminate() return YY_NULL
1826 /* Number of entries by which start-condition stack grows. */
1827 #ifndef YY_START_STACK_INCR
1828 #define YY_START_STACK_INCR 25
1831 /* Report a fatal error. */
1832 #ifndef YY_FATAL_ERROR
1833 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1836 /* Default declaration of generated scanner - a define so the user can
1837 * easily add parameters.
1840 #define YY_DECL int yylex YY_PROTO(( void ))
1843 /* Code executed at the beginning of each rule, after yytext and yyleng
1846 #ifndef YY_USER_ACTION
1847 #define YY_USER_ACTION
1850 /* Code executed at the end of each rule. */
1852 #define YY_BREAK break;
1855 #define YY_RULE_SETUP \
1857 yy_current_buffer->yy_at_bol = \
1858 (yytext[yyleng - 1] == '\n'); \
1863 register yy_state_type yy_current_state;
1864 register char *yy_cp, *yy_bp;
1865 register int yy_act;
1879 yy_start = 1; /* first start state */
1887 if ( ! yy_current_buffer )
1889 yy_create_buffer( yyin, YY_BUF_SIZE );
1891 yy_load_buffer_state();
1894 while ( 1 ) /* loops until end-of-file is reached */
1898 /* Support of yytext. */
1899 *yy_cp = yy_hold_char;
1901 /* yy_bp points to the position in yy_ch_buf of the start of
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;
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 )
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];
1920 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1921 *yy_state_ptr++ = yy_current_state;
1924 while ( yy_base[yy_current_state] != 3815 );
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 */
1932 if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
1934 yy_act = yy_acclist[yy_lp];
1935 if ( yy_act & YY_TRAILING_HEAD_MASK ||
1936 yy_looking_for_trail_begin )
1938 if ( yy_act == yy_looking_for_trail_begin )
1940 yy_looking_for_trail_begin = 0;
1941 yy_act &= ~YY_TRAILING_HEAD_MASK;
1945 else if ( yy_act & YY_TRAILING_MASK )
1947 yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
1948 yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
1952 yy_full_match = yy_cp;
1953 yy_full_state = yy_state_ptr;
1961 yy_current_state = *--yy_state_ptr;
1962 yy_lp = yy_accept[yy_current_state];
1965 YY_DO_BEFORE_ACTION;
1968 do_action: /* This label is used only to access EOF actions. */
1972 { /* beginning of action switch */
1977 * Fully-qualified algebraic move, possibly with promotion
1979 int skip1 = 0, skip2 = 0, skip3 = 0, promoted = 0;
1984 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
1986 if (yytext[0] == '+') skip1 = skip3 = promoted = 1; /* [HGM] Shogi promoted */
1989 if (yytext[1+skip1] == '/') skip1++;
1991 /* remove the [xX:-] */
1992 if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') ||
1993 (yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1;
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;
2001 if (appData.debugMode) {
2002 fprintf(debugFP, "Parser Qa1b2: yyleng=%d\n",
2006 if (yyleng-skip1-skip2 > 5) { char c;
2007 if (yytext[yyleng-1] == ')') {
2008 c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2010 c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2012 currentMoveString[5] = NULLCHAR;
2013 if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare)
2014 return IllegalMove; /* [HGM] promotion to invalid piece */
2017 if (appData.debugMode) {
2018 fprintf(debugFP, "parser: %s\n", currentMoveString);
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 )
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;
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]);
2047 if (currentMoveString[4] == NULLCHAR &&
2048 (result == WhitePromotionKnight || result == BlackPromotionKnight ||
2049 result == WhitePromotionQueen || result == BlackPromotionQueen)) {
2050 currentMoveString[4] = PieceToChar(BlackQueen);
2051 currentMoveString[5] = NULLCHAR;
2054 return (int) result;
2061 * Simple algebraic move, possibly with promotion
2062 * [HGM] Engine moves are received in this format, with lower-case promoChar!
2067 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2069 /* remove the [xX:-] */
2070 if ((yytext[2] == 'x') || (yytext[2] == 'X') ||
2071 (yytext[2] == '-') || (yytext[2] == ':')) skip = 1;
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;
2079 if (yyleng-skip > 4) { char c;
2080 if (yytext[yyleng-1] == ')') {
2081 c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2083 c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2085 currentMoveString[5] = NULLCHAR;
2086 if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare)
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 )
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]);
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);
2117 currentMoveString[4] = PieceToChar(BlackQueen);
2118 currentMoveString[5] = NULLCHAR;
2121 return (int) result;
2128 * Pawn move, possibly with promotion
2130 DisambiguateClosure cl;
2131 int skip = 0; char c;
2133 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2135 /* remove the =() */
2136 if (yytext[2] == '=' && yytext[3] != NULLCHAR) skip++;
2137 if (yytext[2+skip] == '(') skip++;
2139 cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
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];
2146 /* [HGM] do not allow values beyond board size */
2147 if(cl.rtIn >= BOARD_HEIGHT ||
2149 cl.ffIn >= BOARD_RGHT ||
2150 cl.ftIn < BOARD_LEFT )
2153 if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare)
2157 Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
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;
2166 return (int) cl.kind;
2173 * Pawn capture, possibly with promotion, possibly ambiguous
2175 DisambiguateClosure cl;
2176 int skip1 = 0, skip2 = 0; char c;
2178 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2180 /* remove trailing ep or e.p. (nonstandard PGN) */
2181 if (yytext[yyleng-1] == 'p') {
2183 yytext[yyleng] = NULLCHAR;
2184 } else if (yytext[yyleng-1] == '.') {
2186 yytext[yyleng] = NULLCHAR;
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++;
2195 cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
2197 cl.ffIn = yytext[0] - AAA;
2199 cl.ftIn = yytext[1+skip1] - AAA;
2200 c = cl.promoCharIn = yytext[2+skip1+skip2];
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 )
2209 if(c != '=' && c != '+' && c != NULLCHAR && CharToPiece(c) == EmptySquare)
2212 Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
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;
2221 return (int) cl.kind;
2228 * unambiguously abbreviated Pawn capture, possibly with promotion
2231 ChessMove result; char c;
2233 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2235 /* remove trailing ep or e.p. (nonstandard PGN) */
2236 if (yytext[yyleng-1] == 'p') {
2238 yytext[yyleng] = NULLCHAR;
2239 } else if (yytext[yyleng-1] == '.') {
2241 yytext[yyleng] = NULLCHAR;
2244 /* remove the [xX:-] */
2245 if ((yytext[1] == 'x') || (yytext[1] == 'X')
2246 || (yytext[1] == ':') || (yytext[1] == '-')) skip = 1;
2248 currentMoveString[0] = yytext[0];
2249 currentMoveString[2] = yytext[1+skip];
2250 currentMoveString[3] = yytext[2+skip];
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 )
2261 if (gameInfo.variant == VariantXiangqi && /* [HGM] In Xiangqi rank stays same */
2262 currentMoveString[0] != currentMoveString[2] ) {
2263 currentMoveString[1] = yytext[2+skip];
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;
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;
2276 if (yyleng-skip > 3) {
2277 if (yytext[yyleng-1] == ')')
2278 c = currentMoveString[4] = ToLower(yytext[yyleng-2]);
2280 c = currentMoveString[4] = ToLower(yytext[yyleng-1]);
2281 currentMoveString[5] = NULLCHAR;
2282 if(c != '=' && c != '+' && CharToPiece(c) == EmptySquare)
2285 currentMoveString[4] = NULLCHAR;
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]);
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;
2308 if (result != IllegalMove) return (int) result;
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';
2316 return (int) IllegalMove;
2319 if (currentMoveString[3] == '4') {
2320 currentMoveString[1] = '4';
2321 currentMoveString[3] = '3';
2323 return (int) IllegalMove;
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]);
2335 if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant)
2336 return (int) result;
2338 return (int) IllegalMove;
2345 * piece move, possibly ambiguous
2347 DisambiguateClosure cl;
2348 int skip = 0, skip2 = 0, promoted = 0;
2350 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2352 if(yytext[0] == '+') promoted = skip = skip2 = 1;
2354 /* remove the [xX:-] */
2355 if ((yytext[1+skip] == 'x') || (yytext[1+skip] == 'X')
2356 || (yytext[1+skip] == ':') || (yytext[1+skip] == '-')) skip++;
2358 if (WhiteOnMove(yyboardindex)) {
2359 cl.pieceIn = CharToPiece(ToUpper(yytext[skip2]));
2361 cl.pieceIn = CharToPiece(ToLower(yytext[skip2]));
2363 if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn);
2367 cl.rtIn = yytext[2+skip] - ONE;
2368 cl.ftIn = yytext[1+skip] - AAA;
2369 cl.promoCharIn = NULLCHAR;
2371 if(yyleng-skip > 3) /* [HGM] can have Shogi-style promotion */
2372 cl.promoCharIn = yytext[yyleng-1];
2374 if (appData.debugMode) {
2375 fprintf(debugFP, "Parser Qa1: yyleng=%d, %d(%d,%d)-(%d,%d) = %d (%c)\n",
2377 cl.pieceIn,cl.ffIn,cl.rfIn,cl.ftIn,cl.rtIn,cl.promoCharIn,cl.promoCharIn?cl.promoCharIn:' ');
2380 /* [HGM] but do not allow values beyond board size */
2381 if(cl.rtIn >= BOARD_HEIGHT ||
2383 cl.ftIn >= BOARD_RGHT ||
2384 cl.ftIn < BOARD_LEFT )
2387 Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
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;
2396 return (int) cl.kind;
2403 * piece move with rank or file disambiguator
2405 DisambiguateClosure cl;
2406 int skip = 0, skip2 = 0; int promoted=0;
2408 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2410 if(yytext[0]=='+') promoted = skip = skip2 = 1;
2412 /* remove the [xX:-] */
2413 if ((yytext[2+skip] == 'x') || (yytext[2+skip] == 'X')
2414 || (yytext[2+skip] == ':') || (yytext[2+skip] == '-')) skip++;
2416 if (WhiteOnMove(yyboardindex)) {
2417 cl.pieceIn = CharToPiece(ToUpper(yytext[skip2]));
2419 cl.pieceIn = CharToPiece(ToLower(yytext[skip2]));
2421 if(promoted) cl.pieceIn = (ChessSquare) (PROMOTED cl.pieceIn);
2423 if (isalpha(yytext[1+skip2])) {
2425 cl.ffIn = yytext[1+skip2] - AAA;
2427 if(cl.ffIn >= BOARD_RGHT ||
2428 cl.ffIn < BOARD_LEFT ) return 0;
2430 cl.rfIn = yytext[1+skip2] - ONE;
2432 if(cl.rfIn >= BOARD_HEIGHT ||
2433 cl.rfIn < 0) return 0;
2435 cl.rtIn = yytext[3+skip] - ONE;
2436 cl.ftIn = yytext[2+skip] - AAA;
2437 cl.promoCharIn = NULLCHAR;
2439 if(yyleng-skip > 4) /* [HGM] can have Shogi-style promotion */
2440 cl.promoCharIn = yytext[yyleng-1];
2442 /* [HGM] do not allow values beyond board size */
2443 if(cl.rtIn >= BOARD_HEIGHT ||
2445 cl.ftIn >= BOARD_RGHT ||
2446 cl.ftIn < BOARD_LEFT )
2449 Disambiguate(boards[yyboardindex], PosFlags(yyboardindex), &cl);
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;
2458 return (int) cl.kind;
2466 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
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 */
2473 ff = (BOARD_WIDTH-1)>>1;
2478 ff = BOARD_WIDTH>>1;
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;
2490 rf = BOARD_HEIGHT-1;
2491 ff = BOARD_WIDTH>>1;
2492 rt = BOARD_HEIGHT-1;
2496 if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
2497 if (WhiteOnMove(yyboardindex)) {
2498 ff = initialRights[2];
2499 ft = initialRights[1];
2501 ff = initialRights[5];
2502 ft = initialRights[4];
2504 if (appData.debugMode)
2506 fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft);
2508 if(ff < 0 || ft < 0) return 0;
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);
2514 return (int) LegalityTest(boards[yyboardindex],
2515 PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
2516 rf, ff, rt, ft, NULLCHAR);
2524 if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */
2526 if (WhiteOnMove(yyboardindex)) {
2527 if (boards[yyboardindex][0][(BOARD_WIDTH-1)>>1] == WhiteKing) {
2528 /* ICS wild castling */
2530 ff = (BOARD_WIDTH-1)>>1;
2535 ff = BOARD_WIDTH>>1;
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;
2547 rf = BOARD_HEIGHT-1;
2548 ff = BOARD_WIDTH>>1;
2549 rt = BOARD_HEIGHT-1;
2553 if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
2554 if (WhiteOnMove(yyboardindex)) {
2555 ff = initialRights[2];
2556 ft = initialRights[0];
2558 ff = initialRights[5];
2559 ft = initialRights[3];
2561 if (appData.debugMode) {
2562 fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft);
2564 if(ff < 0 || ft < 0) return 0;
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);
2571 return (int) LegalityTest(boards[yyboardindex],
2572 PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.!
2573 rf, ff, rt, ft, NULLCHAR);
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;
2585 if (appData.debugMode) {
2586 fprintf(debugFP, "Drop: %s\n", currentMoveString);
2588 /* [HGM] do not allow values beyond board size */
2589 if(currentMoveString[3] - ONE >= BOARD_HEIGHT ||
2590 currentMoveString[2] - AAA >= BOARD_WIDTH )
2593 if (WhiteOnMove(yyboardindex)) {
2594 currentMoveString[0] = ToUpper(yytext[0]);
2595 return (int) WhiteDrop;
2597 currentMoveString[0] = ToLower(yytext[0]);
2598 return (int) BlackDrop;
2605 if (WhiteOnMove(yyboardindex))
2606 return (int) BlackWins;
2608 return (int) WhiteWins;
2614 return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
2620 return (int) GameUnfinished;
2626 return (int) GameIsDrawn;
2632 return (int) GameIsDrawn;
2638 if (WhiteOnMove(yyboardindex))
2639 return (int) BlackWins;
2641 return (int) WhiteWins;
2647 if (WhiteOnMove(yyboardindex))
2648 return (int) BlackWins;
2650 return (int) WhiteWins;
2656 return (int) GameIsDrawn;
2662 return (int) GameIsDrawn;
2668 return (int) (ToUpper(yytext[0]) == 'W' ? WhiteWins : BlackWins);
2674 return (int) (ToUpper(yytext[0]) == 'W' ? BlackWins : WhiteWins);
2680 return (int) WhiteWins;
2686 return (int) BlackWins;
2692 return (int) GameIsDrawn;
2698 return (int) GameUnfinished;
2705 if ((yyleng == 1) && (yytext[0] == '1'))
2706 return (int) MoveNumberOne;
2712 /* elapsed time indication, e.g. (0:12) or {10:21.071} */
2713 return (int) ElapsedTime;
2719 /* position diagram enclosed in [-- --] */
2720 return (int) PositionDiagram;
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 */
2729 /* position diagram enclosed in {-- --} */
2730 return (int) PositionDiagram;
2736 return (int) PGNTag;
2742 return (int) GNUChessGame;
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 */
2751 return (int) XBoardGame;
2756 { /* numeric annotation glyph */
2762 { /* anything in {} */
2763 return (int) Comment;
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 */
2771 { /* ; to end of line */
2772 return (int) Comment;
2777 { /* anything in [] */
2778 return (int) Comment;
2783 { /* very nested () */
2784 return (int) Comment;
2789 { /* >=2 chars in () */
2790 return (int) Comment;
2796 /* Skip mail headers */
2802 /* Skip random words */
2808 /* Skip everything else */
2815 case YY_STATE_EOF(INITIAL):
2818 case YY_END_OF_BUFFER:
2820 /* Amount of text matched not including the EOB char. */
2821 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
2823 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2824 *yy_cp = yy_hold_char;
2825 YY_RESTORE_YY_MORE_OFFSET
2827 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
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.
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;
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
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;
2854 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
2856 yy_current_state = yy_get_previous_state();
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).
2867 yy_next_state = yy_try_NUL_trans( yy_current_state );
2869 yy_bp = yytext_ptr + YY_MORE_ADJ;
2871 if ( yy_next_state )
2873 /* Consume the NUL. */
2874 yy_cp = ++yy_c_buf_p;
2875 yy_current_state = yy_next_state;
2882 goto yy_find_action;
2886 else switch ( yy_get_next_buffer() )
2888 case EOB_ACT_END_OF_FILE:
2890 yy_did_buffer_switch_on_eof = 0;
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.
2903 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
2905 yy_act = YY_STATE_EOF(YY_START);
2911 if ( ! yy_did_buffer_switch_on_eof )
2917 case EOB_ACT_CONTINUE_SCAN:
2919 yytext_ptr + yy_amount_of_matched_text;
2921 yy_current_state = yy_get_previous_state();
2924 yy_bp = yytext_ptr + YY_MORE_ADJ;
2927 case EOB_ACT_LAST_MATCH:
2929 &yy_current_buffer->yy_ch_buf[yy_n_chars];
2931 yy_current_state = yy_get_previous_state();
2934 yy_bp = yytext_ptr + YY_MORE_ADJ;
2935 goto yy_find_action;
2942 "fatal flex scanner internal error--no action found" );
2943 } /* end of action switch */
2944 } /* end of scanning one token */
2945 } /* end of yylex */
2948 /* yy_get_next_buffer - try to read in a new buffer
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
2956 static int yy_get_next_buffer()
2958 register char *dest = yy_current_buffer->yy_ch_buf;
2959 register char *source = yytext_ptr;
2960 register int number_to_move, i;
2963 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
2965 "fatal flex scanner internal error--end of buffer missed" );
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 )
2971 /* We matched a single character, the EOB, so
2972 * treat this as a final EOF.
2974 return EOB_ACT_END_OF_FILE;
2979 /* We matched some text prior to the EOB, first
2982 return EOB_ACT_LAST_MATCH;
2986 /* Try to read more data. */
2988 /* First move last chars to start of buffer. */
2989 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
2991 for ( i = 0; i < number_to_move; ++i )
2992 *(dest++) = *(source++);
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,
2998 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
3003 yy_current_buffer->yy_buf_size - number_to_move - 1;
3005 while ( num_to_read <= 0 )
3006 { /* Not enough room in the buffer - grow it. */
3007 #ifdef YY_USES_REJECT
3009 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
3012 /* just a shorter name for the current buffer */
3013 YY_BUFFER_STATE b = yy_current_buffer;
3015 int yy_c_buf_p_offset =
3016 (int) (yy_c_buf_p - b->yy_ch_buf);
3018 if ( b->yy_is_our_buffer )
3020 int new_size = b->yy_buf_size * 2;
3022 if ( new_size <= 0 )
3023 b->yy_buf_size += b->yy_buf_size / 8;
3025 b->yy_buf_size *= 2;
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 );
3033 /* Can't grow it, we don't own it. */
3036 if ( ! b->yy_ch_buf )
3038 "fatal error - scanner input buffer overflow" );
3040 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
3042 num_to_read = yy_current_buffer->yy_buf_size -
3047 if ( num_to_read > YY_READ_BUF_SIZE )
3048 num_to_read = YY_READ_BUF_SIZE;
3050 /* Read in more data. */
3051 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
3052 yy_n_chars, num_to_read );
3054 yy_current_buffer->yy_n_chars = yy_n_chars;
3057 if ( yy_n_chars == 0 )
3059 if ( number_to_move == YY_MORE_ADJ )
3061 ret_val = EOB_ACT_END_OF_FILE;
3067 ret_val = EOB_ACT_LAST_MATCH;
3068 yy_current_buffer->yy_buffer_status =
3069 YY_BUFFER_EOF_PENDING;
3074 ret_val = EOB_ACT_CONTINUE_SCAN;
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;
3080 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
3086 /* yy_get_previous_state - get the state just before the EOB char was reached */
3088 static yy_state_type yy_get_previous_state()
3090 register yy_state_type yy_current_state;
3091 register char *yy_cp;
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;
3098 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
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 )
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];
3107 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3108 *yy_state_ptr++ = yy_current_state;
3111 return yy_current_state;
3115 /* yy_try_NUL_trans - try to make a transition on the NUL character
3118 * next_state = yy_try_NUL_trans( current_state );
3121 #ifdef YY_USE_PROTOS
3122 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
3124 static yy_state_type yy_try_NUL_trans( yy_current_state )
3125 yy_state_type yy_current_state;
3128 register int yy_is_jam;
3130 register YY_CHAR yy_c = 1;
3131 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
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];
3137 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3138 yy_is_jam = (yy_current_state == 687);
3140 *yy_state_ptr++ = yy_current_state;
3142 return yy_is_jam ? 0 : yy_current_state;
3147 #ifdef YY_USE_PROTOS
3148 static void yyunput( int c, register char *yy_bp )
3150 static void yyunput( c, yy_bp )
3152 register char *yy_bp;
3155 register char *yy_cp = yy_c_buf_p;
3157 /* undo effects of setting up yytext */
3158 *yy_cp = yy_hold_char;
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];
3169 while ( source > yy_current_buffer->yy_ch_buf )
3170 *--dest = *--source;
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;
3177 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
3178 YY_FATAL_ERROR( "flex scanner push-back overflow" );
3181 *--yy_cp = (char) c;
3185 yy_hold_char = *yy_cp;
3188 #endif /* ifndef YY_NO_UNPUT */
3192 static int yyinput()
3199 *yy_c_buf_p = yy_hold_char;
3201 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
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.
3207 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3208 /* This was really a NUL. */
3212 { /* need more input */
3213 int offset = yy_c_buf_p - yytext_ptr;
3216 switch ( yy_get_next_buffer() )
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.
3229 /* Reset buffer status. */
3234 case EOB_ACT_END_OF_FILE:
3239 if ( ! yy_did_buffer_switch_on_eof )
3248 case EOB_ACT_CONTINUE_SCAN:
3249 yy_c_buf_p = yytext_ptr + offset;
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;
3259 yy_current_buffer->yy_at_bol = (c == '\n');
3265 #ifdef YY_USE_PROTOS
3266 void yyrestart( FILE *input_file )
3268 void yyrestart( input_file )
3272 if ( ! yy_current_buffer )
3273 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
3275 yy_init_buffer( yy_current_buffer, input_file );
3276 yy_load_buffer_state();
3280 #ifdef YY_USE_PROTOS
3281 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
3283 void yy_switch_to_buffer( new_buffer )
3284 YY_BUFFER_STATE new_buffer;
3287 if ( yy_current_buffer == new_buffer )
3290 if ( yy_current_buffer )
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;
3298 yy_current_buffer = new_buffer;
3299 yy_load_buffer_state();
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.
3306 yy_did_buffer_switch_on_eof = 1;
3310 #ifdef YY_USE_PROTOS
3311 void yy_load_buffer_state( void )
3313 void yy_load_buffer_state()
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;
3323 #ifdef YY_USE_PROTOS
3324 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
3326 YY_BUFFER_STATE yy_create_buffer( file, size )
3333 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3335 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
3337 b->yy_buf_size = size;
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.
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()" );
3346 b->yy_is_our_buffer = 1;
3348 yy_init_buffer( b, file );
3354 #ifdef YY_USE_PROTOS
3355 void yy_delete_buffer( YY_BUFFER_STATE b )
3357 void yy_delete_buffer( b )
3364 if ( b == yy_current_buffer )
3365 yy_current_buffer = (YY_BUFFER_STATE) 0;
3367 if ( b->yy_is_our_buffer )
3368 yy_flex_free( (void *) b->yy_ch_buf );
3370 yy_flex_free( (void *) b );
3374 #ifndef YY_ALWAYS_INTERACTIVE
3375 #ifndef YY_NEVER_INTERACTIVE
3376 extern int isatty YY_PROTO(( int ));
3380 #ifdef YY_USE_PROTOS
3381 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
3383 void yy_init_buffer( b, file )
3390 yy_flush_buffer( b );
3392 b->yy_input_file = file;
3393 b->yy_fill_buffer = 1;
3395 #if YY_ALWAYS_INTERACTIVE
3396 b->yy_is_interactive = 1;
3398 #if YY_NEVER_INTERACTIVE
3399 b->yy_is_interactive = 0;
3401 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
3407 #ifdef YY_USE_PROTOS
3408 void yy_flush_buffer( YY_BUFFER_STATE b )
3410 void yy_flush_buffer( b )
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.
3424 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
3425 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
3427 b->yy_buf_pos = &b->yy_ch_buf[0];
3430 b->yy_buffer_status = YY_BUFFER_NEW;
3432 if ( b == yy_current_buffer )
3433 yy_load_buffer_state();
3437 #ifndef YY_NO_SCAN_BUFFER
3438 #ifdef YY_USE_PROTOS
3439 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
3441 YY_BUFFER_STATE yy_scan_buffer( base, size )
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. */
3454 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
3456 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
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;
3465 b->yy_fill_buffer = 0;
3466 b->yy_buffer_status = YY_BUFFER_NEW;
3468 yy_switch_to_buffer( b );
3475 #ifndef YY_NO_SCAN_STRING
3476 #ifdef YY_USE_PROTOS
3477 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
3479 YY_BUFFER_STATE yy_scan_string( yy_str )
3480 yyconst char *yy_str;
3484 for ( len = 0; yy_str[len]; ++len )
3487 return yy_scan_bytes( yy_str, len );
3492 #ifndef YY_NO_SCAN_BYTES
3493 #ifdef YY_USE_PROTOS
3494 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
3496 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
3497 yyconst char *bytes;
3506 /* Get memory for full buffer, including space for trailing EOB's. */
3508 buf = (char *) yy_flex_alloc( n );
3510 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
3512 for ( i = 0; i < len; ++i )
3515 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
3517 b = yy_scan_buffer( buf, n );
3519 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
3521 /* It's okay to grow etc. this buffer, and we should throw it
3522 * away when we're done.
3524 b->yy_is_our_buffer = 1;
3531 #ifndef YY_NO_PUSH_STATE
3532 #ifdef YY_USE_PROTOS
3533 static void yy_push_state( int new_state )
3535 static void yy_push_state( new_state )
3539 if ( yy_start_stack_ptr >= yy_start_stack_depth )
3543 yy_start_stack_depth += YY_START_STACK_INCR;
3544 new_size = yy_start_stack_depth * sizeof( int );
3546 if ( ! yy_start_stack )
3547 yy_start_stack = (int *) yy_flex_alloc( new_size );
3550 yy_start_stack = (int *) yy_flex_realloc(
3551 (void *) yy_start_stack, new_size );
3553 if ( ! yy_start_stack )
3555 "out of memory expanding start-condition stack" );
3558 yy_start_stack[yy_start_stack_ptr++] = YY_START;
3565 #ifndef YY_NO_POP_STATE
3566 static void yy_pop_state()
3568 if ( --yy_start_stack_ptr < 0 )
3569 YY_FATAL_ERROR( "start-condition stack underflow" );
3571 BEGIN(yy_start_stack[yy_start_stack_ptr]);
3576 #ifndef YY_NO_TOP_STATE
3577 static int yy_top_state()
3579 return yy_start_stack[yy_start_stack_ptr - 1];
3583 #ifndef YY_EXIT_FAILURE
3584 #define YY_EXIT_FAILURE 2
3587 #ifdef YY_USE_PROTOS
3588 static void yy_fatal_error( yyconst char msg[] )
3590 static void yy_fatal_error( msg )
3594 (void) fprintf( stderr, "%s\n", msg );
3595 exit( YY_EXIT_FAILURE );
3600 /* Redefine yyless() so it works in section 3 code. */
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'; \
3616 /* Internal utility routines. */
3619 #ifdef YY_USE_PROTOS
3620 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
3622 static void yy_flex_strncpy( s1, s2, n )
3629 for ( i = 0; i < n; ++i )
3634 #ifdef YY_NEED_STRLEN
3635 #ifdef YY_USE_PROTOS
3636 static int yy_flex_strlen( yyconst char *s )
3638 static int yy_flex_strlen( s )
3643 for ( n = 0; s[n]; ++n )
3651 #ifdef YY_USE_PROTOS
3652 static void *yy_flex_alloc( yy_size_t size )
3654 static void *yy_flex_alloc( size )
3658 return (void *) malloc( size );
3661 #ifdef YY_USE_PROTOS
3662 static void *yy_flex_realloc( void *ptr, yy_size_t size )
3664 static void *yy_flex_realloc( ptr, size )
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.
3676 return (void *) realloc( (char *) ptr, size );
3679 #ifdef YY_USE_PROTOS
3680 static void yy_flex_free( void *ptr )
3682 static void yy_flex_free( ptr )
3699 static char *StringToLex;
3701 #ifndef FLEX_SCANNER
3708 if (StringToLex != NULL) {
3710 if (ret == NULLCHAR)
3714 } else if (unputCount > 0) {
3715 ret = unputBuffer[--unputCount];
3727 * Return offset of next pattern within current file
3731 int offset = ftell(lexFP) - unputCount;
3739 static void output(ch)
3742 if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unmatched character '%c' (0%o)\n",
3746 static void unput(ch)
3749 if (ch == 0) return;
3750 if (StringToLex != NULL) {
3753 if (unputCount >= UNPUT_BUF_SIZE)
3754 if(appData.debugMode) fprintf(debugFP, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",
3756 unputBuffer[unputCount++] = ch;
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.
3771 unput('\n'); /* kludge */
3774 /* Get ready to lex from a string. ^ at start of pattern WON'T
3775 match at the start of the string!
3784 #endif /*!FLEX_SCANNER*/
3787 void my_yy_input(buf, result, max_size)
3794 if (StringToLex != NULL) {
3796 while (*StringToLex != NULLCHAR) {
3797 *buf++ = *StringToLex++;
3803 count = fread(buf, 1, max_size, yyin);
3813 static YY_BUFFER_STATE my_file_buffer = NULL;
3816 Return offset of next pattern in the current file.
3820 int pos = yy_c_buf_p - YY_CURRENT_BUFFER->yy_ch_buf;
3822 return(ftell(YY_CURRENT_BUFFER->yy_input_file) -
3830 if (my_file_buffer != NULL)
3831 yy_delete_buffer(my_file_buffer);
3833 my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
3834 yy_switch_to_buffer(my_file_buffer);
3840 if (my_file_buffer != NULL)
3841 yy_delete_buffer(my_file_buffer);
3843 my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE);
3844 yy_switch_to_buffer(my_file_buffer);
3846 #endif /*FLEX_SCANNER*/
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)
3860 char *oldStringToLex;
3862 YY_BUFFER_STATE buffer, oldBuffer;
3865 yyboardindex = boardIndex;
3866 oldStringToLex = StringToLex;
3869 buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
3870 oldBuffer = YY_CURRENT_BUFFER;
3871 yy_switch_to_buffer(buffer);
3872 #endif /*FLEX_SCANNER*/
3874 ret = (ChessMove) yylex();
3877 if (oldBuffer != NULL)
3878 yy_switch_to_buffer(oldBuffer);
3879 yy_delete_buffer(buffer);
3880 #endif /*FLEX_SCANNER*/
3881 StringToLex = oldStringToLex;