/* A lexical scanner generated by flex */

/* scanner skeleton version:
 * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
 */

#define FLEX_SCANNER

#include <stdio.h>

#if _MSC_VER > 600
#include <io.h>
#include <errno.h>
#define read _read
#define fileno _fileno
#endif

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


#ifdef __cplusplus

#include <stdlib.h>
#include <osfcn.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__

#ifdef __GNUC__
#include <stddef.h>
void *malloc( size_t );
void free( void* );
#else
#include <stdlib.h>
#endif	/* __GNUC__ */

#define YY_USE_PROTOS
#define YY_USE_CONST

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


#ifdef __TURBOC__
#define YY_USE_CONST
#endif


#ifndef YY_USE_CONST
#define const
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
/* we can't get here if it's an ANSI C compiler, or a C++ compiler,
 * so it's got to be a K&R compiler, and therefore there's no standard
 * place from which to include these definitions
 */
char *malloc();
int free();
int read();
#endif


/* amount of stuff to slurp up with each read */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 2048
#endif

/* returned upon end-of-file */
#define YY_END_TOK 0

/* copy whatever the last rule matched to the standard output */

/* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
/* this used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite()
 */
#define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )

/* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#define YY_INPUT(buf,result,max_size) \
	if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
	    YY_FATAL_ERROR( "read() in flex scanner failed" );
#define YY_NULL 0

/* 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.
 */
#define yyterminate() return ( YY_NULL )

/* report a fatal error */

/* The funky do-while is used to turn this macro definition into
 * a single C statement (which needs a semi-colon terminator).
 * This avoids problems with code like:
 *
 * 	if ( something_happens )
 *		YY_FATAL_ERROR( "oops, the something happened" );
 *	else
 *		everything_okay();
 *
 * 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 YY_FATAL_ERROR() call.
 */

#define YY_FATAL_ERROR(msg) \
	do \
		{ \
		(void) fputs( msg, stdout ); \
		(void) putc( '\n', stdout ); \
		exit( 1 ); \
		} \
	while ( 0 )

/* default yywrap function - always treat EOF as an EOF */
#define yywrap() 1

/* 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 *

/* 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" */
#define YY_NEW_FILE \
	do \
		{ \
		yy_init_buffer( yy_current_buffer, yyin ); \
		yy_load_buffer_state(); \
		} \
	while ( 0 )

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

/* code executed at the end of each rule */
#define YY_BREAK break;

#define YY_END_OF_BUFFER_CHAR 0

#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
#endif

typedef struct yy_buffer_state *YY_BUFFER_STATE;

#define YY_CHAR char
# line 1 "ascan.l"
#define INITIAL 0
# line 2 "ascan.l"
/***************************************************************************
 * ASCAN.L -- Scanner for PGN game files.
 *
 * Copyright (C)1993 Andy Duplain.
 *
 * Version	Date		Comments
 * =======	====		========
 * 1.0		21/12/93	Initial.
 * 1.1		02/02/94	Added supplemental tag-pairs from PGN spec.
 *				1993-01-30.
 ***************************************************************************/

#include "global.h"
#include "ascan.h"

unsigned linenum;

static void count_newlines P__((void));
static void eat_line P__((void));

# line 32 "ascan.l"

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

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

/* 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_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

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


struct yy_buffer_state
    {
    FILE *yy_input_file;

    YY_CHAR *yy_ch_buf;		/* input buffer */
    YY_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;

    int yy_eof_status;		/* whether we've seen an EOF on this buffer */
#define EOF_NOT_SEEN 0
    /* "pending" happens when the EOF has been seen but there's still
     * some text process
     */
#define EOF_PENDING 1
#define EOF_DONE 2
    };

static YY_BUFFER_STATE yy_current_buffer;

/* 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 YY_CHAR yy_hold_char;

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



#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

#ifndef YY_USER_INIT
#define YY_USER_INIT
#endif

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

YY_CHAR *yytext;
int yyleng;

FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;

#define YY_END_OF_BUFFER 77
typedef int yy_state_type;
static const short int yy_acclist[238] =
    {   0,
       77,   75,   76,   74,   75,   76,   73,   76,   57,   75,
       76,   56,   75,   76,   75,   76,   69,   75,   76,   70,
       75,   76,   67,   75,   76,   55,   75,   76,   37,   75,
       76,   37,   75,   76,   37,   75,   76,   71,   75,   76,
       58,   75,   76,   75,   76,   75,   76,   75,   76,   75,
       76,   75,   76,   75,   76,   72,   75,   76,   75,   76,
       74,   61,   59,   63,   37,   37,   37,   60,   62,   39,
       68,   53,   65,   64,   66,   45,   53,   40,   42,   53,
       38,   47,   49,   46,   41,   44,   66,   54,   51,   48,
       50,   43,   52,16410,16417,16411,16387,16410, 8218,16410,

    16417, 8225,16417,16420,16411, 8219,16411,16386,16412,16390,
    16406,16387, 8195,16387,16385,16420, 8228,16420,16388,16416,
    16386, 8194,16386,16405,16412, 8220,16412,16389,16390, 8198,
    16390,16406, 8214,16406,16385, 8193,16385,16391,16388, 8196,
    16388,16416, 8224,16416,16405, 8213,16405,16389, 8197,16389,
    16399,16407,16391, 8199,16391,16404,16414,16413,16398,16395,
    16399, 8207,16399,16407, 8215,16407,16404, 8212,16404,16414,
     8222,16414,16413, 8221,16413,16394,16398, 8206,16398,16419,
    16395, 8203,16395,16401,16397,16402,16408,16394, 8202,16394,
    16400,16396,16419, 8227,16419,16393,16401, 8209,16401,16397,

     8205,16397,16402, 8210,16402,16408, 8216,16408,16392,16400,
     8208,16400,16396, 8204,16396,16393, 8201,16393,16418,16415,
    16392, 8200,16392,16403,16409,16418, 8226,16418,16415, 8223,
    16415,16403, 8211,16403,16409, 8217,16409
    } ;

static const short int yy_accept[493] =
    {   0,
        1,    1,    1,    2,    4,    7,    9,   12,   15,   17,
       20,   23,   26,   29,   32,   35,   38,   41,   44,   46,
       48,   50,   52,   54,   56,   59,   61,   62,   63,   64,
       65,   66,   66,   67,   68,   68,   68,   68,   68,   69,
       70,   70,   70,   70,   70,   71,   71,   71,   71,   71,
       71,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   73,   74,   74,   74,
       75,   76,   76,   76,   76,   77,   77,   77,   78,   78,
       79,   79,   80,   80,   81,   81,   81,   81,   81,   81,
       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,

       81,   81,   81,   81,   81,   81,   81,   82,   82,   82,
       82,   83,   84,   84,   84,   84,   85,   85,   86,   86,
       87,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,   88,   88,   88,   89,   89,   89,   90,   90,
       91,   92,   92,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   94,
       94,   94,   94,   94,   94,   95,   95,   95,   96,   96,
       96,   97,   97,   97,   97,   97,   97,   97,   97,   97,

       97,   97,   97,   97,   97,   97,   97,   97,   97,   97,
       97,   97,   97,   97,   97,   98,   99,  100,  101,  101,
      101,  101,  102,  103,  104,  104,  105,  106,  107,  108,
      108,  108,  108,  108,  108,  108,  109,  109,  109,  109,
      109,  110,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  111,  111,  111,  111,  111,  111,  111,
      112,  113,  114,  115,  115,  116,  116,  116,  117,  118,
      119,  119,  119,  119,  120,  120,  120,  121,  122,  123,
      124,  124,  125,  125,  125,  126,  127,  128,  128,  128,
      128,  128,  128,  129,  129,  129,  129,  129,  129,  129,

      130,  131,  132,  132,  132,  132,  132,  132,  133,  134,
      135,  136,  137,  138,  138,  138,  138,  138,  139,  140,
      141,  142,  142,  143,  144,  145,  146,  147,  148,  148,
      148,  148,  148,  148,  148,  149,  150,  151,  151,  151,
      151,  151,  151,  151,  151,  151,  152,  152,  152,  152,
      152,  152,  152,  153,  154,  155,  156,  156,  157,  157,
      157,  157,  157,  158,  158,  159,  159,  159,  159,  160,
      160,  160,  160,  160,  160,  161,  162,  163,  164,  164,
      164,  164,  164,  164,  165,  166,  167,  168,  169,  170,
      170,  170,  170,  171,  172,  173,  174,  175,  176,  176,

      176,  177,  178,  179,  180,  180,  180,  180,  180,  181,
      182,  183,  184,  184,  184,  185,  185,  186,  186,  187,
      187,  187,  187,  187,  187,  188,  189,  190,  191,  191,
      191,  192,  192,  193,  194,  195,  196,  196,  197,  198,
      199,  200,  201,  202,  203,  204,  205,  206,  206,  206,
      206,  206,  207,  208,  209,  209,  210,  211,  212,  213,
      214,  215,  216,  217,  218,  219,  219,  219,  219,  220,
      220,  221,  222,  223,  224,  224,  225,  225,  226,  227,
      228,  229,  230,  231,  232,  233,  234,  235,  236,  237,
      238,  238

    } ;

static const YY_CHAR yy_ec[128] =
    {   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,    5,    1,    6,    7,    8,    1,    1,    9,
       10,   11,   12,    1,   13,   14,   15,   16,   17,   18,
       19,   19,   19,   19,   19,   19,   20,   21,   22,    1,
       23,    1,   24,    1,   25,   26,   27,   28,   29,   30,
        1,    1,   31,    1,   32,    1,   33,   34,   35,   32,
       32,   36,   37,   38,   39,   40,   41,   42,    1,    1,
       43,    1,   44,    1,    1,    1,   45,   46,   47,   48,

       49,   50,   51,   52,   53,    1,   54,   55,   56,   57,
       58,   59,    1,   60,   61,   62,   63,   64,   65,   42,
       66,    1,   67,    1,   68,    1,    1
    } ;

static const YY_CHAR yy_meta[69] =
    {   0,
        1,    1,    2,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    3,    3,    3,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    3,    1,    1,    3,    3,    3,    3,    3,    3,
        3,    3,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1
    } ;

static const short int yy_base[568] =
    {   0,
        0,   61,  979,  980,   68,  980,   66,  980,   57,  980,
      980,  980,  980,   78,  103,  111,  980,   76,   66,  965,
       69,   84,  964,  908,  980,  120,  108,  980,  980,  116,
      137,   62,  138,  160,  958,  958,  955,  956,  980,  980,
      121,  136,  172,  936,  169,  161,  179,  925,  911,  900,
      980,  910,   51,  921,  111,  936,  906,  932,  903,  144,
      166,   40,  923,  915,  907,  945,  980,  216,  943,  980,
      203,  186,  204,  208,  197,  205,  241,  943,  235,  980,
      245,  242,  890,  941,  896,  907,  906,  888,  914,  899,
      913,  898,  918,  895,  882,  879,  219,  879,  895,  893,

      878,  881,  909,  875,  881,  917,  918,  914,  913,  265,
      980,  980,  240,  276,  279,  980,  894,  276,  275,  980,
      980,  870,  869,  879,  865,  875,  919,  865,  917,  871,
      915,  861,  854,  859,  853,  875,  864,  861,  871,  854,
      860,  109,  855,  845,  980,  891,  890,  980,  286,  980,
      980,  287,  980,  842,  849,  854,  897,  856,  837,  854,
      893,  852,  842,  839,  845,  839,  832,  886,  840,  843,
      834,  190,  841,  832,  839,  834,  864,  863,  980,  835,
      296,  875,  834,  833,  196,  310,  832,  197,  831,  830,
      272,  816,  810,  867,  812,  865,  824,  863,  806,  808,

      820,  805,  800,  805,  798,  302,  797,  814,  802,  831,
      262,  818,  810,  809,  274,  276,  980,  314,  808,  806,
      791,  319,  980,  321,  805,  323,  324,  980,  326,  797,
      843,  802,  788,  800,  799,  329,  798,  788,  795,  795,
      330,  781,  788,  787,  782,  790,  778,  807,  284,  794,
      772,  785,  336,  770,  823,  764,  766,  797,  779,  339,
      340,  980,  341,  778,  342,  759,  762,  343,  980,  345,
      815,  774,  773,  346,  812,  771,  348,  349,  980,  350,
      770,  351,  768,  750,  352,  980,  353,  749,  806,  805,
      750,  763,  354,  748,  801,  742,  744,  775,  741,  356,

      980,  357,  796,  755,  743,  748,  766,  358,  980,  359,
      361,  980,  363,  746,  737,  749,  748,  366,  368,  980,
      369,  747,  372,  980,  373,  374,  980,  375,  728,  736,
      728,  743,  742,  728,  376,  980,  378,  780,  739,  727,
      732,  750,  762,  719,  713,  379,  705,  738,  723,  717,
      657,  668,  385,  388,  980,  396,  665,  401,  653,  645,
      639,  647,  403,  629,  405,  666,  623,  620,  406,  612,
      651,  648,  593,  581,  408,  411,  980,  412,  615,  569,
      566,  560,  540,  418,  980,  421,  422,  980,  423,  537,
      535,  534,  424,  980,  425,  427,  980,  428,  539,  530,

      430,  431,  980,  432,  567,  524,  521,  511,  433,  434,
      980,  435,  508,  502,  436,  501,  438,  499,  439,  482,
      484,  536,  535,  492,  440,  441,  980,  443,  491,  489,
      445,  486,  448,  450,  980,  451,  484,  454,  455,  980,
      456,  457,  980,  458,  460,  980,  461,  522,  521,  480,
      479,  467,  980,  470,  477,  478,  483,  980,  485,  487,
      980,  488,  490,  980,  493,  476,  236,  229,  494,  228,
      500,  503,  980,  504,  226,  505,  160,  506,  507,  980,
      509,  510,  980,  512,  513,  980,  514,  515,  980,  516,
      980,  162,  140,  560,  111,  563,  566,  569,  572,  575,

      578,  581,  584,  587,  590,  593,  596,  599,  602,  605,
      608,  611,  614,  617,  620,  623,  626,  629,  632,  635,
      638,  641,  644,  647,  650,  653,  656,  659,  662,  665,
      668,  671,  674,  677,  680,  683,  686,  689,  692,  695,
      698,  701,  704,  707,  710,  713,  716,  719,  722,  725,
      728,  731,  734,  737,  740,  743,  746,  749,  752,  755,
      758,  761,  764,  767,  770,  773,  776
    } ;

static const short int yy_def[568] =
    {   0,
      491,    1,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  492,  491,
      493,  493,  491,  494,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  495,  491,  491,  491,  491,  491,  491,  494,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,

      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  496,  491,  497,
      491,  498,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  499,  496,  500,  491,  497,  501,  502,  498,
      503,  491,  491,  491,  491,  491,  504,  491,  491,  491,

      505,  491,  491,  491,  491,  491,  491,  506,  491,  491,
      491,  491,  507,  499,  508,  500,  491,  500,  509,  491,
      491,  501,  491,  501,  502,  510,  503,  491,  503,  491,
      491,  511,  491,  512,  504,  513,  514,  491,  491,  505,
      515,  491,  491,  491,  491,  516,  491,  491,  491,  491,
      491,  506,  517,  491,  491,  491,  491,  491,  507,  518,
      508,  491,  508,  509,  519,  491,  491,  510,  491,  510,
      491,  520,  511,  521,  491,  512,  522,  513,  491,  513,
      514,  523,  491,  491,  515,  491,  515,  491,  491,  491,
      491,  516,  524,  491,  491,  491,  491,  491,  491,  517,

      491,  517,  491,  525,  491,  491,  491,  518,  491,  518,
      519,  491,  519,  491,  491,  526,  520,  527,  521,  491,
      521,  528,  522,  491,  522,  523,  491,  523,  491,  491,
      491,  529,  530,  491,  524,  491,  524,  491,  531,  491,
      491,  491,  491,  532,  525,  533,  491,  491,  491,  491,
      491,  526,  534,  527,  491,  527,  528,  535,  491,  491,
      491,  529,  536,  530,  537,  491,  538,  531,  539,  491,
      491,  491,  540,  532,  541,  533,  491,  533,  491,  542,
      543,  544,  491,  534,  491,  534,  535,  491,  535,  491,
      491,  491,  536,  491,  536,  537,  491,  537,  545,  538,

      546,  539,  491,  539,  491,  547,  548,  540,  549,  541,
      491,  541,  550,  542,  551,  543,  552,  544,  553,  491,
      491,  491,  491,  545,  554,  546,  491,  546,  555,  547,
      556,  548,  557,  549,  491,  549,  550,  558,  551,  491,
      551,  552,  491,  552,  553,  491,  553,  491,  491,  559,
      560,  554,  491,  554,  555,  561,  556,  491,  556,  557,
      491,  557,  558,  491,  558,  562,  563,  559,  564,  560,
      565,  561,  491,  561,  562,  566,  563,  567,  564,  491,
      564,  565,  491,  565,  566,  491,  566,  567,  491,  567,
        0,  491,  491,  491,  491,  491,  491,  491,  491,  491,

      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491
    } ;

static const short int yy_nxt[1049] =
    {   0,
        4,    5,    6,    5,    7,    8,    9,    4,   10,   11,
       12,   13,    4,    4,    4,   14,   15,   16,   16,   16,
        4,   17,    4,   18,    4,   19,    4,    4,    4,    4,
        4,   19,    4,   19,   20,   19,    4,    4,    4,    4,
        4,    4,    4,    4,   21,   21,   21,   22,   21,   21,
       21,   21,    4,    4,    4,    4,    4,   23,    4,    4,
        4,    4,    4,    4,    4,    4,   24,    4,   25,   27,
       28,   27,   30,   30,   30,   30,   30,   66,   67,   31,
       39,   31,   41,   41,   41,   45,   45,   45,  101,   29,
       32,   33,  102,   34,   34,   34,   34,   34,   35,   40,

       45,   45,   45,   26,   31,   86,   31,   42,   87,   27,
       46,   27,   31,   77,   31,   36,   33,   37,   34,   34,
       34,   34,   34,   38,   33,   46,   34,   34,   34,   34,
       34,   30,   30,   30,   30,   30,  173,   89,   31,   68,
       31,   68,   47,   48,   52,   53,  174,   54,   55,   56,
       33,   69,   57,   58,   59,   60,   61,   62,   63,   64,
       65,   31,   72,   31,   43,   73,   73,   73,   73,   73,
       73,   73,   73,   33,   90,   34,   34,   34,   34,   34,
       74,   74,   74,   74,   74,   74,   74,   74,   75,   75,
       75,   79,   95,  201,   80,   82,   82,   82,  217,  223,

       80,   96,   80,  478,   80,   81,   81,   81,   81,   81,
       81,   81,   81,   76,   97,  108,  202,   68,   98,   68,
      111,  111,  111,  109,  112,  112,  112,   99,  100,   69,
      110,  110,  110,  110,  110,  110,  110,  110,  113,  218,
      224,  114,  114,  114,  114,  114,  114,  114,  114,  115,
      115,  115,  115,  115,  115,  115,  115,  116,  116,  116,
       80,  118,  118,  118,  119,  135,   80,  120,   80,  476,
       80,  471,  469,  120,  228,  120,  262,  120,  217,  478,
      136,  148,  148,  148,  149,  149,  149,  149,  149,  149,
      149,  149,  150,  150,  150,  151,  151,  151,  152,  208,

      120,  153,  179,  179,  179,  246,  120,  153,  120,  153,
      120,  153,  153,  219,  256,  229,  217,  263,  153,  218,
      153,  223,  153,  223,  209,  269,  228,  257,  228,  210,
      247,  279,  286,  211,  212,  248,  296,  220,  301,  249,
      250,  309,  262,  262,  312,  269,  221,  269,  320,  297,
      324,  279,  279,  327,  286,  286,  336,  218,  301,  301,
      309,  309,  224,  312,  224,  312,  270,  229,  355,  229,
      320,  320,  280,  287,  324,  324,  327,  327,  336,  302,
      336,  377,  310,  263,  263,  313,  270,  385,  270,  321,
      355,  325,  280,  280,  328,  287,  287,  337,  355,  302,

      302,  310,  310,  388,  313,  394,  313,  397,  403,  356,
      411,  321,  321,  377,  377,  325,  325,  328,  328,  337,
      385,  337,  378,  385,  388,  388,  394,  394,  386,  397,
      397,  356,  427,  403,  403,  435,  411,  411,  440,  356,
      443,  446,  453,  427,  389,  427,  395,  458,  398,  404,
      461,  412,  435,  435,  378,  378,  464,  440,  440,  443,
      443,  386,  446,  446,  386,  389,  389,  395,  395,  453,
      398,  398,  453,  428,  404,  404,  436,  412,  412,  441,
      473,  444,  447,  454,  428,  458,  428,  458,  459,  461,
      461,  462,  464,  436,  436,  464,  480,  465,  441,  441,

      444,  444,  483,  447,  447,  473,  473,  486,  489,  480,
      454,  480,  483,  454,  483,  486,  486,  489,  489,  476,
      456,  474,  471,  469,  467,  466,  459,  438,  459,  433,
      462,  462,  431,  465,  456,  425,  465,  481,  451,  450,
      449,  448,  419,  484,  417,  415,  474,  474,  487,  490,
      481,  438,  481,  484,  409,  484,  487,  487,  490,  490,
       50,   50,   50,  184,  433,  184,  187,  431,  187,  190,
      429,  190,  214,  401,  214,  216,  216,  216,  222,  222,
      222,  225,  425,  225,  227,  227,  227,  235,  423,  235,
      240,  422,  240,  252,  421,  252,  259,  420,  259,  261,

      261,  261,  264,  419,  264,  268,  268,  268,  273,  417,
      273,  276,  415,  276,  278,  278,  278,  281,  413,  281,
      285,  285,  285,  292,  375,  292,  300,  300,  300,  308,
      308,  308,  311,  311,  311,  317,  409,  317,  319,  319,
      319,  323,  323,  323,  326,  326,  326,  335,  335,  335,
      345,  407,  345,  352,  406,  352,  354,  354,  354,  357,
      405,  357,  362,  369,  362,  364,  401,  364,  368,  399,
      368,  374,  365,  374,  376,  376,  376,  384,  384,  384,
      387,  387,  387,  393,  393,  393,  396,  396,  396,  400,
      363,  400,  402,  402,  402,  408,  392,  408,  410,  410,

      410,  414,  391,  414,  416,  390,  416,  418,  358,  418,
      424,  353,  424,  426,  426,  426,  430,  383,  430,  432,
      382,  432,  434,  434,  434,  437,  381,  437,  439,  439,
      439,  442,  442,  442,  445,  445,  445,  452,  452,  452,
      455,  380,  455,  457,  457,  457,  460,  460,  460,  463,
      463,  463,  468,  379,  468,  470,  346,  470,  472,  472,
      472,  475,  375,  475,  477,  373,  477,  479,  479,  479,
      482,  482,  482,  485,  485,  485,  488,  488,  488,  372,
      371,  370,  369,  367,  366,  365,  363,  361,  360,  359,
      358,  318,  353,  351,  350,  349,  348,  347,  346,  344,

      343,  342,  341,  340,  339,  338,  293,  334,  333,  332,
      331,  330,  329,  282,  277,  322,  274,  318,  316,  315,
      314,  265,  260,  307,  306,  305,  304,  303,  253,  299,
      298,  295,  294,  293,  291,  290,  289,  288,  241,  284,
      283,  282,  236,  277,  275,  274,  272,  271,  226,  267,
      266,  265,  215,  260,  258,  255,  254,  253,  251,  245,
      244,  243,  242,  241,  239,  238,  237,  236,  234,  233,
      232,  231,  230,  191,  226,  188,  185,  215,  213,  207,
      121,  121,  206,  205,  204,  203,  200,  199,  198,  197,
      196,  195,  194,  193,  192,  191,  189,  188,  186,  185,

      183,  182,  181,  180,  178,  177,  176,  175,  172,  171,
      170,  169,  168,  167,  166,  165,  164,  163,  162,  161,
      160,  159,  158,  157,  156,  155,  154,  145,  145,  147,
      146,   69,  145,  144,  143,  142,  141,  140,  139,  138,
      137,  134,  133,  132,  131,  130,  129,  128,  127,  126,
      125,  124,  123,  122,  121,  117,  107,  106,  105,  104,
      103,   94,   93,   92,   91,   88,   85,   51,   84,   83,
       78,   70,   71,   70,   67,   51,   49,   44,  491,    3,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,

      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491
    } ;

static const short int yy_chk[1049] =
    {   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,    2,    5,
        7,    5,    9,    9,    9,    9,    9,   32,   32,   14,
       18,   14,   19,   19,   19,   21,   21,   21,   62,    7,
       14,   14,   62,   14,   14,   14,   14,   14,   14,   18,

       22,   22,   22,    2,   15,   53,   15,   19,   53,   27,
       21,   27,   16,  495,   16,   15,   15,   15,   15,   15,
       15,   15,   15,   15,   16,   22,   16,   16,   16,   16,
       16,   30,   30,   30,   30,   30,  142,   55,   31,   33,
       31,   33,  493,   22,   26,   26,  142,   26,   26,   26,
       31,   33,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   34,   41,   34,  492,   41,   41,   41,   41,   41,
       41,   41,   41,   34,   55,   34,   34,   34,   34,   34,
       42,   42,   42,   42,   42,   42,   42,   42,   43,   43,
       43,   45,   60,  172,   45,   47,   47,   47,  185,  188,

       45,   60,   45,  477,   45,   46,   46,   46,   46,   46,
       46,   46,   46,   43,   61,   71,  172,   68,   61,   68,
       73,   73,   73,   71,   74,   74,   74,   61,   61,   68,
       72,   72,   72,   72,   72,   72,   72,   72,   75,  185,
      188,   75,   75,   75,   75,   75,   75,   75,   75,   76,
       76,   76,   76,   76,   76,   76,   76,   77,   77,   77,
       79,   81,   81,   81,   82,   97,   79,   82,   79,  475,
       79,  470,  468,   82,  191,   82,  215,   82,  216,  467,
       97,  110,  110,  110,  113,  113,  113,  113,  113,  113,
      113,  113,  114,  114,  114,  115,  115,  115,  118,  181,

      119,  118,  149,  149,  149,  206,  119,  118,  119,  118,
      119,  118,  152,  186,  211,  191,  218,  215,  152,  216,
      152,  222,  152,  224,  181,  226,  227,  211,  229,  181,
      206,  236,  241,  181,  181,  206,  249,  186,  253,  206,
      206,  260,  261,  263,  265,  268,  186,  270,  274,  249,
      277,  278,  280,  282,  285,  287,  293,  218,  300,  302,
      308,  310,  222,  311,  224,  313,  226,  227,  318,  229,
      319,  321,  236,  241,  323,  325,  326,  328,  335,  253,
      337,  346,  260,  261,  263,  265,  268,  353,  270,  274,
      354,  277,  278,  280,  282,  285,  287,  293,  356,  300,

      302,  308,  310,  358,  311,  363,  313,  365,  369,  318,
      375,  319,  321,  376,  378,  323,  325,  326,  328,  335,
      384,  337,  346,  386,  387,  389,  393,  395,  353,  396,
      398,  354,  401,  402,  404,  409,  410,  412,  415,  356,
      417,  419,  425,  426,  358,  428,  363,  431,  365,  369,
      433,  375,  434,  436,  376,  378,  438,  439,  441,  442,
      444,  384,  445,  447,  386,  387,  389,  393,  395,  452,
      396,  398,  454,  401,  402,  404,  409,  410,  412,  415,
      456,  417,  419,  425,  426,  457,  428,  459,  431,  460,
      462,  433,  463,  434,  436,  465,  469,  438,  439,  441,

      442,  444,  471,  445,  447,  472,  474,  476,  478,  479,
      452,  481,  482,  454,  484,  485,  487,  488,  490,  466,
      455,  456,  451,  450,  449,  448,  457,  437,  459,  432,
      460,  462,  430,  463,  429,  424,  465,  469,  423,  422,
      421,  420,  418,  471,  416,  414,  472,  474,  476,  478,
      479,  413,  481,  482,  408,  484,  485,  487,  488,  490,
      494,  494,  494,  496,  407,  496,  497,  406,  497,  498,
      405,  498,  499,  400,  499,  500,  500,  500,  501,  501,
      501,  502,  399,  502,  503,  503,  503,  504,  392,  504,
      505,  391,  505,  506,  390,  506,  507,  383,  507,  508,

      508,  508,  509,  382,  509,  510,  510,  510,  511,  381,
      511,  512,  380,  512,  513,  513,  513,  514,  379,  514,
      515,  515,  515,  516,  374,  516,  517,  517,  517,  518,
      518,  518,  519,  519,  519,  520,  373,  520,  521,  521,
      521,  522,  522,  522,  523,  523,  523,  524,  524,  524,
      525,  372,  525,  526,  371,  526,  527,  527,  527,  528,
      370,  528,  529,  368,  529,  530,  367,  530,  531,  366,
      531,  532,  364,  532,  533,  533,  533,  534,  534,  534,
      535,  535,  535,  536,  536,  536,  537,  537,  537,  538,
      362,  538,  539,  539,  539,  540,  361,  540,  541,  541,

      541,  542,  360,  542,  543,  359,  543,  544,  357,  544,
      545,  352,  545,  546,  546,  546,  547,  351,  547,  548,
      350,  548,  549,  549,  549,  550,  349,  550,  551,  551,
      551,  552,  552,  552,  553,  553,  553,  554,  554,  554,
      555,  348,  555,  556,  556,  556,  557,  557,  557,  558,
      558,  558,  559,  347,  559,  560,  345,  560,  561,  561,
      561,  562,  344,  562,  563,  343,  563,  564,  564,  564,
      565,  565,  565,  566,  566,  566,  567,  567,  567,  342,
      341,  340,  339,  338,  334,  333,  332,  331,  330,  329,
      322,  317,  316,  315,  314,  307,  306,  305,  304,  303,

      299,  298,  297,  296,  295,  294,  292,  291,  290,  289,
      288,  284,  283,  281,  276,  275,  273,  272,  271,  267,
      266,  264,  259,  258,  257,  256,  255,  254,  252,  251,
      250,  248,  247,  246,  245,  244,  243,  242,  240,  239,
      238,  237,  235,  234,  233,  232,  231,  230,  225,  221,
      220,  219,  214,  213,  212,  210,  209,  208,  207,  205,
      204,  203,  202,  201,  200,  199,  198,  197,  196,  195,
      194,  193,  192,  190,  189,  187,  184,  183,  182,  180,
      178,  177,  176,  175,  174,  173,  171,  170,  169,  168,
      167,  166,  165,  164,  163,  162,  161,  160,  159,  158,

      157,  156,  155,  154,  147,  146,  144,  143,  141,  140,
      139,  138,  137,  136,  135,  134,  133,  132,  131,  130,
      129,  128,  127,  126,  125,  124,  123,  122,  117,  109,
      108,  107,  106,  105,  104,  103,  102,  101,  100,   99,
       98,   96,   95,   94,   93,   92,   91,   90,   89,   88,
       87,   86,   85,   84,   83,   78,   69,   66,   65,   64,
       63,   59,   58,   57,   56,   54,   52,   50,   49,   48,
       44,   38,   37,   36,   35,   24,   23,   20,    3,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,

      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491,  491,  491,
      491,  491,  491,  491,  491,  491,  491,  491
    } ;

static yy_state_type yy_last_accepting_state;
static YY_CHAR *yy_last_accepting_cpos;

static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
static YY_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

/* these variables are all declared out here so that section 3 code can
 * manipulate them
 */
/* points to current character in buffer */
static YY_CHAR *yy_c_buf_p = (YY_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 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 yyunput YY_PROTO(( YY_CHAR c, YY_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 ));

#define yy_new_buffer yy_create_buffer

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

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




    if ( yy_init )
	{
	YY_USER_INIT;

	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_cp];
	    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = yy_def[yy_current_state];
		if ( yy_current_state >= 492 )
		    yy_c = yy_meta[yy_c];
		}
	    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	    *yy_state_ptr++ = yy_current_state;
	    ++yy_cp;
	    }
	while ( yy_current_state != 491 );

yy_find_action:
	yy_current_state = *--yy_state_ptr;
	yy_lp = yy_accept[yy_current_state];
find_rule: /* we branch to this label when backtracking */
	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;
	YY_USER_ACTION;

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


	switch ( yy_act )
	    {
case 1:
# line 34 "ascan.l"
return A_PGN_EVENT;
	YY_BREAK
case 2:
# line 35 "ascan.l"
return A_PGN_SITE;
	YY_BREAK
case 3:
# line 36 "ascan.l"
return A_PGN_DATE;
	YY_BREAK
case 4:
# line 37 "ascan.l"
return A_PGN_ROUND;
	YY_BREAK
case 5:
# line 38 "ascan.l"
return A_PGN_WHITE;
	YY_BREAK
case 6:
# line 39 "ascan.l"
return A_PGN_BLACK;
	YY_BREAK
case 7:
# line 40 "ascan.l"
return A_PGN_RESULT;
	YY_BREAK
case 8:
# line 41 "ascan.l"
return A_PGN_WHITETITLE;
	YY_BREAK
case 9:
# line 42 "ascan.l"
return A_PGN_BLACKTITLE;
	YY_BREAK
case 10:
# line 43 "ascan.l"
return A_PGN_WHITEELO;
	YY_BREAK
case 11:
# line 44 "ascan.l"
return A_PGN_BLACKELO;
	YY_BREAK
case 12:
# line 45 "ascan.l"
return A_PGN_WHITEUSCF;
	YY_BREAK
case 13:
# line 46 "ascan.l"
return A_PGN_BLACKUSCF;
	YY_BREAK
case 14:
# line 47 "ascan.l"
return A_PGN_WHITENA;
	YY_BREAK
case 15:
# line 48 "ascan.l"
return A_PGN_BLACKNA;
	YY_BREAK
case 16:
# line 49 "ascan.l"
return A_PGN_WHITETYPE;
	YY_BREAK
case 17:
# line 50 "ascan.l"
return A_PGN_BLACKTYPE;
	YY_BREAK
case 18:
# line 51 "ascan.l"
return A_PGN_EVENTDATE;
	YY_BREAK
case 19:
# line 52 "ascan.l"
return A_PGN_EVENTSPONSOR;
	YY_BREAK
case 20:
# line 53 "ascan.l"
return A_PGN_SECTION;
	YY_BREAK
case 21:
# line 54 "ascan.l"
return A_PGN_STAGE;
	YY_BREAK
case 22:
# line 55 "ascan.l"
return A_PGN_BOARD;
	YY_BREAK
case 23:
# line 56 "ascan.l"
return A_PGN_OPENING;
	YY_BREAK
case 24:
# line 57 "ascan.l"
return A_PGN_VARIATION;
	YY_BREAK
case 25:
# line 58 "ascan.l"
return A_PGN_SUBVARIATION;
	YY_BREAK
case 26:
# line 59 "ascan.l"
return A_PGN_ECO;
	YY_BREAK
case 27:
# line 60 "ascan.l"
return A_PGN_NIC;
	YY_BREAK
case 28:
# line 61 "ascan.l"
return A_PGN_TIME;
	YY_BREAK
case 29:
# line 62 "ascan.l"
return A_PGN_UTCTIME;
	YY_BREAK
case 30:
# line 63 "ascan.l"
return A_PGN_UTCDATE;
	YY_BREAK
case 31:
# line 64 "ascan.l"
return A_PGN_TIMECONTROL;
	YY_BREAK
case 32:
# line 65 "ascan.l"
return A_PGN_SETUP;
	YY_BREAK
case 33:
# line 66 "ascan.l"
return A_PGN_FEN;
	YY_BREAK
case 34:
# line 67 "ascan.l"
return A_PGN_TERMINATION;
	YY_BREAK
case 35:
# line 68 "ascan.l"
return A_PGN_ANNOTATOR;
	YY_BREAK
case 36:
# line 69 "ascan.l"
return A_PGN_MODE;
	YY_BREAK
case 37:
# line 71 "ascan.l"
return A_WHITE_MOVENUM;
	YY_BREAK
case 38:
# line 72 "ascan.l"
return A_BLACK_MOVENUM;
	YY_BREAK
case 39:
# line 74 "ascan.l"
return A_PAWN_MOVE;
	YY_BREAK
case 40:
# line 75 "ascan.l"
return A_PAWN_MOVE_P;
	YY_BREAK
case 41:
# line 76 "ascan.l"
return A_PAWN_CAPTURE;
	YY_BREAK
case 42:
# line 77 "ascan.l"
return A_PAWN_CAPTURE;
	YY_BREAK
case 43:
# line 78 "ascan.l"
return A_PAWN_CAPTURE_P;
	YY_BREAK
case 44:
# line 79 "ascan.l"
return A_PAWN_CAPTURE_P;
	YY_BREAK
case 45:
# line 80 "ascan.l"
return A_PIECE_MOVE;
	YY_BREAK
case 46:
# line 81 "ascan.l"
return A_PIECE_MOVE_F;
	YY_BREAK
case 47:
# line 82 "ascan.l"
return A_PIECE_MOVE_R;
	YY_BREAK
case 48:
# line 83 "ascan.l"
return A_PIECE_MOVE_FR;
	YY_BREAK
case 49:
# line 84 "ascan.l"
return A_PIECE_CAPTURE;
	YY_BREAK
case 50:
# line 85 "ascan.l"
return A_PIECE_CAPTURE_F;
	YY_BREAK
case 51:
# line 86 "ascan.l"
return A_PIECE_CAPTURE_R;
	YY_BREAK
case 52:
# line 87 "ascan.l"
return A_PIECE_CAPTURE_FR;
	YY_BREAK
case 53:
# line 88 "ascan.l"
return A_SHORT_CASTLE;
	YY_BREAK
case 54:
# line 89 "ascan.l"
return A_LONG_CASTLE;
	YY_BREAK
case 55:
# line 91 "ascan.l"
return A_CHECK;
	YY_BREAK
case 56:
# line 92 "ascan.l"
return A_MATE;
	YY_BREAK
case 57:
# line 93 "ascan.l"
return A_GOOD_MOVE;
	YY_BREAK
case 58:
# line 94 "ascan.l"
return A_BAD_MOVE;
	YY_BREAK
case 59:
# line 95 "ascan.l"
return A_INTERESTING_MOVE;
	YY_BREAK
case 60:
# line 96 "ascan.l"
return A_DUBIOUS_MOVE;
	YY_BREAK
case 61:
# line 97 "ascan.l"
return A_BRILLIANT_MOVE;
	YY_BREAK
case 62:
# line 98 "ascan.l"
return A_BLUNDER_MOVE;
	YY_BREAK
case 63:
# line 99 "ascan.l"
return A_NAG;
	YY_BREAK
case 64:
# line 101 "ascan.l"
return A_WHITE_WINS;
	YY_BREAK
case 65:
# line 102 "ascan.l"
return A_BLACK_WINS;
	YY_BREAK
case 66:
# line 103 "ascan.l"
return A_DRAW;
	YY_BREAK
case 67:
# line 104 "ascan.l"
return A_UNFINISHED;
	YY_BREAK
case 68:
# line 106 "ascan.l"
{
				count_newlines();
				return A_COMMENT;
				}
	YY_BREAK
case 69:
# line 110 "ascan.l"
return A_VARSTART;
	YY_BREAK
case 70:
# line 111 "ascan.l"
return A_VAREND;
	YY_BREAK
case 71:
# line 112 "ascan.l"
eat_line();
	YY_BREAK
case 72:
# line 113 "ascan.l"
eat_line();
	YY_BREAK
case 73:
# line 114 "ascan.l"
linenum++;
	YY_BREAK
case 74:
# line 115 "ascan.l"
;
	YY_BREAK
case 75:
# line 116 "ascan.l"
return *yytext;
	YY_BREAK
case 76:
# line 118 "ascan.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 - 1;

		/* undo the effects of YY_DO_BEFORE_ACTION */
		*yy_cp = yy_hold_char;

		/* 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 yyinput().
		 */
		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 + 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 + 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
			{
			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 + YY_MORE_ADJ;

			    yy_act = YY_STATE_EOF((yy_start - 1) / 2);
			    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 + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

			yy_cp = yy_c_buf_p;
			yy_bp = yytext + 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 + YY_MORE_ADJ;
			goto yy_find_action;
		    }
		break;
		}

	    default:
#ifdef FLEX_DEBUG
		printf( "action # %d\n", yy_act );
#endif
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	    }
	}
    }


/* yy_get_next_buffer - try to read in a new buffer
 *
 * synopsis
 *     int yy_get_next_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 YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
    register YY_CHAR *source = yytext - 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" );

    /* try to read more data */

    /* first move last chars to start of buffer */
    number_to_move = yy_c_buf_p - yytext;

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

    if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
	/* 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;

	if ( num_to_read > YY_READ_BUF_SIZE )
	    num_to_read = YY_READ_BUF_SIZE;

	else if ( num_to_read <= 0 )
	    YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );

	/* 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 == 1 )
	    {
	    ret_val = EOB_ACT_END_OF_FILE;
	    yy_current_buffer->yy_eof_status = EOF_DONE;
	    }

	else
	    {
	    ret_val = EOB_ACT_LAST_MATCH;
	    yy_current_buffer->yy_eof_status = 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 = &yy_current_buffer->yy_ch_buf[1];

    return ( ret_val );
    }


/* yy_get_previous_state - get the state just before the EOB char was reached
 *
 * synopsis
 *     yy_state_type yy_get_previous_state();
 */

static yy_state_type yy_get_previous_state()

    {
    register yy_state_type yy_current_state;
    register YY_CHAR *yy_cp;

    register YY_CHAR *yy_bp = yytext;

    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 + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
	{
	register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
	    {
	    yy_current_state = yy_def[yy_current_state];
	    if ( yy_current_state >= 492 )
		yy_c = yy_meta[yy_c];
	    }
	yy_current_state = yy_nxt[yy_base[yy_current_state] + 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( register yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
register 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 = yy_def[yy_current_state];
	if ( yy_current_state >= 492 )
	    yy_c = yy_meta[yy_c];
	}
    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
    *yy_state_ptr++ = yy_current_state;
    yy_is_jam = (yy_current_state == 491);

    return ( yy_is_jam ? 0 : yy_current_state );
    }


#ifdef YY_USE_PROTOS
static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
#else
static void yyunput( c, yy_bp )
YY_CHAR c;
register YY_CHAR *yy_bp;
#endif

    {
    register YY_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 */
	register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
	register YY_CHAR *dest =
	    &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
	register YY_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 = 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_CHAR *yy_cp = yy_c_buf_p;

    *yy_cp = 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 = 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 + YY_MORE_ADJ;
			return ( EOF );
			}

		    YY_NEW_FILE;

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

		case EOB_ACT_CONTINUE_SCAN:
		    yy_c_buf_p = yytext + 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 = *yy_c_buf_p;
    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

    {
    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 = 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) malloc( 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 = (YY_CHAR *) malloc( (unsigned) (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;

    free( (char *) b->yy_ch_buf );
    free( (char *) 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_eof_status = EOF_NOT_SEEN;
    }
# line 118 "ascan.l"


/*
 * COUNT_NEWLINES
 *
 * Count the number of newlines in "yytext", and change them to spaces.
 * Change all '{' and '}' characters to spaces.
 */
static void
count_newlines()
{
	register char *s;

	s = yytext;
	while(*s) {
		if (*s == '\n') {
			linenum++;
			*s = ' ';
		}
		if (*s == '{' || *s == '}')
			*s = ' ';
		s++;
	}
}

/*
 * EAT_LINE
 *
 * Read from input until a newline or nul is found.
 */
static void
eat_line()
{
	int c;

	while (c = input()) {
		if (c == '\n') {
			linenum++;
			return;
		}
	}
}
