/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/flex-2.4.7/RCS/flex.skl,v 1.2 94/08/03 11:13:24 vern Exp $
 */

#define FLEX_SCANNER

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else	/* ! __cplusplus */

#ifdef __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */


#ifdef __TURBOC__
#define YY_USE_CONST
#endif


#ifndef YY_USE_CONST
#ifndef const
#define const
#endif
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an unsigned
 * integer for use as an array index.  If the signed char is negative,
 * we want to instead treat it as an 8-bit unsigned char, hence the
 * double cast.
 */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)

/* Enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN.
 */
#define BEGIN yy_start = 1 + 2 *

/* Translate the current start state into a value that can be later handed
 * to BEGIN to return to the state.
 */
#define YY_START ((yy_start - 1) / 2)

/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* Special action meaning "start processing a new file".  Now included
 * only for backward compatibility with previous versions of flex.
 */
#define YY_NEW_FILE yyrestart( yyin )

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#define YY_BUF_SIZE 16384

typedef struct yy_buffer_state *YY_BUFFER_STATE;

extern int yyleng;
extern FILE *yyin, *yyout;

#ifdef __cplusplus
extern "C" {
#endif
	extern int yywrap YY_PROTO(( void ));
#ifdef __cplusplus
	}
#endif

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* The funky do-while in the following #define is used to turn the definition
 * int a single C statement (which needs a semi-colon terminator).  This
 * avoids problems with code like:
 *
 * 	if ( condition_holds )
 *		yyless( 5 );
 *	else
 *		do_something_else();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the yyless() call.
 */

/* Return all but the first 'n' matched characters back to the input stream. */

#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		*yy_cp = yy_hold_char; \
		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, yytext_ptr )


struct yy_buffer_state
	{
	FILE *yy_input_file;

	char *yy_ch_buf;		/* input buffer */
	char *yy_buf_pos;		/* current position in input buffer */

	/* Size of input buffer in bytes, not including room for EOB
	 * characters.
	 */
	int yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	int yy_n_chars;

	/* Whether this is an "interactive" input source; if so, and
	 * if we're using stdio for input, then we want to use getc()
	 * instead of fread(), to make sure we stop fetching input after
	 * each newline.
	 */
	int yy_is_interactive;

	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
	/* When an EOF's been seen but there's still some text to process
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
	 * shouldn't try reading from the input source any more.  We might
	 * still have a bunch of tokens to match, though, because of
	 * possible backing-up.
	 *
	 * When we actually see the EOF, we change the status to "new"
	 * (via yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2
	};

static YY_BUFFER_STATE yy_current_buffer = 0;

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 */
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;

static int yy_n_chars;		/* number of characters read into yy_ch_buf */


int yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

static void yyunput YY_PROTO(( int c, char *buf_ptr ));
void yyrestart YY_PROTO(( FILE *input_file ));
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));

static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
static void yy_push_state YY_PROTO(( int new_state ));
static void yy_pop_state YY_PROTO(( void ));
static int yy_top_state YY_PROTO(( void ));

static void *yy_flex_alloc YY_PROTO(( unsigned int ));
static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define INITIAL 0
typedef unsigned char YY_CHAR;
typedef int yy_state_type;

#define YY_USES_REJECT
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
extern char *yytext;
#define yytext_ptr yytext

#ifndef yytext_ptr
static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
#endif

#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
static int input YY_PROTO(( void ));
#endif

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( const char msg[] ));

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	yytext_ptr = yy_bp; \
	yyleng = yy_cp - yy_bp; \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define YY_END_OF_BUFFER 47
static const short int yy_acclist[741] =
    {   0,
       47,   45,   46,   44,   45,   46,   45,   46,   30,   45,
       46,   45,   46,   44,   45,   46,   44,   45,   46,16415,
       44,   45,   46,16415,   45,   46,   24,   44,   45,   46,
       44,   45,   46,   44,   45,   46,   44,   45,   46,   44,
       45,   46,   44,   45,   46,   44,   45,   46,   44,   45,
       46,   44,   45,   46,   44,   45,   46,   23,   44,   45,
       46,   45,   46,   44,   45,   46,   24,   44,   45,   46,
       44,   45,   46,   44,   45,   46,   44,   45,   46,   44,
       45,   46,   44,   45,   46,   44,   45,   46,   44,   45,
       46,   45,   46,   45,   46,   44,   45,   46,   44,   45,

       46,   44,   45,   46,16415,   44,   45,   46,16415,   45,
       46,   24,   44,   45,   46,   44,   45,   46,   44,   45,
       46,   44,   45,   46,   44,   45,   46,   44,   45,   46,
       44,   45,   46,   44,   45,   46,   44,   45,   46,   44,
       45,   46,   23,   44,   45,   46,   44,   45,   46,   24,
       44,   45,   46,   44,   45,   46,   44,   45,   46,   44,
       45,   46,   44,   45,   46,   44,   45,   46,   44,   45,
       46,   44,   45,   46,   45,   46,   44,   19,   44,    9,
       44,   44,   44,16415, 8223,   44,   39,   44,   44,   44,
       44,   44,   44,   44,   44,   44,   44,   44,   44,   44,

       44,    9,   44,   44,   44,   44,   44,   44,   44,   44,
       40,   44,    3,   44,   44,   44,    4,   44,   44,    3,
       44,   44,    4,   44,   44,   44,   44,    9,   44,   38,
       44,   43,   44,    9,   44,   43,   44,   44,16415,   43,
     8223,   44,   44,   44,   43,   44,   44,   44,   44,   44,
       44,   44,   44,   44,   44,   44,   44,    9,   44,   44,
       44,   44,   44,   44,   44,   44,   44,    3,   44,   43,
       44,   44,    4,   44,   44,    3,   44,   43,   44,    4,
       44,   44,   44,   44,    9,   44,   17,    9,   44,   28,
       44,   28,    8,   44, 8223,   27,   44,   27,   29,   44,

       44,   44,   44,    6,   44,   44,   44,   44,   44,   44,
       44,   44,   44,    9,   44,   44,   44,   44,   44,   44,
       44,   44,    4,   44,   44,    3,   44,   44,    3,   44,
        4,    5,   44,    4,   44,    4,   44,   44,   44,    3,
       44,    4,    4,   44,    5,    6,   44,    4,   44,    9,
       44,   38,   43,    9,   44,   28,   44,    8,   44,   28,
       43,   27,   44,   27,   43,   39,   44,   44,   43,   44,
       43,   44,    6,   44,   44,   44,   44,   44,   44,   44,
       44,   44,    9,   44,   44,   44,   44,   44,   44,   44,
       44,    4,   44,   44,   43,    3,   44,   44,    3,   44,

        4,   43,    5,   44,    4,   44,    4,   44,   44,   43,
       44,    3,   44,    4,   43,    4,   44,    5,    6,   44,
        4,   44,    9,   44,   42,   42,   41,   30,   30,   44,
        6,   44,    7,   44,    6,   44,   44,   44,   44,   44,
       44,   22,   44,   44,   18,   44,   44,   44,   44,   44,
       44,   44,   44,   40,    3,    3,    2,   44,    5,    4,
        5,   44,    4,    2,    7,   44,    5,    6,    5,    6,
       44,    5,   44,   44,   30,   43,   44,   43,   43,    6,
       44,   43,    7,   44,    6,   43,   44,   44,   43,   44,
       44,   44,   44,   22,   44,   44,   18,   44,   44,   44,

       44,   44,   44,   44,   44,   43,    2,   44,   43,    5,
       43,   43,    4,   43,    5,   44,   43,    2,    7,   44,
        5,    6,   43,    5,    6,   44,    5,   44,   44,   24,
        7,   24,   44,    1,   44,   44,   22,   44,   44,   44,
       44,   44,   44,   44,   23,   23,   44,   35,   40,    2,
        2,   44,    5,    5,    2,    7,   43,   43,   43,   43,
       43,   43,    7,   43,   24,   44,   43,    1,   44,   44,
       22,   44,   44,   44,   44,   44,   44,   44,   23,   44,
        2,   43,    2,   44,   43,   43,    5,   43,    4,   43,
        2,    7,   43,   32,   42,   28,   28,   27,   27,   29,

       29,   26,   24,    1,    1,   44,   44,   44,   44,   10,
       44,   44,   44,   25,   23,   33,   40,   35,    2,    2,
       32,   38,   43,   28,   43,   43,   28,   43,   43,   27,
       43,   43,   27,   43,    1,   43,    1,   44,   44,   44,
       44,   10,   44,   44,   44,   43,   43,    2,   43,    5,
       43,   29,   24,    1,    1,   22,   44,   44,   44,   10,
       44,   44,   44,   23,   43,   43,    1,   43,   44,   44,
       44,   10,   44,   44,   44,    2,   43,   12,   24,   44,
       44,   44,   11,   23,    1,   43,   44,   44,   44,   12,
       12,   44,   44,   16,   44,   11,   11,   44,   43,   44,

       16,   44,   21,   44,   44,   43,   43,   44,   44,   21,
       44,   44,   43,   43,   44,   44,   36,   44,   43,   43,
       36,   44,   14,   20,   24,   36,   13,   23,   37,   37,
       39,   36,   43,   26,   20,   25,   21,   15,   38,   34
    } ;

static const short int yy_accept[935] =
    {   0,
        1,    1,    1,    2,    4,    7,    9,   12,   14,   17,
       21,   25,   27,   31,   34,   37,   40,   43,   46,   49,
       52,   55,   58,   62,   64,   67,   71,   74,   77,   80,
       83,   86,   89,   92,   94,   96,   99,  102,  106,  110,
      112,  116,  119,  122,  125,  128,  131,  134,  137,  140,
      143,  147,  150,  154,  157,  160,  163,  166,  169,  172,
      175,  177,  178,  178,  178,  178,  178,  179,  179,  179,
      180,  180,  182,  182,  182,  182,  183,  183,  185,  185,
      187,  187,  188,  188,  189,  189,  190,  190,  191,  192,
      193,  194,  195,  196,  197,  198,  199,  200,  201,  202,

      204,  205,  206,  207,  208,  209,  209,  210,  211,  211,
      211,  211,  211,  212,  213,  215,  215,  216,  217,  219,
      220,  222,  222,  223,  225,  226,  227,  228,  230,  230,
      230,  230,  231,  231,  232,  233,  234,  236,  237,  238,
      240,  241,  243,  243,  244,  245,  246,  247,  248,  249,
      250,  251,  252,  253,  254,  255,  256,  257,  258,  260,
      261,  262,  263,  264,  265,  266,  267,  268,  270,  271,
      272,  273,  275,  276,  278,  279,  280,  282,  283,  284,
      285,  287,  287,  287,  287,  287,  287,  287,  287,  287,
      287,  287,  288,  288,  288,  288,  290,  292,  293,  295,

      296,  296,  296,  296,  298,  299,  300,  300,  300,  300,
      300,  300,  300,  300,  301,  301,  302,  302,  303,  303,
      304,  306,  307,  308,  309,  310,  311,  312,  313,  314,
      316,  317,  318,  319,  320,  321,  321,  321,  321,  321,
      321,  321,  322,  323,  323,  323,  323,  323,  325,  325,
      326,  326,  326,  328,  329,  331,  332,  334,  334,  334,
      336,  338,  339,  339,  340,  342,  343,  345,  348,  350,
      352,  353,  353,  353,  353,  353,  354,  354,  356,  358,
      360,  362,  364,  366,  366,  367,  367,  368,  369,  370,
      371,  372,  373,  375,  376,  377,  378,  379,  380,  381,

      382,  383,  385,  386,  387,  388,  389,  390,  391,  392,
      394,  395,  396,  398,  399,  401,  403,  405,  407,  409,
      410,  411,  412,  414,  416,  418,  421,  423,  425,  425,
      426,  427,  427,  427,  428,  428,  428,  429,  429,  430,
      430,  430,  430,  431,  431,  431,  431,  431,  431,  431,
      431,  431,  431,  431,  431,  431,  431,  431,  431,  431,
      431,  431,  431,  433,  433,  433,  435,  436,  437,  438,
      438,  439,  440,  441,  442,  444,  444,  445,  447,  448,
      449,  450,  451,  452,  452,  452,  452,  452,  452,  452,
      452,  452,  452,  452,  453,  454,  454,  454,  454,  454,

      455,  456,  456,  457,  459,  460,  461,  461,  461,  463,
      464,  464,  467,  469,  472,  474,  475,  475,  476,  476,
      476,  476,  476,  477,  478,  479,  480,  480,  480,  482,
      483,  485,  487,  488,  489,  490,  491,  492,  493,  494,
      496,  497,  499,  500,  501,  502,  503,  504,  505,  506,
      507,  509,  510,  512,  513,  515,  517,  518,  521,  524,
      527,  529,  530,  530,  530,  530,  530,  530,  530,  530,
      530,  530,  530,  530,  530,  530,  530,  530,  530,  530,
      530,  530,  530,  530,  530,  531,  531,  532,  534,  536,
      537,  537,  539,  539,  540,  541,  542,  543,  544,  545,

      545,  545,  545,  545,  545,  545,  545,  545,  545,  546,
      548,  548,  548,  550,  550,  550,  551,  551,  551,  553,
      554,  555,  557,  557,  557,  557,  557,  557,  557,  558,
      559,  560,  561,  562,  563,  563,  563,  565,  567,  568,
      570,  571,  573,  574,  575,  576,  577,  578,  579,  581,
      583,  585,  586,  587,  589,  591,  594,  594,  596,  596,
      597,  597,  598,  598,  599,  599,  600,  600,  601,  601,
      602,  602,  602,  602,  602,  602,  602,  602,  603,  603,
      603,  603,  603,  603,  603,  603,  604,  605,  605,  605,
      605,  607,  608,  608,  608,  608,  608,  608,  608,  609,

      610,  612,  613,  614,  614,  614,  614,  614,  614,  615,
      615,  615,  615,  615,  615,  616,  616,  618,  618,  619,
      620,  621,  623,  623,  623,  624,  626,  627,  629,  630,
      632,  633,  635,  635,  635,  637,  639,  640,  641,  642,
      644,  645,  646,  647,  648,  650,  652,  652,  652,  653,
      653,  653,  653,  653,  653,  654,  654,  654,  654,  654,
      654,  654,  655,  655,  656,  656,  657,  657,  657,  657,
      657,  657,  657,  657,  658,  659,  660,  662,  663,  664,
      664,  664,  664,  664,  664,  665,  665,  665,  665,  665,
      665,  665,  665,  665,  666,  667,  669,  670,  671,  672,

      674,  675,  676,  678,  678,  678,  678,  678,  678,  678,
      678,  678,  678,  679,  679,  680,  680,  680,  680,  680,
      680,  680,  680,  680,  680,  680,  681,  682,  683,  683,
      683,  683,  683,  683,  684,  684,  685,  685,  685,  685,
      685,  685,  687,  688,  689,  690,  690,  690,  691,  691,
      691,  691,  692,  692,  692,  692,  692,  692,  692,  692,
      692,  692,  693,  694,  696,  696,  697,  697,  697,  698,
      698,  698,  698,  698,  698,  699,  700,  701,  703,  703,
      703,  703,  703,  703,  703,  703,  704,  704,  704,  704,
      705,  706,  706,  706,  706,  706,  706,  706,  706,  707,

      708,  709,  710,  710,  710,  710,  710,  710,  710,  710,
      710,  710,  710,  711,  711,  711,  711,  711,  711,  711,
      712,  713,  713,  713,  713,  713,  713,  713,  713,  713,
      713,  714,  715,  716,  717,  717,  717,  717,  717,  717,
      717,  717,  717,  717,  717,  717,  717,  717,  717,  717,
      717,  717,  717,  719,  719,  719,  719,  719,  719,  719,
      719,  719,  719,  719,  719,  720,  721,  723,  723,  724,
      724,  724,  725,  726,  726,  726,  726,  726,  726,  726,
      727,  728,  728,  728,  729,  729,  730,  730,  730,  732,
      732,  734,  734,  735,  736,  736,  736,  736,  736,  736,

      737,  737,  737,  737,  737,  737,  737,  738,  738,  738,
      738,  738,  738,  738,  739,  739,  739,  739,  739,  739,
      739,  739,  739,  739,  739,  739,  739,  739,  739,  739,
      739,  740,  741,  741
    } ;

static const int yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    4,    1,    5,    6,    1,    7,    1,    8,    9,
       10,   11,   12,    1,   13,   14,   15,   16,   17,   18,
       19,   19,   19,   19,   19,   19,   20,   21,   22,    1,
       23,    1,    1,    1,   24,   25,   26,   27,   28,   29,
       30,   31,   32,   33,   34,   35,   36,   37,   38,   39,
       40,   41,   42,   43,   44,   33,   45,   46,   47,   33,
       48,    1,   49,    1,   50,    1,   51,   52,   53,   54,

       55,   56,   57,   58,   59,   33,   60,   61,   62,   63,
       64,   65,   40,   66,   67,   68,   69,   33,   70,   46,
       47,   33,   71,    1,   72,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static const int yy_meta[73] =
    {   0,
        1,    2,    3,    2,    1,    1,    1,    4,    5,    6,
        1,    1,    7,    2,    1,    4,    4,    4,    4,    4,
        8,    1,    1,    4,    9,    4,    4,    4,    4,    4,
        4,    4,    4,    9,    4,    4,    9,    4,    9,    9,
        9,    4,    4,    4,    4,    7,    4,    1,    1,    1,
       10,   10,   10,   10,   10,   10,   10,   10,    4,    9,
        4,    4,    9,    4,    9,    9,    4,    4,    4,    4,
        1,    1
    } ;

static const short int yy_base[984] =
    {   0,
        0,   72, 3524, 3525,    0,  136, 3519,  134,  144,  164,
      233, 3519,  296,  118,  109,  124,  208,  162,  201,  225,
      240,  195,  261,  357,  417,  463,  266,  275,  117,  202,
      208,  106,  242,  318, 3517,  143,  373,  520,  370,  238,
      587,  324,  335,  376,  383,  390,  387,  641,  388,  388,
      429,  692,  738,  271,  399,  251,  347,  390,  204,  478,
      594,    0, 3511,  313,  476,  237, 3525, 3507,  297,  323,
     3501, 3501, 3499,  418,  613, 3499,  328,    0, 3498,    0,
     3510, 3525,  773,  449,  616,  831,  624, 3488,  440, 3460,
     3482, 3454, 3484, 3456, 3462, 3436, 3461, 3435, 3464, 3463,

      460, 3458,  551, 3475, 3447,  866, 3465, 3437, 3446,  936,
      406, 1008, 3525,  632, 1072,  663,  671,  471, 1130,  679,
     1184,  709,  717, 1234,  493,  575, 3430, 3429,  301, 3420,
      634, 3487, 3486,  505, 3486,  615,  791,  245,  805, 1299,
      527,  588,  458,  802, 1358,  812,  639,  602,  731,  777,
      732,  683,  780,  733,  809,  795,  811,  812,  853,  828,
      820,  854,  872,  873,  819,  895,  910, 1408,  920,  948,
      891, 1467, 1012, 1521,  984, 1050, 1571,  640,  971, 1013,
     1023,  922,  457,  522,  589, 3478,  615, 1124, 1141, 3477,
     3414, 3525, 3481, 3480, 3479, 3469, 3477, 3476,    0, 3525,

     3475, 3474, 3473, 3472, 3471,  893,  441,  565,  597,  474,
      750,  820, 1014,  684,  963, 1030, 1121,  978, 1030, 3448,
     1625, 3420, 3446, 3418, 3425, 3399, 1046, 3440, 3412, 3453,
        0, 3433, 3405, 3428, 3401,  716,  740,  862,  868,  905,
     1051, 3418, 3392,  773, 1117,  398, 1683, 1181, 1161, 1209,
     1225, 1333, 3449, 1036, 1146, 1747, 1415, 1268, 1335, 3448,
     1805, 1337, 1442, 1042, 1170, 1073, 1166, 1480, 1190, 3444,
     3525, 1309, 1100, 3452,  105, 3452,  408, 1202, 1024,  962,
      661, 1191,  777,  949, 3450, 1097, 1237, 1204, 1498, 1277,
     1270, 1208, 1859, 1173, 1322, 1314, 1302, 1067, 1415, 1283,

     1414, 1324,    0, 1376, 1211, 1397, 1418, 1399, 1006, 1910,
     1506, 1562, 1436, 1494, 1518, 1974, 1584, 1462, 1505, 1687,
     1600, 1583, 1622, 2038, 1551, 1710, 1651, 1574, 1365, 3525,
     1015, 1122, 3443, 3525, 1693, 3442, 3441, 3378, 3377, 3431,
     3430, 3429, 3429,  637, 3428,  399, 3427,  920, 1653, 1365,
     3400, 3374, 3399, 3373,  758, 3395, 3369, 3407, 3379, 3392,
     3366, 1183,    0, 1585, 1566,    0, 3525, 3398, 1614, 1738,
     1646, 3371, 3396, 3369, 1443, 1246, 1369,    0, 3390, 3397,
     3369, 3397, 3369, 3381, 3355, 3380, 3354, 1161, 3376, 3350,
     3375, 3349, 1340, 3387, 3359,  885, 1049,  871, 1697, 3408,

     3402, 1697, 3525, 1792, 1811, 3401, 1734, 1829, 3400, 3525,
     1703, 1897, 1916, 1961, 1708, 3345, 1870, 3404, 1748, 1764,
     3356, 3342, 1726, 1589, 1143, 1822, 1377, 1228, 1422, 1764,
     1508, 3402, 1510, 1791, 1846, 1790, 1818, 1715, 1819, 1798,
     1938, 1517, 1886, 1835, 1839, 1621, 1578, 1854, 1795, 1926,
     1980, 1982, 2051, 2056,  323, 1944, 1991, 2043, 2102, 2093,
     2130, 1900, 1923, 3394, 1159, 3393, 3330, 3391, 3328, 3389,
     3326, 3380, 1577, 3368, 3340, 3365, 3337, 2085, 3364, 3336,
     3362, 3334, 3356, 3328, 1817, 2011, 3525, 3382, 2132, 1389,
     2137, 3381, 1419, 3356, 3328, 3345, 3318, 3344, 3317, 3350,

     3322, 3347, 3319, 2107, 3346, 3318, 3340, 3312, 1881, 3366,
     1235, 2083, 3525, 3364, 2177, 2167, 2169, 2176, 3358, 3357,
     3525, 2206, 1645, 3349, 1959, 3349, 3302, 3296, 3359, 2047,
     1537, 1686, 1538, 1906, 1287,  709, 3358, 1967, 2219, 2225,
     1919, 2116, 2010, 2115, 1979, 2004, 2150, 2050, 2156, 2258,
     2204, 2238, 2271, 1750, 3357, 2291, 2059, 3525, 3349, 3348,
     3285, 3284, 3345, 3344, 3281, 3280, 3341, 3340, 3277, 3276,
     3332, 3328, 3304, 3278, 3315, 3287, 1279, 3337, 3298, 3272,
     3297, 3271, 3306, 3278, 2035, 3330, 2304, 2347, 2219, 2321,
     3323, 1458, 3322, 1677, 3284, 1750, 3302, 3274, 3286, 3260,

     2242, 3302, 3274, 3236, 3201, 3229, 3192, 1319, 3233, 3185,
     3110, 3137, 3100, 2255, 3143, 2394, 3525, 2303, 3525, 3127,
     3525, 3123, 3048, 3036, 1873, 2032, 1964, 2091, 2067, 2079,
     2095, 2179,  390, 1133, 2428, 2247, 2203, 2294, 2268, 2347,
     2175, 2312, 2375, 2437, 2097, 3030, 2335, 3019, 2914, 2874,
     2848, 2883, 2855, 1507, 3525, 2855, 2820, 2849, 2787, 2832,
     1804, 2830, 1832, 3525, 2829, 2826, 2793, 2767, 2828, 2792,
     2765, 2787, 2761, 2785, 2759, 1979,    0, 2782, 2756, 2780,
     2754, 2787, 2759, 1894, 3525, 2780, 2753, 2805, 2160, 2810,
     2745, 1265,  461, 2446, 2467, 2190, 2318, 2332, 2398, 2197,

     2343, 2358, 2809, 2356, 2792, 1557, 2767, 2741, 2764, 2737,
     2255, 2799, 2392, 2791, 2790, 2792, 2753, 2727, 2765, 2737,
     2455, 2761, 2733, 2745, 2719, 2533, 2757, 2729, 2741, 2714,
     2737, 2701, 2328, 2460, 2757, 2755, 2758, 2691, 2687, 1431,
     1304, 2741, 2605, 2369, 2232, 2391, 2737, 2469, 2736, 2295,
     2368, 3525, 1996, 2713, 2685, 2709, 2673, 2677, 2651, 2424,
     2427, 2677, 2442,    0, 2713, 2486, 2706, 2445, 3525, 2123,
     2642, 2616, 1399, 1642, 2749, 2492, 2466, 2265, 2507, 2481,
     2177, 2276, 2491, 2637, 2610, 2530, 2641, 2613, 2501, 2632,
     2605, 2548, 2282, 2514, 2595, 2585, 1188, 1927, 2564, 2572,

     2609, 2579, 2558, 2633, 2527, 2528, 2576, 2544, 2533, 2503,
     2481, 2422, 3525, 2454, 2412, 2400, 2374, 2532, 2546, 2405,
     2369, 2406, 2532, 2538, 2369, 2334, 2338, 2299, 1641, 2377,
     2595, 2633, 2224, 2194, 2575, 2302, 2165, 2081, 2090, 2053,
     2065, 1983, 1976, 1911, 1924, 1865, 1816, 1755, 1748, 1698,
     2594, 2602,    0, 2391, 1711, 1674, 1637, 1605, 1598, 1455,
     1488, 1417, 1450, 1619, 2636, 2639,    0, 2630, 3525, 1378,
     1328, 2438, 1337, 1278, 1156, 1071, 1028, 1056, 1022, 2544,
     3525, 1056, 1027,  994,  990, 3525,  896,  912, 3525, 2470,
     2655, 2631, 3525, 3525,  904,  879,  789,  705,  538, 3525,

      518,  365, 2126, 2637,  381,  307, 3525,  239, 2066, 2441,
     2669, 2513, 2611, 3525, 2574, 2657, 2658, 2701, 2702, 2703,
     2705, 2710, 2718, 2719, 2730, 2732, 2739, 2763, 2765, 2577,
      171, 3525, 3525, 2834, 2844, 2854, 2864, 2874, 2881, 2891,
     2901, 2910, 2920, 2930, 2940, 2950, 2960, 2970, 2980, 2990,
     3000, 3010, 3020, 3030, 3040, 3050, 3060, 3070, 3080, 3090,
     3094, 3104, 3114, 3124, 3134, 3144, 3154, 3164, 3174, 3184,
     3194, 3204, 3214, 3224, 3234, 3244, 3254, 3264, 3274, 3284,
     3294, 3304, 3314
    } ;

static const short int yy_def[984] =
    {   0,
      933,  933,  933,  933,  934,  935,  933,  933,  934,  933,
      934,  936,  934,  934,  934,  934,   13,  934,  934,  934,
       13,  934,  934,  937,  934,   13,   25,   25,   25,   25,
       25,   25,  934,  938,  933,  939,  939,  933,   38,  936,
      939,  939,  939,  939,   41,  939,  939,  939,   41,  939,
      939,  939,   41,   52,   52,   52,   52,   52,   52,  939,
      938,  934,  940,  941,  940,  933,  933,  933,  933,  934,
      933,  934,  933,  942,  942,  934,  933,   11,  933,  934,
      936,  933,  933,  934,  933,  934,  933,  934,   86,  934,
      934,  934,  934,  934,  934,  934,  934,  934,  934,  934,

      934,  934,   86,  934,  934,  933,  934,  934,  943,  937,
      943,  944,  933,  934,  934,  933,  934,  934,  934,  934,
      115,  933,  934,   86,   86,  934,  934,  934,  938,  945,
      938,  933,  946,  939,  947,  939,  939,  947,  939,   48,
      947,  939,  948,  939,  939,  947,  939,  145,  939,  939,
      939,  939,  939,  939,  939,  939,  939,  939,  939,  939,
      939,  145,  939,  939,  939,  939,  939,  145,  947,  939,
      939,  939,  939,  168,  947,  939,  145,  145,  939,  939,
      939,  938,  949,  950,  950,  951,  952,  949,  949,  953,
      954,  933,  933,  933,  933,  934,  934,  933,  934,  933,

      933,  933,  933,  934,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  934,  933,   86,  933,  934,  933,  934,
      934,  934,  934,  934,  934,  934,  934,  934,  934,  934,
      221,  934,  934,  934,  934,  933,  933,  933,  933,  933,
      933,  934,  934,  955,  956,  957,  958,  934,  933,  934,
      933,  933,  934,  934,  934,  933,  934,  933,  933,  934,
      934,  934,  933,  934,  934,  256,  261,  221,  934,  934,
      933,  938,  933,  946,  933,  947,  933,  939,  939,  939,
      947,  939,  947,  948,  946,  959,  939,  145,  947,  939,
      947,  939,  145,  939,  939,  939,  939,  939,  939,  939,

      939,  939,  293,  939,  939,  939,  939,  939,  939,  939,
      939,  947,  939,  939,  939,  947,  310,  939,  310,  939,
      947,  939,  939,  947,  310,  293,  939,  939,  938,  933,
      952,  952,  960,  933,  949,  953,  953,  954,  954,  933,
      933,  933,  934,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  934,  961,  933,  934,  933,  934,  221,  933,
      934,  934,  934,  934,  934,  933,  934,  934,  934,  934,
      934,  934,  934,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  934,  934,  955,  955,  957,  956,  962,

      933,  933,  933,  934,  933,  933,  933,  933,  934,  933,
      933,  934,  933,  934,  934,  934,  938,  933,  933,  933,
      933,  933,  963,  939,  947,  947,  959,  959,  939,  947,
      939,  947,  939,  293,  947,  939,  939,  939,  939,  939,
      939,  939,  939,  939,  939,  939,  939,  939,  939,  947,
      310,  947,  947,  947,  947,  939,  947,  310,  947,  310,
      939,  939,  938,  960,  949,  964,  965,  966,  967,  968,
      969,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  934,  934,  934,
      933,  934,  933,  934,  934,  934,  934,  934,  934,  933,

      933,  933,  933,  933,  933,  933,  933,  933,  933,  934,
      955,  956,  933,  962,  933,  933,  933,  933,  934,  933,
      933,  933,  938,  933,  933,  933,  933,  933,  963,  963,
      970,  971,  972,  973,  959,  959,  947,  939,  947,  310,
      939,  939,  939,  939,  939,  939,  939,  939,  939,  947,
      939,  947,  947,  947,  947,  947,  938,  933,  964,  964,
      965,  965,  966,  966,  967,  967,  968,  968,  969,  969,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      934,  934,  974,  933,  933,  933,  933,  933,  934,  934,

      934,  934,  934,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  970,  970,  971,  971,  972,  972,
      973,  973,  959,  959,  947,  939,  939,  939,  939,  939,
      939,  939,  947,  947,  947,  947,  938,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  975,
      933,  933,  933,  933,  974,  974,  933,  933,  933,  933,
      933,  933,  933,  934,  934,  934,  934,  934,  934,  933,
      933,  933,  933,  933,  933,  933,  933,  976,  933,  933,
      933,  959,  959,  947,  947,  947,  939,  939,  939,  939,

      939,  939,  947,  938,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  975,  975,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  977,  934,  934,  933,  933,
      933,  933,  933,  933,  976,  976,  933,  933,  933,  959,
      959,  947,  978,  939,  939,  938,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  979,
      979,  977,  762,  934,  933,  933,  933,  933,  933,  933,
      933,  933,  959,  959,  978,  980,  775,  939,  938,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  979,  762,
      762,  933,  933,  933,  933,  933,  959,  959,  980,  980,

      775,  775,  938,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  979,  979,  762,
      762,  933,  933,  933,  933,  933,  933,  933,  959,  959,
      980,  980,  775,  775,  938,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      979,  979,  762,  933,  933,  933,  933,  933,  933,  933,
      981,  933,  982,  959,  980,  980,  775,  938,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  979,
      933,  933,  933,  933,  981,  933,  933,  982,  933,  959,
      980,  938,  933,  933,  933,  933,  933,  933,  933,  933,

      933,  933,  959,  938,  933,  933,  933,  933,  959,  938,
      933,  983,  933,  933,  983,  983,  983,  983,  983,  983,
      983,  983,  983,  983,  983,  983,  983,  983,  983,  983,
      933,  933,    0,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933
    } ;

static const short int yy_nxt[3598] =
    {   0,
        4,    4,    4,    4,    4,    4,    4,    5,    6,    4,
        7,    8,    5,    4,    4,    9,   10,   11,   11,   11,
        4,   12,    4,    5,   13,   14,   15,    5,    5,   16,
        5,    5,    5,   17,    5,   18,   17,   19,   20,   17,
       21,   22,    5,    5,   23,    5,    5,   24,    4,    4,
       25,   26,   27,   28,   29,   30,   31,   32,    5,   17,
        5,   18,   17,   33,   20,   21,   22,    5,    5,   23,
       34,    4,    4,    4,    4,    4,    4,   35,   35,    5,
        6,    4,    7,    8,   36,    4,    4,   37,   38,   39,
       39,   39,    4,   40,    4,   36,   41,   42,   43,   36,

       36,   44,   36,   36,   36,   45,   36,   46,   45,   47,
       48,   45,   49,   50,   36,   36,   51,   36,   36,   24,
        4,    4,   52,   53,   54,   55,   56,   57,   58,   59,
       36,   45,   36,   46,   45,   60,   48,   49,   50,   36,
       36,   51,   61,    4,   64,   67,   68,   69,   91,   93,
       62,   65,   65,   65,   65,   65,   70,  118,   71,   72,
       95,  421,  119,  135,   73,   74,   74,   75,  118,  422,
      119,   62,  119,  932,   94,   92,   76,   74,   77,   78,
       78,   78,   78,   78,   79,   97,   96,   62,   80,   62,
       62,   62,   62,   62,   62,   62,   62,   80,   62,   62,

       80,   62,   80,   80,   80,   62,   62,   62,   62,   62,
       62,  933,   98,   99,   80,   80,   80,   80,   80,   80,
       80,   80,   62,   80,   62,   62,   80,   62,   80,   80,
       62,   62,   62,   62,   74,   74,   74,  104,  100,   85,
       82,  143,   62,  933,   95,  190,   74,  277,   78,   78,
       78,   78,   78,  118,  127,  171,  119,   80,  119,  118,
      172,  281,  105,  119,  106,  119,   80,  102,   62,   80,
       96,   80,   80,   80,   62,  101,  101,  101,  101,  101,
      101,  101,  101,   80,   80,   80,   80,   80,   80,   80,
       80,  107,   80,  861,  103,   80,   91,   80,   80,   83,

       62,  150,  171,  130,  172,  128,  172,  191,   84,  193,
       85,  194,   86,   86,   86,   93,   87,  195,  108,  119,
      130,  186,  187,  126,  172,  277,  118,  119,  179,  119,
       88,   62,  555,  131,  131,  131,  131,  131,  196,  197,
       94,   84,   62,  205,  135,  206,   89,   89,   89,   89,
       89,   89,   89,   89,  150,  135,   90,  109,  110,  110,
      110,  109,  109,  109,  109,  109,  109,  109,  109,  111,
      109,  109,  132,   74,  911,  152,   69,  109,  109,  109,
       62,  151,  134,   62,  933,  136,  933,   71,  137,  132,
      135,  933,   82,  138,   62,   62,  135,   62,  171,  158,

      153,  172,  399,  172,  109,  113,  109,  135,  135,  423,
      135,  423,  154,  156,  205,  161,  206,  134,  244,   74,
       74,   74,  134,  911,  159,  908,  154,  109,  109,  114,
      163,   74,  106,  115,  115,  115,   62,  116,  155,  152,
      157,  171,  162,  134,  692,  172,  400,  172,  134,  135,
      171,  172,  155,  172,  113,  164,  221,  221,  221,  165,
      285,  286,  117,   82,  153,  184,  330,  118,  119,  118,
      118,  118,  118,  118,  118,  120,  231,  231,  231,  121,
      121,  121,  351,  122,  184,   62,  166,  257,  257,  257,
      180,  188,  188,  188,  188,  188,  189,  356,  135,  214,

      214,  214,  214,  214,  214,  214,  214,  352,  123,  268,
      268,  268,   62,  124,  125,  124,  125,  125,  125,  125,
      125,   74,   74,   75,  357,  135,  688,   62,  741,  277,
      186,  331,  139,   74,   77,  140,  140,  140,  140,  140,
      141,  181,  283,  134,  142,  134,  134,  134,  134,  134,
      134,  134,  134,  142,  134,  134,  142,  134,  142,  142,
      142,  134,  134,  134,  134,  134,  134,  221,  221,  221,
      142,  142,  142,  142,  142,  142,  142,  142,  134,  142,
      134,  134,  142,  134,  142,  142,  134,  134,  134,  134,
       83,  257,  257,  257,   62,   62,  130,  186,  331,  144,

      907,   85,  353,  145,  145,  145,  182,  146,  135,  131,
      131,  131,  131,  131,   74,   74,   74,  233,  293,  293,
      293,  147,   62,  333,  334,  201,   74,  202,  354,  224,
      278,  279,  144,  203,  355,  135,  130,  148,  148,  148,
      148,  148,  148,  148,  148,  466,   62,  149,   62,  131,
      131,  131,  131,  131,  272,   85,  326,  326,  326,  135,
      355,  135,  292,  277,  425,  132,  215,  215,  215,  215,
      215,  215,  215,  215,  219,  219,  219,  219,  219,  219,
      219,  219,  248,  248,  248,  248,  248,  248,  248,  248,
       62,  160,  160,  160,  160,  160,  160,  160,  160,   62,

      363,  363,  363,  135,  167,  132,  297,  467,  168,  168,
      168,   82,  169,  256,  256,  256,  256,  256,  256,  256,
      256,  119,  119,  119,  119,  119,  119,  119,  119,  261,
      261,  261,  261,  261,  261,  261,  261,  170,   62,   62,
       62,  907,  171,  172,  171,  171,  171,  171,  171,  171,
      173,  135,  135,  135,  174,  174,  174,  384,  175,  266,
      266,  266,  266,  266,  266,  266,  266,  267,  267,  267,
      267,  267,  267,  267,  267,  634,  299,  386,  358,  277,
      426,  294,  385,  176,   62,  397,  296,   62,  177,  178,
      177,  178,  178,  178,  178,  178,  207,  135,   62,  478,

      135,  208,   62,  387,  295,  359,  280,  209,  210,   62,
      211,  135,   62,  212,  277,  135,   62,  213,   62,   62,
      282,  113,  135,  207,  478,  135,   62,   62,  208,  135,
      298,  135,  135,  209,  210,   62,  211,  300,  212,  135,
      135,  906,  213,  216,  303,  303,  303,  360,  135,  302,
      308,  217,  287,  287,  287,  287,  287,  287,  287,  287,
       62,  304,  291,  291,  291,  291,  291,  291,  291,  291,
      293,  293,  293,  135,  361,  399,  216,  299,  301,   62,
       62,  218,  218,  218,  218,  218,  218,  218,  218,  236,
      280,  389,  135,  135,  237,  306,  349,  397,   62,  388,

      238,  239,   62,  211,  905,  350,  240,  317,  317,  317,
      241,  135,  660,  350,  889,  135,  236,   62,  390,  400,
      305,  237,  277,  307,  130,  388,  238,  239,  468,  211,
      135,  240,  391,  113,  329,  241,  109,  110,  110,  110,
      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
      109,  285,  286,  309,  902,   62,  109,  109,  109,  392,
      310,  310,  310,  310,  310,  310,  310,  310,  135,   62,
      316,  316,  316,  316,  316,  316,  316,  316,   62,  364,
      364,  364,  135,  109,  113,  109,  277,  317,  317,  317,
      469,  135,  886,  132,  366,  366,  366,  901,  172,  172,

      172,  172,  172,  172,  172,  172,  109,  109,  109,  245,
      245,  245,  246,   62,  109,  109,  109,  109,  109,   62,
       62,  109,  109,  333,  334,  296,  135,  344,  109,  109,
       62,   62,  135,  135,  324,  324,  324,  324,  324,  324,
      324,  324,   62,  135,  135,  362,  367,  367,  367,  376,
      933,  362,  404,  404,  404,  109,  113,   62,  412,  412,
      412,  511,  319,  319,  319,  319,  319,  319,  319,  319,
      135,  377,  362,  449,   62,   62,  328,  362,  109,  109,
      249,  900,  393,  900,  250,  899,  280,  135,  393,  413,
      413,  413,  251,  898,  252,  813,  253,  113,  377,   82,

      325,  325,  325,  325,  325,  325,  325,  325,  253,  393,
      418,  253,  253,  813,  393,  419,  420,  250,  245,  245,
      245,  246,  254,  255,  254,  254,  254,  254,  254,  254,
      933,  334,  184,  330,  253,   82,  440,  253,  258,  188,
      188,  188,  188,  188,  189,  277,  257,  257,  257,  184,
      330,  531,  259,  427,  260,  403,  335,  335,  335,  335,
      335,  428,  404,  404,  404,  113,  260,  184,  558,  260,
      260,  365,  365,  365,  365,  365,  365,  365,  365,  403,
       62,  260,  414,  414,  414,  401,  412,  412,  412,  258,
       82,  693,  260,  135,  348,  260,  262,  401,   62,  410,

      401,  401,  504,  259,  263,  260,  366,  366,  366,   62,
      897,  135,  401,  532,  424,   62,  134,  260,   62,  485,
      260,  260,  135,  401,  135,  437,  401,  504,  135,  262,
       82,  135,  260,  433,  264,  265,  264,  264,  264,  264,
      264,  264,  258,  260,   62,  485,  260,  511,  829,  134,
      268,  268,  268,  429,  429,  429,  259,  135,  260,  254,
      254,  254,  254,  254,  254,  254,  254,   82,  740,  445,
      260,  493,  277,  260,  260,  402,  402,  402,  402,  402,
      402,  402,  402,  617,   62,  269,  432,  432,  432,   82,
       62,  536,  406,  431,  431,  431,  260,  135,  493,  260,

       74,   74,   74,  135,  406,  896,   82,  406,  406,   62,
      442,  130,   74,  933,  140,  140,  140,  140,  140,  406,
      578,   62,  135,  142,  417,  417,  417,  417,  417,   62,
      406,   62,  142,  406,  135,  142,  443,  142,  142,  142,
      895,  249,  135,  258,  135,  578,  440,  438,  633,  142,
      142,  142,  142,  142,  142,  142,  142,  401,  142,  406,
      609,  142,  774,  142,  142,   62,  439,  130,  472,  401,
      288,  406,  401,  401,  406,  406,  509,  463,  289,   82,
      132,  473,  893,   62,  401,  609,  406,  264,  264,  264,
      264,  264,  264,  264,  264,  401,  135,  406,  401,  494,

      406,   82,  509,  288,   62,  893,   62,  444,  290,  290,
      290,  290,  290,  290,  290,  290,  249,  135,  376,  135,
      311,   62,   62,  407,  592,   62,  495,  535,  312,   62,
      252,  446,  313,   82,  135,  135,  132,  408,  135,  409,
      441,  448,  135,   62,  313,  403,  491,  313,  313,  597,
      592,  409,  889,  311,  409,  409,  135,  797,  314,  315,
      314,  314,  314,  314,  314,  314,  409,  441,  442,   62,
      313,  410,  887,  313,   62,  258,  598,  409,  447,  492,
      409,   97,  135,  317,  317,  317,  773,  135,  407,  259,
      886,  318,  411,  411,  411,  411,  411,  411,  411,  411,

      277,   62,  408,  318,  409,  492,  318,  318,   98,  884,
      451,  451,  451,   62,  135,   62,  409,   62,  318,  409,
      409,  429,  429,  429,   62,   62,  135,  403,  135,  318,
      135,  415,  318,  320,  451,  451,  451,  135,  135,  277,
      277,  321,  409,  538,  711,  409,  626,  630,  430,  430,
      430,  430,  430,  430,  430,  430,  314,  314,  314,  314,
      314,  314,  314,  314,  277,  470,  320,  460,  460,  460,
      711,  322,  323,  322,  322,  322,  322,  322,  322,  258,
      571,   62,  487,  487,  487,   62,  462,  326,  326,  326,
       62,  572,  407,  259,  135,  318,   62,  370,  135,  458,

      458,  458,  277,  135,  280,  370,  408,  318,  456,  135,
      318,  318,  450,  450,  450,  450,  450,  450,  450,  450,
      456,   82,  327,  456,  456,  884,   62,  471,   62,   62,
      370,  403,  548,  318,  933,  456,  318,  369,  458,  458,
      458,  135,  135,   82,   82,  370,  456,  130,  547,  456,
      457,  457,  457,  457,  457,  457,  457,  457,   62,   62,
      410,  470,  489,  489,  489,  350,  883,  431,  431,  431,
      369,  135,  882,  350,  890,  371,  371,  371,  371,  371,
      371,  371,  371,  109,  245,  245,  245,  246,  277,  109,
      109,  109,  109,  109,   62,  863,  109,  109,  512,  512,

      512,  184,  330,  109,  109,  798,  667,  135,  465,  465,
      465,  465,  465,  516,  516,  516,  622,  521,  407,  522,
      522,  522,   62,  471,  489,  489,  489,  530,  277,  530,
      109,  113,  408,  668,  456,  135,  881,  322,  322,  322,
      322,  322,  322,  322,  322,  513,  456,  881,  541,  456,
      456,   69,  277,  109,  109,  258,  879,  628,  520,  646,
      524,  461,   71,  405,  405,  405,  277,  525,   73,  259,
      520,  406,  456,  520,  520,  456,  526,  670,   77,  878,
      537,  537,  537,  406,   79,  520,  406,  406,  486,  486,
      486,  486,  486,  486,  486,  486,  520,   62,  406,  520,

      517,  491,   62,  134,  671,   62,  540,  540,  540,  406,
      135,  135,  406,  258,  518,  135,  519,  877,  135,  407,
      585,  363,  363,  363,  277,   62,   62,  259,  519,  260,
      533,  519,  519,  408,  542,  520,  134,  407,  135,  135,
      716,  260,   62,  519,  260,  260,   62,  520,  277,  549,
      520,  520,  876,  520,  519,  135,  260,  519,  586,  135,
      542,   62,  520,  717,  545,  520,  716,  260,  520,  520,
      260,  434,  130,  520,  135,  277,  520,  538,  541,  435,
      520,  549,  626,  586,  614,  523,  523,  523,  523,  523,
      718,  520,  534,   62,  520,  546,  539,  539,  539,  539,

      539,  539,  539,  539,  434,  517,  135,   62,  277,  436,
      436,  436,  436,  436,  436,  436,  436,   62,  258,  518,
      135,  519,  615,  280,  407,  130,   62,  875,  277,   82,
      135,  733,  259,  519,  318,  557,  519,  519,  408,  135,
      520,  132,  550,  550,  550,   62,  318,  615,  519,  318,
      318,   62,  520,  521,  637,  520,  520,  733,  135,  519,
      874,  318,  519,  280,  135,  873,  277,  520,  543,  407,
      588,  201,  318,  202,   62,  318,  277,  632,  520,  203,
      637,  520,  452,  408,  277,  409,   62,  135,  517,  830,
      453,  453,  453,  277,  132,  544,  454,  409,  455,  135,

      409,  409,  518,  873,  551,  677,  455,  556,  556,  556,
      455,   62,  409,  455,  455,  640,  551,   62,  455,  551,
      551,  455,  455,  409,  135,  455,  409,  587,  587,  587,
      135,  551,  677,  455,  277,  628,  455,  638,  783,  455,
      277,  626,  551,  660,  455,  551,  452,  455,  530,  277,
      530,  517,  872,  277,  459,  459,  459,   62,  277,  552,
      454,  130,  455,  783,  452,  518,  640,  551,   82,  277,
      135,  647,  661,  553,  455,  554,  630,  455,  455,  551,
      455,  277,  551,  551,  512,  512,  512,  554,  630,  455,
      554,  554,  455,  277,  551,  455,  455,  277,  661,  277,

      455,  407,  554,  455,  277,  551,  703,  455,  551,  872,
      552,  642,  577,  554,  871,  408,  554,  456,  455,  491,
      863,  455,   62,   62,  553,  870,  554,  578,   82,  456,
      132,  513,  456,  456,  608,  135,  135,   62,  554,  521,
      589,  554,  554,  869,  456,  593,  540,  540,  540,  609,
      135,  577,  578,  554,  590,  456,  591,   62,  456,  616,
      594,  595,  628,   62,  554,  794,  632,  554,  591,  639,
      135,  591,  591,  608,  609,  517,  135,  596,  618,  618,
      618,  277,   62,  591,  517,  641,  909,  594,  595,  518,
      794,  620,  277,  620,  591,  135,  737,  591,  701,  742,

      620,  869,  596,  620,   62,  620,  620,  620,  620,  620,
       62,   62,  620,  621,  517,  620,  620,  135,  620,  806,
      620,  277,  737,  135,  135,  619,  156,  620,  518,  620,
      620,  620,  620,  589,  620,  635,  635,  635,  620,   62,
      277,  620,  620,  662,  806,  620,  620,  590,  867,  636,
      632,  867,  135,  157,   62,  662,  664,  620,  662,  662,
      277,  636,  554,  688,  636,  636,  643,  135,  620,  676,
      662,  620,   62,  277,  554,   62,  636,  554,  554,  552,
      644,  662,  645,  677,  662,  135,  778,  636,  135,  554,
      636,  749,  689,  277,  645,  554,  676,  645,  645,  643,

      554,   62,  862,  554,  618,  618,  618,  554,  677,  645,
      554,  554,  589,  644,  135,  645,  807,  749,  689,   62,
      645,  782,  554,  645,  824,   62,  590,  645,  662,  589,
      645,  645,  135,  554,  698,  697,  554,  130,  135,   62,
      662,  808,  645,  662,  662,  662,  805,  704,  782,  824,
       62,  619,  135,  645,   62,  662,  645,  662,  130,  743,
      662,  662,  702,  135,  767,   62,  662,  135,  746,  662,
      207,  805,  662,  663,  699,  208,   62,  277,  135,   82,
      864,  209,  210,  662,  211,  744,  662,  212,  700,  135,
      767,  213,  861,  130,  752,  860,  778,  207,  743,  645,

      663,  699,  208,  779,  859,   62,  132,  209,  210,  854,
      211,  645,  212,  700,  645,  645,  213,  236,  135,  751,
      663,  752,  237,  853,  700,  745,  645,  132,  238,  239,
      277,  211,  853,  752,  240,  823,  694,  645,  241,  277,
      645,  850,  849,  912,  236,  643,  751,  663,  277,  237,
      695,  700,  696,  789,  238,  239,  789,  211,  752,  240,
      823,  645,  132,  241,  696,  790,  848,  696,  696,  277,
      696,  769,   82,  645,  894,  694,  645,  645,  594,  696,
      789,  847,  696,  789,  846,  696,  696,  768,  645,  801,
      696,  696,  791,  696,  277,  596,  751,  696,  769,  645,

      894,  769,  645,  696,  804,  594,  696,  696,  696,  130,
      752,  696,  132,  768,  768,  916,  802,  845,  696,  803,
      596,  800,  809,  751,  818,  805,  769,  769,  903,  696,
      789,  804,  696,  761,  761,  752,  761,  761,  761,  761,
      768,  761,  761,  761,  761,  825,  761,  761,  800,  810,
      805,  819,  769,  761,  761,  761,  813,  789,  837,  839,
      130,  789,  763,  855,  844,  814,  277,  851,  843,  857,
      835,  822,  826,  789,  277,  789,  916,  130,  132,  916,
      761,  761,  761,  813,  271,  838,  840,  868,  789,  763,
      856,  815,  823,  800,  842,  831,  858,  277,  822,  841,

      789,  800,  789,  761,  761,  761,  761,  852,  761,  761,
      761,  761,  762,  761,  761,  761,  761,  823,  761,  761,
      800,  880,  832,  789,  800,  776,  761,  761,  800,  132,
      865,  789,  130,  130,  777,  277,  836,  914,  277,  130,
      834,  277,  892,  904,  833,  271,  132,  828,  931,  910,
      789,  800,  761,  761,  761,  827,  880,  277,  789,  916,
      916,  777,  800,  891,  914,  800,  821,  820,  800,  917,
      918,  817,  816,  812,  811,  761,  761,  761,  761,  796,
      761,  761,  761,  761,  800,  761,  761,  761,  761,  800,
      761,  761,  800,  891,  866,  800,  913,  761,  761,  761,

      795,  132,  132,  916,  916,  916,  763,  916,  132,  793,
      914,  800,  916,  919,  920,  921,  792,  922,  788,  787,
      916,  916,  923,  913,  761,  761,  761,  786,  271,  271,
      924,  925,  916,  763,  916,  914,  786,  785,  784,  781,
      780,  916,  926,  277,  927,  772,  771,  761,  761,  761,
      761,  928,  761,  761,  761,  761,  762,  761,  761,  761,
      761,  770,  761,  761,  736,  916,  736,  916,  766,  776,
      761,  761,  271,  271,  271,  929,  271,  930,  777,  766,
      765,  271,  765,  764,  764,  760,  760,  759,  758,  271,
      271,  757,  756,  755,  754,  753,  761,  761,  761,  715,

      715,  271,  750,  271,  748,  777,  748,  747,  747,  649,
      271,  277,  739,  738,  736,  734,  734,  732,  731,  761,
      761,  730,  729,  728,  727,  726,  726,  725,  724,  723,
      722,  721,  720,  719,  271,  666,  271,   62,  666,  664,
       62,  715,   62,   62,   63,   63,   63,   63,   63,  713,
       63,   63,   63,   63,   81,   81,   81,   81,   81,   81,
       81,   81,   81,   81,  112,  112,  112,  112,  112,  112,
      112,  112,  112,  112,  129,  129,  129,  129,  129,  129,
      129,  129,  129,  129,  134,  713,  712,  134,  134,  134,
      134,  183,  183,  183,  183,  183,  712,  183,  183,  183,

      183,  185,  185,  185,  185,  185,  185,  185,  185,  185,
      185,  200,  200,  710,  709,  708,  707,  706,  200,  200,
      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
      130,  130,  130,  130,  130,  130,  130,  130,  130,  130,
      274,  274,  274,  274,  274,  274,  274,  274,  274,  274,
      276,  276,  276,  276,  276,  276,  276,  276,  276,  276,
      284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
      183,  183,  183,  183,  183,  183,  183,  183,  183,  183,
      185,  185,  185,  185,  185,  185,  185,  185,  185,  185,

      186,  186,  186,  186,  186,  186,  186,  186,  186,  186,
      332,  332,  332,  332,  332,  332,  332,  332,  332,  332,
      336,  336,  705,  336,  336,  336,  336,  336,  336,  336,
      338,  338,  277,  338,  338,  338,  338,  338,  338,  338,
      396,  396,  396,  396,  396,  396,  396,  396,  396,  396,
      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
      398,  398,  398,  398,  398,  398,  398,  398,  398,  398,
      247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
      464,  464,  464,  464,  691,  464,  464,  464,  464,  464,

      486,  486,  690,  486,  514,  514,  514,  514,  514,  514,
      514,  514,  514,  514,  529,  529,  529,  529,  529,  529,
      529,  529,  529,  529,  559,  559,  273,  559,  559,  559,
      559,  559,  559,  559,  561,  561,  621,  561,  561,  561,
      561,  561,  561,  561,  563,  563,  614,  563,  563,  563,
      563,  563,  563,  563,  565,  565,  687,  565,  565,  565,
      565,  565,  565,  565,  567,  567,  686,  567,  567,  567,
      567,  567,  567,  567,  569,  569,  685,  569,  569,  569,
      569,  569,  569,  569,  625,  625,  625,  625,  625,  625,
      625,  625,  625,  625,  627,  627,  627,  627,  627,  627,

      627,  627,  627,  627,  629,  629,  629,  629,  629,  629,
      629,  629,  629,  629,  631,  631,  631,  631,  631,  631,
      631,  631,  631,  631,  665,  665,  685,  665,  665,  665,
      665,  665,  665,  665,  714,  714,  684,  714,  714,  714,
      714,  714,  714,  714,  735,  735,  683,  735,  735,  735,
      735,  735,  735,  735,  762,  762,  682,  762,  762,  762,
      762,  762,  762,  762,  775,  775,  681,  775,  775,  775,
      775,  775,  775,  775,  761,  761,  680,  761,  761,  761,
      761,  761,  761,  761,  799,  799,  799,  799,  799,  799,
      799,  799,  799,  799,  885,  885,  885,  885,  885,  885,

      885,  885,  885,  885,  888,  888,  888,  888,  888,  888,
      888,  888,  888,  888,  915,  915,  915,  915,  915,  915,
      915,  915,  915,  915,  679,  678,  675,  674,  673,  672,
      669,  666,  664,  585,  659,  658,  657,  656,  655,  655,
      654,  653,  652,  651,  650,  649,  648,  570,  570,  568,
      568,  566,  566,  564,  564,  562,  562,  560,  560,  277,
      277,  277,  624,  623,  205,  198,  521,  621,  515,  616,
      613,  612,  611,  610,  607,  606,  605,  604,  603,  602,
      601,  601,  600,  599,  491,  588,  584,  583,  582,  581,
      580,  579,  576,  575,  574,  573,  473,  570,  568,  566,

      564,  562,  560,  187,  277,  528,  527,   66,  199,  521,
      410,  403,  515,  510,  510,  508,  507,  506,  505,  503,
      502,  501,  500,  499,  498,  497,  496,  199,  490,  490,
      488,  488,  484,  483,  482,  481,  480,  479,  477,  476,
      475,  474,  205,  205,  199,  198,  198,  198,  339,  339,
      337,  337,  187,  275,  277,  275,  416,  410,  403,  395,
      394,  383,  382,  381,  380,  379,  378,  378,  375,  375,
      374,  373,  372,  368,  348,  348,  347,  346,  345,  344,
      344,  343,  342,  341,  340,  339,  337,  330,  277,  275,
      273,  271,  199,  270,  113,  243,  242,  235,  234,  232,

      199,  230,  229,  228,  227,  227,  226,  225,  224,  223,
      222,  220,   82,  205,  204,  198,  199,  198,  192,  184,
      133,   82,   66,  933,    3,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933

    } ;

static const short int yy_chk[3598] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,

        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    6,    8,    8,    9,   14,   15,
       36,    6,    6,    6,    6,    6,    9,   32,    9,    9,
       16,  275,   32,   36,    9,   10,   10,   10,   29,  275,
       29,   10,   29,  931,   15,   14,   10,   10,   10,   10,
       10,   10,   10,   10,   10,   18,   16,   10,   10,   10,
       10,   10,   10,   10,   10,   10,   10,   10,   10,   10,

       10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
       10,   17,   18,   19,   10,   10,   10,   10,   10,   10,
       10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
       10,   10,   10,   10,   11,   11,   11,   22,   19,   20,
       40,   40,   17,   21,   31,   66,   11,  138,   11,   11,
       11,   11,   11,   30,   33,   59,   30,   11,   30,   31,
       59,  138,   22,   31,   23,   31,   11,   21,   17,   11,
       31,   11,   11,   11,   21,   20,   20,   20,   20,   20,
       20,   20,   20,   11,   11,   11,   11,   11,   11,   11,
       11,   23,   11,  908,   21,   11,   27,   11,   11,   13,

       21,   54,   56,  129,   56,   33,   56,   66,   13,   69,
       13,   69,   13,   13,   13,   28,   13,   69,   23,   27,
       34,   64,   64,   27,   54,  455,   28,   28,   54,   28,
       13,   42,  455,   34,   34,   34,   34,   34,   70,   70,
       28,   13,   43,   77,   42,   77,   13,   13,   13,   13,
       13,   13,   13,   13,   42,   43,   13,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
       24,   24,  129,   39,  906,   43,   37,   24,   24,   24,
       37,   42,   39,   44,   39,   37,   45,   37,   37,   34,
       39,   49,  633,   37,   47,   50,   44,   46,   57,   47,

       43,   57,  246,   57,   24,   24,   24,   47,   50,  277,
       46,  277,   44,   46,  346,   49,  346,   45,  111,   74,
       74,   74,   49,  905,   47,  902,   58,   24,   24,   25,
       50,   74,   51,   25,   25,   25,   51,   25,   44,   55,
       46,   58,   49,   45,  633,   58,  246,   58,   49,   51,
       55,   55,   58,   55,  111,   50,   89,   89,   89,   51,
      143,  143,   25,  693,   55,  183,  183,   25,   25,   25,
       25,   25,   25,   25,   25,   26,  101,  101,  101,   26,
       26,   26,  207,   26,   65,   60,   51,  118,  118,  118,
       60,   65,   65,   65,   65,   65,   65,  210,   60,   84,

       84,   84,   84,   84,   84,   84,   84,  207,   26,  125,
      125,  125,  134,   26,   26,   26,   26,   26,   26,   26,
       26,   38,   38,   38,  210,  134,  901,   38,  693,  141,
      184,  184,   38,   38,   38,   38,   38,   38,   38,   38,
       38,   60,  141,   38,   38,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,  103,  103,  103,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
       38,   38,   38,   38,   38,   38,   38,   38,   38,   38,
       41,  126,  126,  126,   41,  142,   61,  185,  185,   41,

      899,   41,  208,   41,   41,   41,   61,   41,  142,   61,
       61,   61,   61,   61,   75,   75,   75,  103,  148,  148,
      148,   41,  136,  187,  187,   75,   75,   75,  208,  126,
      136,  136,   41,   75,  209,  136,  131,   41,   41,   41,
       41,   41,   41,   41,   41,  344,  147,   41,   48,  131,
      131,  131,  131,  131,  131,   48,  178,  178,  178,  147,
      209,   48,  147,  281,  281,   61,   85,   85,   85,   85,
       85,   85,   85,   85,   87,   87,   87,   87,   87,   87,
       87,   87,  114,  114,  114,  114,  114,  114,  114,  114,
      152,   48,   48,   48,   48,   48,   48,   48,   48,   52,

      214,  214,  214,  152,   52,  131,  152,  344,   52,   52,
       52,  536,   52,  116,  116,  116,  116,  116,  116,  116,
      116,  117,  117,  117,  117,  117,  117,  117,  117,  120,
      120,  120,  120,  120,  120,  120,  120,   52,  149,  151,
      154,  898,   52,   52,   52,   52,   52,   52,   52,   52,
       53,  149,  151,  154,   53,   53,   53,  236,   53,  122,
      122,  122,  122,  122,  122,  122,  122,  123,  123,  123,
      123,  123,  123,  123,  123,  536,  154,  237,  211,  283,
      283,  149,  236,   53,  150,  244,  151,  153,   53,   53,
       53,   53,   53,   53,   53,   53,   83,  150,  137,  355,

      153,   83,  156,  237,  150,  211,  137,   83,   83,  144,
       83,  137,  139,   83,  146,  156,  155,   83,  157,  158,
      139,  244,  144,   83,  355,  139,  165,  161,   83,  155,
      153,  157,  158,   83,   83,  160,   83,  156,   83,  165,
      161,  897,   83,   86,  160,  160,  160,  212,  160,  158,
      165,   86,  144,  144,  144,  144,  144,  144,  144,  144,
      159,  161,  146,  146,  146,  146,  146,  146,  146,  146,
      162,  162,  162,  159,  212,  398,   86,  155,  157,  163,
      164,   86,   86,   86,   86,   86,   86,   86,   86,  106,
      159,  239,  163,  164,  106,  163,  206,  396,  171,  238,

      106,  106,  166,  106,  896,  206,  106,  171,  171,  171,
      106,  171,  895,  206,  888,  166,  106,  167,  239,  398,
      162,  106,  169,  164,  182,  238,  106,  106,  348,  106,
      167,  106,  240,  396,  182,  106,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  284,  284,  166,  887,  170,  110,  110,  110,  240,
      167,  167,  167,  167,  167,  167,  167,  167,  170,  280,
      169,  169,  169,  169,  169,  169,  169,  169,  179,  215,
      215,  215,  280,  110,  110,  110,  175,  179,  179,  179,
      348,  179,  885,  182,  218,  218,  218,  884,  170,  170,

      170,  170,  170,  170,  170,  170,  110,  110,  112,  112,
      112,  112,  112,  309,  112,  112,  112,  112,  112,  173,
      180,  112,  112,  331,  331,  179,  309,  279,  112,  112,
      181,  279,  173,  180,  175,  175,  175,  175,  175,  175,
      175,  175,  216,  181,  279,  213,  219,  219,  219,  227,
      216,  213,  254,  254,  254,  112,  112,  176,  264,  264,
      264,  397,  173,  173,  173,  173,  173,  173,  173,  173,
      176,  227,  213,  309,  298,  216,  180,  213,  112,  112,
      115,  883,  241,  882,  115,  879,  181,  298,  241,  266,
      266,  266,  115,  878,  115,  877,  115,  397,  227,  286,

      176,  176,  176,  176,  176,  176,  176,  176,  115,  241,
      273,  115,  115,  876,  241,  273,  273,  115,  245,  245,
      245,  245,  115,  115,  115,  115,  115,  115,  115,  115,
      332,  332,  188,  188,  115,  634,  298,  115,  119,  188,
      188,  188,  188,  188,  188,  425,  119,  119,  119,  189,
      189,  425,  119,  286,  119,  255,  189,  189,  189,  189,
      189,  286,  255,  255,  255,  245,  119,  465,  465,  119,
      119,  217,  217,  217,  217,  217,  217,  217,  217,  265,
      294,  119,  267,  267,  267,  249,  265,  265,  265,  248,
      797,  634,  119,  294,  282,  119,  121,  249,  282,  269,

      249,  249,  388,  248,  121,  248,  269,  269,  269,  278,
      875,  282,  249,  425,  278,  292,  288,  248,  305,  362,
      248,  248,  278,  249,  288,  294,  249,  388,  292,  121,
      428,  305,  248,  292,  121,  121,  121,  121,  121,  121,
      121,  121,  124,  248,  287,  362,  248,  511,  797,  288,
      124,  124,  124,  287,  287,  287,  124,  287,  124,  250,
      250,  250,  250,  250,  250,  250,  250,  692,  692,  305,
      124,  376,  291,  124,  124,  251,  251,  251,  251,  251,
      251,  251,  251,  511,  290,  124,  291,  291,  291,  535,
      300,  428,  258,  290,  290,  290,  124,  290,  376,  124,

      140,  140,  140,  300,  258,  874,  741,  258,  258,  297,
      300,  272,  140,  140,  140,  140,  140,  140,  140,  258,
      577,  296,  297,  140,  272,  272,  272,  272,  272,  295,
      258,  302,  140,  258,  296,  140,  302,  140,  140,  140,
      873,  252,  295,  259,  302,  577,  297,  295,  535,  140,
      140,  140,  140,  140,  140,  140,  140,  252,  140,  259,
      608,  140,  741,  140,  140,  145,  296,  329,  350,  252,
      145,  259,  252,  252,  259,  259,  393,  329,  145,  427,
      272,  350,  871,  304,  252,  608,  259,  262,  262,  262,
      262,  262,  262,  262,  262,  252,  304,  259,  252,  377,

      259,  773,  393,  145,  306,  870,  308,  304,  145,  145,
      145,  145,  145,  145,  145,  145,  168,  306,  299,  308,
      168,  301,  299,  257,  490,  307,  377,  427,  168,  429,
      168,  306,  168,  740,  301,  299,  329,  257,  307,  257,
      299,  308,  429,  313,  168,  313,  375,  168,  168,  493,
      490,  257,  863,  168,  257,  257,  313,  773,  168,  168,
      168,  168,  168,  168,  168,  168,  257,  299,  301,  318,
      168,  318,  862,  168,  172,  172,  493,  257,  307,  375,
      257,  592,  318,  172,  172,  172,  740,  172,  268,  172,
      861,  172,  263,  263,  263,  263,  263,  263,  263,  263,

      289,  314,  268,  172,  268,  375,  172,  172,  592,  860,
      314,  314,  314,  311,  314,  431,  268,  433,  172,  268,
      268,  319,  319,  319,  442,  315,  311,  315,  431,  172,
      433,  268,  172,  174,  315,  315,  315,  442,  315,  531,
      533,  174,  268,  433,  654,  268,  531,  533,  289,  289,
      289,  289,  289,  289,  289,  289,  311,  311,  311,  311,
      311,  311,  311,  311,  312,  706,  174,  325,  325,  325,
      654,  174,  174,  174,  174,  174,  174,  174,  174,  177,
      473,  328,  365,  365,  365,  447,  328,  177,  177,  177,
      322,  473,  317,  177,  328,  177,  424,  364,  447,  322,

      322,  322,  321,  322,  424,  364,  317,  177,  317,  424,
      177,  177,  312,  312,  312,  312,  312,  312,  312,  312,
      317,  864,  177,  317,  317,  859,  369,  706,  446,  323,
      364,  323,  447,  177,  369,  317,  177,  221,  323,  323,
      323,  446,  323,  829,  774,  221,  317,  523,  446,  317,
      321,  321,  321,  321,  321,  321,  321,  321,  327,  369,
      327,  349,  371,  371,  371,  349,  858,  327,  327,  327,
      221,  327,  857,  349,  864,  221,  221,  221,  221,  221,
      221,  221,  221,  247,  247,  247,  247,  247,  532,  247,
      247,  247,  247,  247,  320,  829,  247,  247,  399,  399,

      399,  335,  335,  247,  247,  774,  594,  320,  335,  335,
      335,  335,  335,  402,  402,  402,  523,  415,  326,  411,
      411,  411,  438,  349,  415,  415,  415,  423,  423,  423,
      247,  247,  326,  594,  326,  438,  856,  320,  320,  320,
      320,  320,  320,  320,  320,  399,  326,  855,  438,  326,
      326,  419,  554,  247,  247,  256,  850,  532,  407,  554,
      419,  326,  419,  256,  256,  256,  430,  420,  419,  256,
      407,  256,  326,  407,  407,  326,  420,  596,  420,  849,
      430,  430,  430,  256,  420,  407,  256,  256,  370,  370,
      370,  370,  370,  370,  370,  370,  407,  436,  256,  407,

      404,  440,  449,  434,  596,  440,  436,  436,  436,  256,
      436,  434,  256,  261,  404,  449,  404,  848,  440,  405,
      485,  261,  261,  261,  426,  437,  439,  261,  404,  261,
      426,  404,  404,  405,  440,  405,  434,  408,  437,  439,
      661,  261,  444,  404,  261,  261,  445,  405,  435,  449,
      405,  405,  847,  408,  404,  444,  261,  404,  485,  445,
      440,  448,  405,  663,  444,  408,  661,  261,  408,  408,
      261,  293,  417,  405,  448,  625,  405,  437,  439,  293,
      408,  448,  625,  485,  509,  417,  417,  417,  417,  417,
      663,  408,  426,  443,  408,  445,  435,  435,  435,  435,

      435,  435,  435,  435,  293,  412,  443,  462,  534,  293,
      293,  293,  293,  293,  293,  293,  293,  310,  310,  412,
      462,  412,  509,  443,  413,  463,  541,  846,  450,  798,
      310,  684,  310,  412,  310,  463,  412,  412,  413,  541,
      413,  417,  450,  450,  450,  441,  310,  509,  412,  310,
      310,  456,  413,  456,  541,  413,  413,  684,  441,  412,
      845,  310,  412,  462,  456,  844,  627,  413,  441,  414,
      538,  525,  310,  525,  538,  310,  316,  534,  413,  525,
      541,  413,  316,  414,  452,  414,  545,  538,  451,  798,
      316,  316,  316,  457,  463,  441,  316,  414,  316,  545,

      414,  414,  451,  843,  451,  676,  452,  457,  457,  457,
      316,  546,  414,  316,  316,  545,  451,  543,  452,  451,
      451,  452,  452,  414,  546,  316,  414,  486,  486,  486,
      543,  451,  676,  452,  626,  627,  316,  543,  753,  316,
      324,  626,  451,  585,  452,  451,  324,  452,  530,  530,
      530,  458,  842,  453,  324,  324,  324,  548,  454,  453,
      324,  557,  324,  753,  454,  458,  546,  458,  909,  629,
      548,  557,  585,  453,  324,  453,  629,  324,  324,  458,
      454,  630,  458,  458,  512,  512,  512,  453,  630,  324,
      453,  453,  454,  628,  458,  454,  454,  631,  585,  645,

      324,  460,  453,  324,  459,  458,  645,  454,  458,  841,
      459,  548,  478,  453,  840,  460,  453,  460,  454,  542,
      909,  454,  544,  542,  459,  839,  459,  478,  903,  460,
      557,  512,  460,  460,  504,  544,  542,  461,  459,  461,
      489,  459,  459,  838,  460,  491,  461,  461,  461,  504,
      461,  478,  478,  459,  489,  460,  489,  547,  460,  549,
      491,  491,  628,  549,  459,  770,  631,  459,  489,  544,
      547,  489,  489,  504,  504,  516,  549,  491,  515,  515,
      515,  632,  641,  489,  518,  547,  903,  491,  491,  516,
      770,  516,  696,  517,  489,  641,  689,  489,  641,  696,

      518,  837,  491,  516,  700,  517,  516,  516,  517,  517,
      637,  551,  518,  551,  522,  518,  518,  700,  516,  781,
      517,  539,  689,  637,  551,  515,  637,  518,  522,  516,
      522,  517,  516,  540,  517,  539,  539,  539,  518,  745,
      552,  518,  522,  589,  781,  522,  522,  540,  834,  540,
      632,  833,  745,  637,  636,  589,  636,  522,  589,  589,
      550,  540,  552,  614,  540,  540,  550,  636,  522,  601,
      589,  522,  778,  553,  552,  639,  540,  552,  552,  553,
      550,  589,  550,  601,  589,  778,  745,  540,  639,  552,
      540,  711,  614,  556,  550,  553,  601,  550,  550,  556,

      552,  638,  828,  552,  618,  618,  618,  553,  601,  550,
      553,  553,  587,  556,  638,  556,  782,  711,  614,  642,
      550,  750,  553,  550,  793,  697,  587,  556,  587,  590,
      556,  556,  642,  553,  639,  638,  553,  647,  697,  698,
      587,  782,  556,  587,  587,  590,  836,  647,  750,  793,
      701,  618,  698,  556,  640,  587,  556,  590,  704,  697,
      590,  590,  642,  701,  733,  702,  587,  640,  704,  587,
      588,  836,  590,  588,  640,  588,  744,  643,  702,  830,
      830,  588,  588,  590,  588,  701,  590,  588,  640,  744,
      733,  588,  827,  746,  751,  826,  744,  588,  698,  643,

      588,  640,  588,  746,  825,  699,  647,  588,  588,  822,
      588,  643,  588,  640,  643,  643,  588,  616,  699,  713,
      616,  751,  616,  821,  699,  702,  643,  704,  616,  616,
      635,  616,  820,  713,  616,  854,  635,  643,  616,  644,
      643,  817,  816,  910,  616,  644,  713,  616,  694,  616,
      635,  699,  635,  760,  616,  616,  761,  616,  713,  616,
      854,  644,  746,  616,  635,  763,  815,  635,  635,  695,
      694,  768,  890,  644,  872,  695,  644,  644,  721,  635,
      760,  814,  694,  761,  812,  694,  694,  734,  644,  777,
      635,  695,  763,  635,  776,  721,  748,  694,  768,  644,

      872,  734,  644,  695,  780,  721,  695,  695,  694,  779,
      748,  694,  910,  766,  734,  912,  777,  811,  695,  779,
      721,  776,  783,  748,  789,  780,  734,  766,  890,  695,
      789,  780,  695,  726,  726,  748,  726,  726,  726,  726,
      766,  726,  726,  726,  726,  794,  726,  726,  776,  783,
      780,  789,  766,  726,  726,  726,  786,  789,  805,  806,
      803,  818,  726,  823,  810,  786,  799,  818,  809,  824,
      803,  792,  794,  880,  800,  819,  915,  835,  779,  930,
      726,  726,  726,  786,  912,  805,  806,  835,  818,  726,
      823,  786,  792,  799,  808,  800,  824,  831,  792,  807,

      880,  800,  819,  726,  726,  743,  743,  819,  743,  743,
      743,  743,  743,  743,  743,  743,  743,  792,  743,  743,
      799,  851,  800,  851,  831,  743,  743,  743,  800,  803,
      831,  852,  868,  892,  743,  832,  804,  913,  865,  904,
      802,  866,  868,  892,  801,  915,  835,  796,  930,  904,
      851,  831,  743,  743,  743,  795,  852,  891,  852,  916,
      917,  743,  832,  865,  913,  865,  791,  790,  866,  916,
      917,  788,  787,  785,  784,  743,  743,  762,  762,  772,
      762,  762,  762,  762,  891,  762,  762,  762,  762,  832,
      762,  762,  865,  866,  832,  866,  911,  762,  762,  762,

      771,  868,  892,  918,  919,  920,  762,  921,  904,  767,
      911,  891,  922,  918,  919,  920,  765,  921,  759,  758,
      923,  924,  922,  911,  762,  762,  762,  757,  916,  917,
      923,  924,  925,  762,  926,  911,  756,  755,  754,  749,
      747,  927,  925,  742,  926,  739,  738,  762,  762,  775,
      775,  927,  775,  775,  775,  775,  775,  775,  775,  775,
      775,  737,  775,  775,  736,  928,  735,  929,  732,  775,
      775,  775,  918,  919,  920,  928,  921,  929,  775,  731,
      730,  922,  729,  728,  727,  725,  724,  723,  722,  923,
      924,  720,  719,  718,  717,  716,  775,  775,  775,  715,

      714,  925,  712,  926,  710,  775,  709,  708,  707,  705,
      927,  703,  691,  690,  688,  687,  686,  683,  682,  775,
      775,  681,  680,  679,  678,  675,  674,  673,  672,  671,
      670,  669,  668,  667,  928,  666,  929,  934,  665,  662,
      934,  660,  934,  934,  935,  935,  935,  935,  935,  659,
      935,  935,  935,  935,  936,  936,  936,  936,  936,  936,
      936,  936,  936,  936,  937,  937,  937,  937,  937,  937,
      937,  937,  937,  937,  938,  938,  938,  938,  938,  938,
      938,  938,  938,  938,  939,  658,  657,  939,  939,  939,
      939,  940,  940,  940,  940,  940,  656,  940,  940,  940,

      940,  941,  941,  941,  941,  941,  941,  941,  941,  941,
      941,  942,  942,  653,  652,  651,  650,  649,  942,  942,
      943,  943,  943,  943,  943,  943,  943,  943,  943,  943,
      944,  944,  944,  944,  944,  944,  944,  944,  944,  944,
      945,  945,  945,  945,  945,  945,  945,  945,  945,  945,
      946,  946,  946,  946,  946,  946,  946,  946,  946,  946,
      947,  947,  947,  947,  947,  947,  947,  947,  947,  947,
      948,  948,  948,  948,  948,  948,  948,  948,  948,  948,
      949,  949,  949,  949,  949,  949,  949,  949,  949,  949,
      950,  950,  950,  950,  950,  950,  950,  950,  950,  950,

      951,  951,  951,  951,  951,  951,  951,  951,  951,  951,
      952,  952,  952,  952,  952,  952,  952,  952,  952,  952,
      953,  953,  648,  953,  953,  953,  953,  953,  953,  953,
      954,  954,  646,  954,  954,  954,  954,  954,  954,  954,
      955,  955,  955,  955,  955,  955,  955,  955,  955,  955,
      956,  956,  956,  956,  956,  956,  956,  956,  956,  956,
      957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
      958,  958,  958,  958,  958,  958,  958,  958,  958,  958,
      959,  959,  959,  959,  959,  959,  959,  959,  959,  959,
      960,  960,  960,  960,  624,  960,  960,  960,  960,  960,

      961,  961,  623,  961,  962,  962,  962,  962,  962,  962,
      962,  962,  962,  962,  963,  963,  963,  963,  963,  963,
      963,  963,  963,  963,  964,  964,  622,  964,  964,  964,
      964,  964,  964,  964,  965,  965,  620,  965,  965,  965,
      965,  965,  965,  965,  966,  966,  615,  966,  966,  966,
      966,  966,  966,  966,  967,  967,  613,  967,  967,  967,
      967,  967,  967,  967,  968,  968,  612,  968,  968,  968,
      968,  968,  968,  968,  969,  969,  611,  969,  969,  969,
      969,  969,  969,  969,  970,  970,  970,  970,  970,  970,
      970,  970,  970,  970,  971,  971,  971,  971,  971,  971,

      971,  971,  971,  971,  972,  972,  972,  972,  972,  972,
      972,  972,  972,  972,  973,  973,  973,  973,  973,  973,
      973,  973,  973,  973,  974,  974,  610,  974,  974,  974,
      974,  974,  974,  974,  975,  975,  609,  975,  975,  975,
      975,  975,  975,  975,  976,  976,  607,  976,  976,  976,
      976,  976,  976,  976,  977,  977,  606,  977,  977,  977,
      977,  977,  977,  977,  978,  978,  605,  978,  978,  978,
      978,  978,  978,  978,  979,  979,  604,  979,  979,  979,
      979,  979,  979,  979,  980,  980,  980,  980,  980,  980,
      980,  980,  980,  980,  981,  981,  981,  981,  981,  981,

      981,  981,  981,  981,  982,  982,  982,  982,  982,  982,
      982,  982,  982,  982,  983,  983,  983,  983,  983,  983,
      983,  983,  983,  983,  603,  602,  600,  599,  598,  597,
      595,  593,  591,  586,  584,  583,  582,  581,  580,  579,
      578,  576,  575,  574,  573,  572,  571,  570,  569,  568,
      567,  566,  565,  564,  563,  562,  561,  560,  559,  555,
      537,  529,  528,  527,  526,  524,  520,  519,  514,  510,
      508,  507,  506,  505,  503,  502,  501,  500,  499,  498,
      497,  496,  495,  494,  492,  488,  484,  483,  482,  481,
      480,  479,  477,  476,  475,  474,  472,  471,  470,  469,

      468,  467,  466,  464,  432,  422,  421,  418,  416,  409,
      406,  401,  400,  395,  394,  392,  391,  390,  389,  387,
      386,  385,  384,  383,  382,  381,  380,  379,  374,  373,
      372,  368,  361,  360,  359,  358,  357,  356,  354,  353,
      352,  351,  347,  345,  343,  342,  341,  340,  339,  338,
      337,  336,  333,  285,  276,  274,  270,  260,  253,  243,
      242,  235,  234,  233,  232,  230,  229,  228,  226,  225,
      224,  223,  222,  220,  205,  204,  203,  202,  201,  198,
      197,  196,  195,  194,  193,  191,  190,  186,  135,  133,
      132,  130,  128,  127,  109,  108,  107,  105,  104,  102,

      100,   99,   98,   97,   96,   95,   94,   93,   92,   91,
       90,   88,   81,   79,   76,   73,   72,   71,   68,   63,
       35,   12,    7,    3,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933,  933,  933,  933,
      933,  933,  933,  933,  933,  933,  933

    } ;

static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
static char *yy_full_match;
static int yy_lp;
static int yy_looking_for_trail_begin = 0;
static int yy_full_lp;
static int *yy_full_state;
#define YY_TRAILING_MASK 0x2000
#define YY_TRAILING_HEAD_MASK 0x4000
#define REJECT \
{ \
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
yy_cp = yy_full_match; /* restore poss. backed-over text */ \
yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
yy_state_ptr = yy_full_state; /* restore orig. state */ \
yy_current_state = *yy_state_ptr; /* restore curr. state */ \
++yy_lp; \
goto find_rule; \
}
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
char *yytext;
# line 1 "../parser.l"
# line 8 "../parser.l"
/*
 * parser.l -- lex parser of algebraic chess moves for XBoard
 * $Id: parser.l,v 1.27 1995/07/28 05:23:42 mann Exp $
 *
 * Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts.
 * Enhancements Copyright 1992-95 Free Software Foundation, Inc.
 *
 * The following terms apply to Digital Equipment Corporation's copyright
 * interest in XBoard:
 * ------------------------------------------------------------------------
 * All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in
 * supporting documentation, and that the name of Digital not be
 * used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 *
 * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 * SOFTWARE.
 * ------------------------------------------------------------------------
 *
 * The following terms apply to the enhanced version of XBoard distributed
 * by the Free Software Foundation:
 * ------------------------------------------------------------------------
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 * ------------------------------------------------------------------------
 */

/* This parser handles all forms of promotion.
 * The parser resolves ambiguous moves by searching and check-testing.
 * It also parses comments of the form [anything] or (anything).
 */

#include <config.h>

#define NO_CONSTRAINT	-1
#undef YYLMAX
#define YYLMAX			4096
#define UNPUT_BUF_SIZE		YYLMAX

#ifdef FLEX_SCANNER
/* typeof(yytext) == "char *" */
/* yy_text is set in YY_DECL below */
char *yy_text;
#else /*!FLEX_SCANNER*/
/* typeof(yytext) == "char []" */
char *yy_text = (char *) yytext;
#endif

#ifdef FLEX_SCANNER
/* This is flex */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) my_yy_input(buf, &result, max_size)
#undef YY_DECL
#define YY_DECL                     \
    int _yylex YY_PROTO((void));    \
    int yylex YY_PROTO((void))      \
    {                               \
	int result = _yylex();      \
	yy_text = (char *) yytext;  \
	return(result);             \
    }                               \
    int _yylex YY_PROTO((void))
#else
/* This is lex */
#undef input
#undef output
#undef unput
#endif

/* The includes must be here, below the #undef input */

#include <ctype.h>

# if HAVE_STRING_H
#  include <string.h>
# else /* not HAVE_STRING_H */
#  include <strings.h>
# endif /* not HAVE_STRING_H */

#if HAVE_UNISTD_H
# include <unistd.h>
#endif

#if defined(_amigados)
# include <errno.h>
# if HAVE_FCNTL_H
#  include <fcntl.h>    /*  isatty() prototype  */
# endif /*  HAVE_FCNTL_H        */
#endif  /*  defined(_amigados)  */

#include "common.h"
#include "backend.h"
#include "frontend.h"
#include "parser.h"
#include "moves.h"

#define FakeFlags(index) \
    (((((index) % 2) == 0) ? F_WHITE_ON_MOVE : 0) | F_ALL_CASTLE_OK)

extern Board	boards[MAX_MOVES];
int		yyboardindex;
int             yyskipmoves = FALSE;
char		currentMoveString[YYLMAX];
#ifndef FLEX_SCANNER
char		unputBuffer[UNPUT_BUF_SIZE];
int		unputCount = 0;
#endif

#ifdef FLEX_SCANNER
void my_yy_input P((char *buf, int *result, int max_size));
#else /*!FLEX_SCANNER*/
static int input P((void));
static void output P((int ch));
static void unput P((int ch));
int yylook P((void));
int yyback P((int *, int));
#endif
#undef yywrap
int yywrap P((void));
extern void CopyBoard P((Board to, Board from));


/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( yy_current_buffer->yy_is_interactive ) \
		{ \
		int c = getc( yyin ); \
		result = c == EOF ? 0 : 1; \
		buf[0] = (char) c; \
		} \
	else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
		  && ferror( yyin ) ) \
		YY_FATAL_ERROR( "input in flex scanner failed" );
#endif

/* No semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif

/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif

/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif

/* Code executed at the beginning of each rule, after yytext and yyleng
 * have been set up.
 */
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK break;
#endif

YY_DECL
	{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;

# line 151 "../parser.l"



	if ( yy_init )
		{
#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! yy_start )
			yy_start = 1;	/* first start state */

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( yy_current_buffer )
			yy_init_buffer( yy_current_buffer, yyin );
		else
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();

		yy_init = 0;
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
		yy_cp = yy_c_buf_p;

		/* Support of yytext. */
		*yy_cp = yy_hold_char;

		/* yy_bp points to the position in yy_ch_buf of the start of
		 * the current run.
		 */
		yy_bp = yy_cp;

		yy_current_state = yy_start;
		if ( yy_bp[-1] == '\n' )
			++yy_current_state;
		yy_state_ptr = yy_state_buf;
		*yy_state_ptr++ = yy_current_state;
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 934 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			*yy_state_ptr++ = yy_current_state;
			++yy_cp;
			}
		while ( yy_base[yy_current_state] != 3525 );

yy_find_action:
		yy_current_state = *--yy_state_ptr;
		yy_lp = yy_accept[yy_current_state];
find_rule: /* we branch to this label when backing up */
		for ( ; ; ) /* until we find what rule we matched */
			{
			if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
				{
				yy_act = yy_acclist[yy_lp];
				if ( yy_act & YY_TRAILING_HEAD_MASK ||
				     yy_looking_for_trail_begin )
					{
					if ( yy_act == yy_looking_for_trail_begin )
						{
						yy_looking_for_trail_begin = 0;
						yy_act &= ~YY_TRAILING_HEAD_MASK;
						break;
						}
					}
				else if ( yy_act & YY_TRAILING_MASK )
					{
					yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
					yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
					}
				else
					{
					yy_full_match = yy_cp;
					yy_full_state = yy_state_ptr;
					yy_full_lp = yy_lp;
					break;
					}
				++yy_lp;
				goto find_rule;
				}
			--yy_cp;
			yy_current_state = *--yy_state_ptr;
			yy_lp = yy_accept[yy_current_state];
			}

		YY_DO_BEFORE_ACTION;


do_action:	/* This label is used only to access EOF actions. */


		switch ( yy_act )
	{ /* beginning of action switch */
case 1:
YY_USER_ACTION
# line 153 "../parser.l"
{
    /*
     * Fully-qualified algebraic move, possibly with promotion
     */
    int skip1 = 0, skip2 = 0;
    ChessSquare piece;
    ChessMove result;
    
    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the / */
    if (yytext[1] == '/') skip1 = 1;
    
    /* remove the [xX:-] */
    if ((yytext[3+skip1] == 'x') || (yytext[3+skip1] == 'X') ||
	(yytext[3+skip1] == '-') || (yytext[3+skip1] == ':')) skip2 = 1;
    
    currentMoveString[0] = yytext[1+skip1];
    currentMoveString[1] = yytext[2+skip1];
    currentMoveString[2] = yytext[3+skip1+skip2];
    currentMoveString[3] = yytext[4+skip1+skip2];
    currentMoveString[4] = NULLCHAR;
    
    if (yyleng-skip1-skip2 > 5) {
	if (yytext[yyleng-1] == ')') {
	    currentMoveString[4] = ToLower(yytext[yyleng-2]);
	} else {
	    currentMoveString[4] = ToLower(yytext[yyleng-1]);
	}
	currentMoveString[5] = NULLCHAR;
    }

    piece = boards[yyboardindex]
      [currentMoveString[1] - '1'][currentMoveString[0] - 'a'];
    if (ToLower(yytext[0]) != ToLower(PieceToChar(piece)))
      return (int) BadMove;

    result = LegalityTest(boards[yyboardindex],
			  FakeFlags(yyboardindex), EP_UNKNOWN,
			  currentMoveString[1] - '1',
			  currentMoveString[0] - 'a',
			  currentMoveString[3] - '1',
			  currentMoveString[2] - 'a',
			  currentMoveString[4]);

    if (currentMoveString[4] == NULLCHAR &&
	(result == WhitePromotionQueen || result == BlackPromotionQueen)) {
	currentMoveString[4] = 'q';
	currentMoveString[5] = NULLCHAR;
    }

    return (int) result;
}
	YY_BREAK
case 2:
YY_USER_ACTION
# line 207 "../parser.l"
{
    /*
     * Simple algebraic move, possibly with promotion
     */
    int skip = 0;
    ChessMove result;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the [xX:-] */
    if ((yytext[2] == 'x') || (yytext[2] == 'X') ||
	(yytext[2] == '-') || (yytext[2] == ':')) skip = 1;

    currentMoveString[0] = yytext[0];
    currentMoveString[1] = yytext[1];
    currentMoveString[2] = yytext[2+skip];
    currentMoveString[3] = yytext[3+skip];
    currentMoveString[4] = NULLCHAR;

    if (yyleng-skip > 4) {
	if (yytext[yyleng-1] == ')') {
	    currentMoveString[4] = ToLower(yytext[yyleng-2]);
	} else {
	    currentMoveString[4] = ToLower(yytext[yyleng-1]);
	}
	currentMoveString[5] = NULLCHAR;
    }

    result = LegalityTest(boards[yyboardindex],
			  FakeFlags(yyboardindex), EP_UNKNOWN,
			  currentMoveString[1] - '1',
			  currentMoveString[0] - 'a',
			  currentMoveString[3] - '1',
			  currentMoveString[2] - 'a',
			  currentMoveString[4]);

    if (currentMoveString[4] == NULLCHAR &&
	(result == WhitePromotionQueen || result == BlackPromotionQueen)) {
	currentMoveString[4] = 'q';
	currentMoveString[5] = NULLCHAR;
    }

    return (int) result;
}
	YY_BREAK
case 3:
YY_USER_ACTION
# line 252 "../parser.l"
{
    /*
     * Pawn move, possibly with promotion
     */
    DisambiguateClosure cl;
    int skip = 0;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the =() */
    if (yytext[2] == '=') skip++;
    if (yytext[2+skip] == '(') skip++;

    cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
    cl.rfIn = -1;
    cl.ffIn = yytext[0] - 'a';
    cl.rtIn = yytext[1] - '1';
    cl.ftIn = yytext[0] - 'a';
    cl.promoCharIn = yytext[2+skip];
    Disambiguate(boards[yyboardindex],
		 FakeFlags(yyboardindex), EP_UNKNOWN, &cl);

    currentMoveString[0] = cl.ff + 'a';
    currentMoveString[1] = cl.rf + '1';
    currentMoveString[2] = cl.ft + 'a';
    currentMoveString[3] = cl.rt + '1';
    currentMoveString[4] = cl.promoChar;
    currentMoveString[5] = NULLCHAR;

    return (int) cl.kind;
}
	YY_BREAK
case 4:
YY_USER_ACTION
# line 285 "../parser.l"
{
    /*
     * Pawn capture, possibly with promotion, possibly ambiguous
     */
    DisambiguateClosure cl;
    int skip1 = 0, skip2 = 0;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the [xX:-] and =() */
    if ((yytext[1] == 'x') || (yytext[1] == 'X')
	|| (yytext[1] == ':') || (yytext[1] == '-')) skip1 = 1;
    if (yytext[2+skip1] == '=') skip2++;
    if (yytext[2+skip1+skip2] == '(') skip2++;

    cl.pieceIn = WhiteOnMove(yyboardindex) ? WhitePawn : BlackPawn;
    cl.rfIn = -1;
    cl.ffIn = yytext[0] - 'a';
    cl.rtIn = -1;
    cl.ftIn = yytext[1+skip1] - 'a';
    cl.promoCharIn = yytext[2+skip1+skip2];
    Disambiguate(boards[yyboardindex],
		 FakeFlags(yyboardindex), EP_UNKNOWN, &cl);

    currentMoveString[0] = cl.ff + 'a';
    currentMoveString[1] = cl.rf + '1';
    currentMoveString[2] = cl.ft + 'a';
    currentMoveString[3] = cl.rt + '1';
    currentMoveString[4] = cl.promoChar;
    currentMoveString[5] = NULLCHAR;

    return (int) cl.kind;
}
	YY_BREAK
case 5:
YY_USER_ACTION
# line 319 "../parser.l"
{
    /*
     * unambiguously abbreviated Pawn capture, possibly with promotion
     */
    int skip = 0;
    ChessMove result;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the [xX:-] */
    if ((yytext[1] == 'x') || (yytext[1] == 'X')
	|| (yytext[1] == ':') || (yytext[1] == '-')) skip = 1;

    currentMoveString[0] = yytext[0];
    currentMoveString[2] = yytext[1+skip];
    currentMoveString[3] = yytext[2+skip];
    if (WhiteOnMove(yyboardindex)) {
	if (yytext[2+skip] == '1') return (int) BadMove;
	currentMoveString[1] = yytext[2+skip] - 1;
    } else {
	if (yytext[2+skip] == '8') return (int) BadMove;
	currentMoveString[1] = yytext[2+skip] + 1;
    }
    if (yyleng-skip > 3) {
	if (yytext[yyleng-1] == ')')
	  currentMoveString[4] = ToLower(yytext[yyleng-2]);
	else
	  currentMoveString[4] = ToLower(yytext[yyleng-1]);
	currentMoveString[5] = NULLCHAR;
    } else {
	currentMoveString[4] = NULLCHAR;
    }

    result = LegalityTest(boards[yyboardindex],
			  FakeFlags(yyboardindex), EP_UNKNOWN,
			  currentMoveString[1] - '1',
			  currentMoveString[0] - 'a',
			  currentMoveString[3] - '1',
			  currentMoveString[2] - 'a',
			  currentMoveString[4]);

    if (currentMoveString[4] == NULLCHAR &&
	(result == WhitePromotionQueen || result == BlackPromotionQueen)) {
	currentMoveString[4] = 'q';
	currentMoveString[5] = NULLCHAR;
    }

    if (result != BadMove) return (int) result;

    /* Special case: improperly written en passant capture */
    if (WhiteOnMove(yyboardindex)) {
	if (currentMoveString[3] == '5') {
	    currentMoveString[1] = '5';
	    currentMoveString[3] = '6';
	} else {
	    return (int) BadMove;
	}
    } else {
	if (currentMoveString[3] == '4') {
	    currentMoveString[1] = '4';
	    currentMoveString[3] = '3';
	} else {
	    return (int) BadMove;
	}
    }

    result = LegalityTest(boards[yyboardindex],
			  FakeFlags(yyboardindex), EP_UNKNOWN,
			  currentMoveString[1] - '1',
			  currentMoveString[0] - 'a',
			  currentMoveString[3] - '1',
			  currentMoveString[2] - 'a',
			  currentMoveString[4]);

    if (result == WhiteCapturesEnPassant || result == BlackCapturesEnPassant)
      return (int) result;
    else
      return (int) BadMove;
}
	YY_BREAK
case 6:
YY_USER_ACTION
# line 399 "../parser.l"
{
    /*
     * piece move, possibly ambiguous
     */
    DisambiguateClosure cl;
    int skip = 0;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the [xX:-] */
    if ((yytext[1] == 'x') || (yytext[1] == 'X')
	|| (yytext[1] == ':') || (yytext[1] == '-')) skip = 1;

    if (WhiteOnMove(yyboardindex)) {
	cl.pieceIn = CharToPiece(ToUpper(yytext[0]));
    } else {
	cl.pieceIn = CharToPiece(ToLower(yytext[0]));
    }
    cl.rfIn = -1;
    cl.ffIn = -1;
    cl.rtIn = yytext[2+skip] - '1';
    cl.ftIn = yytext[1+skip] - 'a';
    cl.promoCharIn = NULLCHAR;
    Disambiguate(boards[yyboardindex],
		 FakeFlags(yyboardindex), EP_UNKNOWN, &cl);

    currentMoveString[0] = cl.ff + 'a';
    currentMoveString[1] = cl.rf + '1';
    currentMoveString[2] = cl.ft + 'a';
    currentMoveString[3] = cl.rt + '1';
    currentMoveString[4] = cl.promoChar;
    currentMoveString[5] = NULLCHAR;

    return (int) cl.kind;
}
	YY_BREAK
case 7:
YY_USER_ACTION
# line 435 "../parser.l"
{
    /*
     * piece move with rank or file disambiguator
     */
    DisambiguateClosure cl;
    int skip = 0;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    /* remove the [xX:-] */
    if ((yytext[2] == 'x') || (yytext[2] == 'X')
	|| (yytext[2] == ':') || (yytext[2] == '-')) skip = 1;

    if (WhiteOnMove(yyboardindex)) {
	cl.pieceIn = CharToPiece(ToUpper(yytext[0]));
    } else {
	cl.pieceIn = CharToPiece(ToLower(yytext[0]));
    }
    if (isalpha(yytext[1])) {
	cl.rfIn = -1;
	cl.ffIn = yytext[1] - 'a';
    } else {
	cl.rfIn = yytext[1] - '1';
	cl.ffIn = -1;
    }
    cl.rtIn = yytext[3+skip] - '1';
    cl.ftIn = yytext[2+skip] - 'a';
    cl.promoCharIn = NULLCHAR;
    Disambiguate(boards[yyboardindex],
		 FakeFlags(yyboardindex), EP_UNKNOWN, &cl);

    currentMoveString[0] = cl.ff + 'a';
    currentMoveString[1] = cl.rf + '1';
    currentMoveString[2] = cl.ft + 'a';
    currentMoveString[3] = cl.rt + '1';
    currentMoveString[4] = cl.promoChar;
    currentMoveString[5] = NULLCHAR;

    return (int) cl.kind;
}
	YY_BREAK
case 8:
YY_USER_ACTION
# line 476 "../parser.l"
{
    int rf, ff, rt, ft;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    if (WhiteOnMove(yyboardindex)) {
	if (boards[yyboardindex][0][3] == WhiteKing) {
	    /* ICS wild castling */
	    strcpy(currentMoveString, "d1f1");
	    rf = 0;
	    ff = 3;
	    rt = 0;
	    ft = 5;
	} else {
	    strcpy(currentMoveString, "e1c1");
	    rf = 0;
	    ff = 4;
	    rt = 0;
	    ft = 2;
	}
    } else{ 
	if (boards[yyboardindex][7][3] == BlackKing) {
	    /* ICS wild castling */
	    strcpy(currentMoveString, "d8f8");
	    rf = 7;
	    ff = 3;
	    rt = 7;
	    ft = 5;
	} else {
	    strcpy(currentMoveString, "e8c8");
	    rf = 7;
	    ff = 4;
	    rt = 7;
	    ft = 2;
	}
    }
    return (int) LegalityTest(boards[yyboardindex],
			      FakeFlags(yyboardindex), EP_UNKNOWN,
			      rf, ff, rt, ft, NULLCHAR);
}
	YY_BREAK
case 9:
YY_USER_ACTION
# line 517 "../parser.l"
{
    int rf, ff, rt, ft;

    if (yyskipmoves) return (int) AmbiguousMove; /* not disambiguated */

    if (WhiteOnMove(yyboardindex)) {
	if (boards[yyboardindex][0][3] == WhiteKing) {
	    /* ICS wild castling */
	    strcpy(currentMoveString, "d1b1");
	    rf = 0;
	    ff = 3;
	    rt = 0;
	    ft = 1;
	} else {
	    strcpy(currentMoveString, "e1g1");
	    rf = 0;
	    ff = 4;
	    rt = 0;
	    ft = 6;
	}
    } else {
	if (boards[yyboardindex][7][3] == BlackKing) {
	    /* ICS wild castling */
	    strcpy(currentMoveString, "d8b8");
	    rf = 7;
	    ff = 3;
	    rt = 7;
	    ft = 1;
	} else {
	    strcpy(currentMoveString, "e8g8");
	    rf = 7;
	    ff = 4;
	    rt = 7;
	    ft = 6;
	}
    }
    return (int) LegalityTest(boards[yyboardindex],
			      FakeFlags(yyboardindex), EP_UNKNOWN,
			      rf, ff, rt, ft, NULLCHAR);
}
	YY_BREAK
case 10:
YY_USER_ACTION
# line 558 "../parser.l"
{
    if (WhiteOnMove(yyboardindex))
      return (int) BlackWins;
    else
      return (int) WhiteWins;
}
	YY_BREAK
case 11:
YY_USER_ACTION
# line 565 "../parser.l"
{
    return (int) BlackWins;
}
	YY_BREAK
case 12:
YY_USER_ACTION
# line 569 "../parser.l"
{
    return (int) WhiteWins;
}
	YY_BREAK
case 13:
YY_USER_ACTION
# line 573 "../parser.l"
{
    return (int) WhiteWins;
}
	YY_BREAK
case 14:
YY_USER_ACTION
# line 577 "../parser.l"
{
    return (int) BlackWins;
}
	YY_BREAK
case 15:
YY_USER_ACTION
# line 581 "../parser.l"
{
    return (int) GameUnfinished;
}
	YY_BREAK
case 16:
YY_USER_ACTION
# line 585 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 17:
YY_USER_ACTION
# line 589 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 18:
YY_USER_ACTION
# line 593 "../parser.l"
{
    if (WhiteOnMove(yyboardindex))
      return (int) BlackWins;
    else
      return (int) WhiteWins;
}
	YY_BREAK
case 19:
YY_USER_ACTION
# line 600 "../parser.l"
{
    if (WhiteOnMove(yyboardindex))
      return (int) BlackWins;
    else
      return (int) WhiteWins;
}
	YY_BREAK
case 20:
YY_USER_ACTION
# line 607 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 21:
YY_USER_ACTION
# line 611 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 22:
YY_USER_ACTION
# line 615 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 23:
YY_USER_ACTION
# line 619 "../parser.l"
{ 
    return (int) WhiteWins;
}
	YY_BREAK
case 24:
YY_USER_ACTION
# line 623 "../parser.l"
{ 
    return (int) BlackWins;
}
	YY_BREAK
case 25:
YY_USER_ACTION
# line 627 "../parser.l"
{ 
    return (int) BlackWins;
}
	YY_BREAK
case 26:
YY_USER_ACTION
# line 631 "../parser.l"
{ 
    return (int) WhiteWins;
}
	YY_BREAK
case 27:
YY_USER_ACTION
# line 635 "../parser.l"
{ 
    return (int) WhiteWins;
}
	YY_BREAK
case 28:
YY_USER_ACTION
# line 639 "../parser.l"
{ 
    return (int) BlackWins;
}
	YY_BREAK
case 29:
YY_USER_ACTION
# line 643 "../parser.l"
{
    return (int) GameIsDrawn;
}
	YY_BREAK
case 30:
YY_USER_ACTION
# line 647 "../parser.l"
{
    return (int) GameUnfinished;
}
	YY_BREAK
case 31:
YY_USER_ACTION
# line 651 "../parser.l"
{
    /* move numbers */
    if ((yyleng == 1) && (yytext[0] == '1'))
      return (int) MoveNumberOne;
}
	YY_BREAK
case 32:
YY_USER_ACTION
# line 657 "../parser.l"
{
    /* elapsed time indication, e.g. (0:12) */ 
    return (int) ElapsedTime;
}
	YY_BREAK
case 33:
YY_USER_ACTION
# line 662 "../parser.l"
{
    /* position diagram enclosed in [-- --] */
    return (int) PositionDiagram;
}
	YY_BREAK
case 34:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_USER_ACTION
# line 667 "../parser.l"
{
    /* position diagram enclosed in {-- --} */
    return (int) PositionDiagram;
}
	YY_BREAK
case 35:
YY_USER_ACTION
# line 672 "../parser.l"
{
    return (int) PGNTag;
}    
	YY_BREAK
case 36:
YY_USER_ACTION
# line 676 "../parser.l"
{
    return (int) GNUChessGame;
}
	YY_BREAK
case 37:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_USER_ACTION
# line 680 "../parser.l"
{
    return (int) XBoardGame;
}
	YY_BREAK
case 38:
YY_USER_ACTION
# line 684 "../parser.l"
{        			/* anything in {} */
    return (int) Comment; 
}
	YY_BREAK
case 39:
*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_USER_ACTION
# line 688 "../parser.l"
{                                          /* ; to end of line */
    return (int) Comment;
}
	YY_BREAK
case 40:
YY_USER_ACTION
# line 692 "../parser.l"
{        			/* anything in [] */
    return (int) Comment; 
}
	YY_BREAK
case 41:
YY_USER_ACTION
# line 696 "../parser.l"
{ 	  	/* nested () */
    return (int) Comment; 
}
	YY_BREAK
case 42:
YY_USER_ACTION
# line 700 "../parser.l"
{ 				/* >=2 chars in () */
    return (int) Comment; 
}       
	YY_BREAK
case 43:
YY_USER_ACTION
# line 704 "../parser.l"
{
        /* Skip mail headers */
}
	YY_BREAK
case 44:
YY_USER_ACTION
# line 708 "../parser.l"
{
        /* Skip random words */
}
	YY_BREAK
case 45:
YY_USER_ACTION
# line 712 "../parser.l"
{
        /* Skip everything else */
}
	YY_BREAK
case 46:
YY_USER_ACTION
# line 716 "../parser.l"
ECHO;
	YY_BREAK
			case YY_STATE_EOF(INITIAL):
				yyterminate();

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*yy_cp = yy_hold_char;

		if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between yy_current_buffer and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			yy_n_chars = yy_current_buffer->yy_n_chars;
			yy_current_buffer->yy_input_file = yyin;
			yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the
		 * end-of-buffer state).  Contrast this with the test
		 * in input().
		 */
		if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = yytext_ptr + YY_MORE_ADJ;

			if ( yy_next_state )
				{
				/* Consume the NUL. */
				yy_cp = ++yy_c_buf_p;
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
							yy_cp = yy_c_buf_p;
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer() )
			{
			case EOB_ACT_END_OF_FILE:
				{
				yy_did_buffer_switch_on_eof = 0;

				if ( yywrap() )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				yy_c_buf_p =
					yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
				yy_c_buf_p =
				&yy_current_buffer->yy_ch_buf[yy_n_chars];

				yy_current_state = yy_get_previous_state();

				yy_cp = yy_c_buf_p;
				yy_bp = yytext_ptr + YY_MORE_ADJ;
				goto yy_find_action;
			}
		break;
		}

	default:
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of yylex */


/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */

static int yy_get_next_buffer()
	{
	register char *dest = yy_current_buffer->yy_ch_buf;
	register char *source = yytext_ptr - 1; /* copy prev. char, too */
	register int number_to_move, i;
	int ret_val;

	if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( yy_current_buffer->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
			{
			/* We matched a singled characater, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = yy_c_buf_p - yytext_ptr;

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		yy_n_chars = 0;

	else
		{
		int num_to_read =
			yy_current_buffer->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = yy_current_buffer;

			int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;

			b->yy_buf_size *= 2;
			b->yy_ch_buf = (char *)
				yy_flex_realloc( (void *) b->yy_ch_buf,
						 b->yy_buf_size );

			if ( ! b->yy_ch_buf )
				YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = yy_current_buffer->yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
			yy_n_chars, num_to_read );
		}

	if ( yy_n_chars == 0 )
		{
		if ( number_to_move - YY_MORE_ADJ == 1 )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart( yyin );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			yy_current_buffer->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	yy_n_chars += number_to_move;
	yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
	yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;

	/* yytext begins at the second character in yy_ch_buf; the first
	 * character is the one which preceded it before reading in the latest
	 * buffer; it needs to be kept around in case it's a newline, so
	 * yy_get_previous_state() will have with '^' rules active.
	 */

	yytext_ptr = &yy_current_buffer->yy_ch_buf[1];

	return ret_val;
	}


/* yy_get_previous_state - get the state just before the EOB char was reached */

static yy_state_type yy_get_previous_state()
	{
	register yy_state_type yy_current_state;
	register char *yy_cp;

	register char *yy_bp = yytext_ptr;

	yy_current_state = yy_start;
	if ( yy_bp[-1] == '\n' )
		++yy_current_state;
	yy_state_ptr = yy_state_buf;
	*yy_state_ptr++ = yy_current_state;

	for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
		{
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 934 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		*yy_state_ptr++ = yy_current_state;
		}

	return yy_current_state;
	}


/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	register int yy_is_jam;

	register YY_CHAR yy_c = 1;
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 934 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	*yy_state_ptr++ = yy_current_state;
	yy_is_jam = (yy_current_state == 933);

	return yy_is_jam ? 0 : yy_current_state;
	}


#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
	{
	register char *yy_cp = yy_c_buf_p;

	/* undo effects of setting up yytext */
	*yy_cp = yy_hold_char;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = yy_n_chars + 2;
		register char *dest = &yy_current_buffer->yy_ch_buf[
					yy_current_buffer->yy_buf_size + 2];
		register char *source =
				&yy_current_buffer->yy_ch_buf[number_to_move];

		while ( source > yy_current_buffer->yy_ch_buf )
			*--dest = *--source;

		yy_cp += dest - source;
		yy_bp += dest - source;
		yy_n_chars = yy_current_buffer->yy_buf_size;

		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
		yy_cp[-2] = '\n';

	*--yy_cp = (char) c;


	/* Note: the formal parameter *must* be called "yy_bp" for this
	 * macro to now work correctly.
	 */
	YY_DO_BEFORE_ACTION; /* set up yytext again */
	}


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#endif
	{
	int c;

	*yy_c_buf_p = yy_hold_char;

	if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
			/* This was really a NUL. */
			*yy_c_buf_p = '\0';

		else
			{ /* need more input */
			yytext_ptr = yy_c_buf_p;
			++yy_c_buf_p;

			switch ( yy_get_next_buffer() )
				{
				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						{
						yy_c_buf_p =
						yytext_ptr + YY_MORE_ADJ;
						return EOF;
						}

					YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
					break;

				case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
					YY_FATAL_ERROR(
					"unexpected last match in yyinput()" );
#else
					YY_FATAL_ERROR(
					"unexpected last match in input()" );
#endif
				}
			}
		}

	c = *(unsigned char *) yy_c_buf_p;	/* cast for 8-bit char's */
	*yy_c_buf_p = '\0';	/* preserve yytext */
	yy_hold_char = *++yy_c_buf_p;

	return c;
	}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! yy_current_buffer )
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_init_buffer( yy_current_buffer, input_file );
	yy_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	if ( yy_current_buffer == new_buffer )
		return;

	if ( yy_current_buffer )
		{
		/* Flush out information for old buffer. */
		*yy_c_buf_p = yy_hold_char;
		yy_current_buffer->yy_buf_pos = yy_c_buf_p;
		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	yy_did_buffer_switch_on_eof = 1;
	}


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
	{
	yy_n_chars = yy_current_buffer->yy_n_chars;
	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
	yyin = yy_current_buffer->yy_input_file;
	yy_hold_char = *yy_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );

	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );

	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

	yy_flex_free( (void *) b->yy_ch_buf );
	yy_flex_free( (void *) b );
	}


#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif
	{
	b->yy_input_file = file;

	/* We put in the '\n' and start reading from [1] so that an
	 * initial match-at-newline will be true.
	 */

	b->yy_ch_buf[0] = '\n';
	b->yy_n_chars = 1;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[1];

	b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;

	b->yy_fill_buffer = 1;

	b->yy_buffer_status = YY_BUFFER_NEW;
	}


#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
	{
	if ( yy_start_stack_ptr >= yy_start_stack_depth )
		{
		int new_size;

		yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yy_start_stack_depth * sizeof( int );

		if ( ! yy_start_stack )
			yy_start_stack = (int *) yy_flex_alloc( new_size );

		else
			yy_start_stack = (int *) yy_flex_realloc(
					(void *) yy_start_stack, new_size );

		if ( ! yy_start_stack )
			YY_FATAL_ERROR(
			"out of memory expanding start-condition stack" );
		}

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}


static void yy_pop_state()
	{
	if ( --yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}


static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}


#ifdef YY_USE_PROTOS
static void yy_fatal_error( const char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
	{
	(void) fprintf( stderr, "%s\n", msg );
	exit( 1 );
	}



/* Redefine yyless() so it works in section 3 code. */

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		yytext[yyleng] = yy_hold_char; \
		yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
		yy_hold_char = *yy_c_buf_p; \
		*yy_c_buf_p = '\0'; \
		yyleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

#ifndef yytext_ptr
#ifdef YY_USE_PROTOS
static void yy_flex_strncpy( char *s1, const char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
const char *s2;
int n;
#endif
	{
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
	}
#endif


#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( unsigned int size )
#else
static void *yy_flex_alloc( size )
unsigned int size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, unsigned int size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
unsigned int size;
#endif
	{
	return (void *) realloc( ptr, size );
	}

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}
# line 716 "../parser.l"



static char *StringToLex;

#ifndef FLEX_SCANNER
static FILE *lexFP;

static int input()
{
    int ret;
    
    if (StringToLex != NULL) {
	ret = *StringToLex;
	if (ret == NULLCHAR)
	  ret = EOF;
	else
	  StringToLex++;
    } else if (unputCount > 0) {
	ret = unputBuffer[--unputCount];
    } else {
	ret = fgetc(lexFP);
    }    

    if (ret == EOF) 
      return 0;
    else
      return ret;
}

/*
 * Return offset of next pattern within current file
 */
int yyoffset()
{
    int offset = ftell(lexFP) - unputCount;

    if (offset < 0) {
	offset = 0;
    }
    return(offset);
}
 
static void output(ch)
     int ch;
{
    fprintf(stderr, "PARSER BUG: unmatched character '%c' (0%o)\n",
	    ch, ch);
}

static void unput(ch)
     int ch;
{
    if (ch == 0) return;
    if (StringToLex != NULL) {
	StringToLex--;
    } else {
	if (unputCount >= UNPUT_BUF_SIZE)
	  fprintf(stderr, "PARSER BUG: unput buffer overflow '%c' (0%o)\n",
		  ch, ch);
	unputBuffer[unputCount++] = ch;
    }
}

/* Get ready to lex from a new file.  Kludge below sticks
   an artificial newline at the front of the file, which the
   above grammar ignores, but which makes ^ at start of pattern
   match at the real start of the file.
*/
void yynewfile(f)
     FILE *f;
{
    lexFP = f;
    StringToLex = NULL;
    unputCount = 0;
    unput('\n'); /* kludge */
}

/* Get ready to lex from a string.  ^ at start of pattern WON'T
   match at the start of the string!
*/
void yynewstr(s)
     char *s;
{
    lexFP = NULL;
    StringToLex = s;
    unputCount = 0;
}
#endif /*!FLEX_SCANNER*/

#ifdef FLEX_SCANNER
void my_yy_input(buf, result, max_size)
     char *buf;
     int *result;
     int max_size;
{
    int count;

    if (StringToLex != NULL) {
	count = 0;
	while (*StringToLex != NULLCHAR) {
	    *buf++ = *StringToLex++;
	    count++;
	}
	*result = count;
	return;
    } else {
	count = fread(buf, 1, max_size, yyin);
	if (count == 0) {
	    *result = YY_NULL;
	} else {
	    *result = count;
	}
	return;
    }    
}

static YY_BUFFER_STATE my_file_buffer = NULL;

/*
    Return offset of next pattern in the current file.
*/
int yyoffset()
{
    int pos = yy_c_buf_p - yy_current_buffer->yy_ch_buf;

    return(ftell(yy_current_buffer->yy_input_file) -
         yy_n_chars + pos);
}


void yynewstr(s)
     char *s;
{
    if (my_file_buffer != NULL)
      yy_delete_buffer(my_file_buffer);
    StringToLex = s;
    my_file_buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
    yy_switch_to_buffer(my_file_buffer);
}

void yynewfile(f)
     FILE *f;
{
    if (my_file_buffer != NULL)
      yy_delete_buffer(my_file_buffer);
    StringToLex = NULL;
    my_file_buffer = yy_create_buffer(f, YY_BUF_SIZE);
    yy_switch_to_buffer(my_file_buffer);
}
#endif /*FLEX_SCANNER*/

int yywrap()
{
    return TRUE;
}

/* Parse a move from the given string s */
/* ^ at start of pattern WON'T work here unless using flex */
ChessMove yylexstr(boardIndex, s)
     int boardIndex;
     char *s;
{
    ChessMove ret;
    char *oldStringToLex;
#ifdef FLEX_SCANNER
    YY_BUFFER_STATE buffer, oldBuffer;
#endif
    
    yyboardindex = boardIndex;
    oldStringToLex = StringToLex;
    StringToLex = s;
#ifdef FLEX_SCANNER
    buffer = yy_create_buffer(stdin, YY_BUF_SIZE);
    oldBuffer = YY_CURRENT_BUFFER;
    yy_switch_to_buffer(buffer);
#endif /*FLEX_SCANNER*/

    ret = (ChessMove) yylex();

#ifdef FLEX_SCANNER
    if (oldBuffer != NULL) 
      yy_switch_to_buffer(oldBuffer);
    yy_delete_buffer(buffer);
#endif /*FLEX_SCANNER*/
    StringToLex = oldStringToLex;

    return ret;
}
