/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

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

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

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

#ifdef __TURBOC__
 #pragma warn -rch
 #pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#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.  The YYSTATE alias is for lex
 * compatibility.
 */
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START

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

#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 )

/* The following is because we cannot portably get our hands on size_t
 * (without autoconf's help, which isn't available because we want
 * flex-generated scanners to compile on their own).
 */
typedef unsigned int yy_size_t;


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.
	 */
	yy_size_t yy_buf_size;

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

	/* Whether we "own" the buffer - i.e., we know we created it,
	 * and can realloc() it to grow it, and should free() it to
	 * delete it.
	 */
	int yy_is_our_buffer;

	/* 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 we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

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

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 ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)


#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext

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(( yyconst 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 = (int) (yy_cp - yy_bp); \
	yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
	yy_c_buf_p = yy_cp;

#define YY_NUM_RULES 173
#define YY_END_OF_BUFFER 174
static yyconst short int yy_accept[1463] =
    {   0,
      172,  172,    3,    3,  174,  172,  170,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,    3,    3,    3,  172,  172,  171,  172,  170,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,    3,    3,    3,    3,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,   40,   40,  172,   41,   41,    3,   39,   39,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,   13,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,   29,   29,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,    1,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,   31,   31,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,   38,   38,  172,  172,  172,
      172,  172,    3,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,   26,   26,  172,   24,   24,  172,
      172,  172,  172,   37,   37,  172,   23,   23,  172,  172,
       35,   35,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,   27,   27,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,   12,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,   28,   28,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,   22,   22,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,   25,   25,   98,
       98,  172,    3,  172,  172,  172,  172,  172,    9,    9,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,   21,   21,  172,  172,  172,
       36,   36,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      102,  102,  172,  172,  172,  172,  172,  172,  172,  172,
        5,    5,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,   42,   42,  172,  172,  172,  172,  172,
      172,  172,  172,  172,    6,    6,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,   45,   45,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,    3,   60,
       60,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,   33,   33,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,   43,   43,  172,   58,   58,  172,  172,
      172,   30,   30,   32,   32,  172,  172,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  127,  127,  172,   18,   18,
      172,  172,  172,  172,   59,   59,  172,  172,  144,  144,
      172,  172,  172,  172,  172,   47,   47,  172,  172,  172,
      172,  172,  172,  123,  123,    3,    2,  172,  172,  172,
      172,  131,  131,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  137,  137,  138,  138,  172,  172,
      149,  149,  172,   69,   69,   72,   72,  172,  172,  172,

      172,  172,  172,   50,   50,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,    4,    4,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,   93,   93,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
       92,   92,  150,  150,   62,   62,  172,  172,  172,  172,
       48,   48,  172,  172,  172,   61,   61,  172,  172,  172,
      172,  172,  172,  172,  172,  168,  168,  172,  172,  172,

      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,   70,   70,  172,
      172,  172,  172,   88,   88,  172,  172,  172,  172,  172,
      172,  172,  163,  163,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,   15,   15,  172,  172,  172,
      172,   73,   73,  172,   63,   63,   64,   64,  109,  109,
      172,  172,   66,   66,   65,   65,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  106,  106,  172,  172,
      172,  172,  172,  172,  172,  172,  172,    7,    7,  172,
      172,  172,  172,  172,  135,  135,  172,  172,  172,  172,

      172,   67,   67,   99,   99,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,   81,   81,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,   49,   49,   86,   86,  134,  134,  172,
      172,  172,   91,   91,   74,   74,  172,  172,  172,  172,
      172,  172,    8,  172,  172,  159,  159,  172,  124,  124,
      154,  154,  172,  172,  172,  172,  172,  172,   17,   17,
      172,  172,  125,  125,  172,   46,   46,   34,   34,  172,
      172,   97,   97,  172,  172,  164,  164,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,

      103,  103,  172,  172,  172,  172,  172,  172,  172,  172,
       78,   78,  172,  172,   68,   68,  172,  172,   11,   11,
      172,  172,  172,  172,  172,  172,  113,  113,  172,  172,
      172,  172,  166,  166,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  136,  136,  108,  108,   44,
       44,   75,   75,  172,  172,  172,  172,  172,  172,  172,
      172,   57,   57,  172,  172,   76,   76,  172,  172,  153,
      153,  172,  172,  172,   14,   14,  172,  172,  172,  172,
      172,  172,  172,  172,  104,  104,  172,  172,  172,   51,
       51,  172,  172,  172,  172,  172,  172,  172,   20,   20,

      172,   87,   87,  172,  172,  101,  101,  172,  172,  172,
      107,  107,   79,   79,  172,   52,   52,   77,   77,  172,
       90,   90,  172,  172,  167,  167,  172,  172,  172,  172,
      172,  172,  172,  172,  172,  172,  172,  172,  172,  172,
      172,  172,  172,  172,  172,   84,   84,  152,  152,  172,
      172,  172,   83,   83,  172,  172,   16,   16,  172,  133,
      133,  172,  110,  110,  172,  172,  172,   10,   10,  172,
      172,  172,  172,  172,  172,  172,  172,   85,   85,  172,
      172,   19,   19,  172,   89,   89,  172,   53,   53,  111,
      111,  172,  172,  172,  172,  172,  172,  172,  172,  117,

      117,  172,  172,  146,  146,  172,  172,  172,  172,  158,
      158,  172,  172,  172,  172,  172,  172,   71,   71,  161,
      161,   82,   82,  172,  172,  172,  172,  172,  126,  126,
      130,  130,  172,   56,   56,  172,  129,  129,  172,  162,
      162,  172,  172,  172,  172,  128,  128,  172,  172,  143,
      143,  172,  172,  172,  172,  172,  172,  148,  148,  120,
      120,  172,  172,  116,  116,  172,  172,  172,  172,  172,
      172,  172,  141,  141,  172,  172,  172,  172,   54,   54,
      172,  172,  172,  172,  139,  139,  172,   94,   94,  172,
      172,  172,  165,  165,  105,  105,  172,  172,  172,  142,

      142,  172,  122,  122,  172,  145,  145,  172,  172,  172,
      140,  140,  172,  100,  100,  172,   55,   55,  172,  172,
       96,   96,   80,   80,  172,  114,  114,  169,  169,  172,
      118,  118,  115,  115,  119,  119,  147,  147,  172,  121,
      121,  172,  151,  151,  157,  157,  172,  172,  132,  132,
      160,  160,  155,  155,  172,  112,  112,   95,   95,  156,
      156,    0
    } ;

static yyconst 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,    2,    1,    1,    4,    5,    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,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
       24,   25,   26,   27,   28,   29,   30,   31,   32,   33,
        1,    1,    1,    6,    7,    1,    8,    9,   10,   11,

       12,   13,   14,   15,   16,   17,   18,   19,   20,   21,
       22,   23,   24,   25,   26,   27,   28,   29,   30,   31,
       32,   33,    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,    1,    1,    1
    } ;

static yyconst int yy_meta[34] =
    {   0,
        1,    1,    2,    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 yyconst short int yy_base[1632] =
    {   0,
        0,    6,   37,   38, 1652,    0, 1653, 1648,    0,   41,
       30,   37,   45,   52,   59,   60,   66,   66, 1629,   82,
       80,   83,   49,   91,   89,  108,  107, 1628,   47,  114,
       46, 1646,    0,   91, 1626,    0, 1643, 1653,   98,    0,
     1643, 1628, 1627, 1619,   36, 1614, 1613, 1627, 1616,   90,
     1629, 1615, 1610, 1614, 1602, 1607, 1615, 1619, 1606, 1618,
     1595, 1604, 1609, 1603, 1601, 1614, 1595, 1593, 1617, 1606,
     1597,   85, 1609, 1593, 1588, 1584, 1599, 1601,  107,  108,
     1596, 1589, 1596, 1600, 1584, 1588, 1585, 1588,  114, 1592,
     1571, 1578,  126, 1586, 1577, 1589, 1584,  134,  141,  136,

     1587, 1567, 1581, 1569,  141, 1572, 1571,   28, 1587, 1572,
      132, 1585, 1578, 1583,    0,  157,    0, 1573, 1581, 1553,
     1561, 1561, 1564, 1556, 1569, 1554, 1554, 1564, 1566, 1547,
      107,  153, 1545,  148, 1568, 1557, 1541,  165,  143, 1555,
      163, 1555, 1553, 1552, 1533, 1552, 1554, 1551, 1557, 1537,
     1529, 1554,  165,  174, 1525, 1527, 1541, 1540, 1533, 1534,
     1537, 1536,  177, 1521, 1534, 1533,  173, 1532, 1532,  194,
     1529, 1529, 1508, 1527, 1512, 1522, 1518, 1533, 1507, 1521,
     1521, 1512, 1523, 1504, 1521, 1495, 1514, 1495, 1522, 1511,
     1506,  169, 1513, 1518, 1494, 1499, 1509, 1504, 1501, 1502,

     1489, 1504, 1483, 1489, 1491, 1501, 1505, 1492, 1486, 1502,
     1501,    0, 1500, 1469,    0, 1498, 1479,    0, 1496, 1485,
      190,  177, 1494, 1467, 1484, 1486, 1485, 1473,  213, 1458,
     1487, 1474, 1485, 1458, 1473, 1476, 1471, 1480, 1469, 1478,
     1469, 1470,  197, 1653, 1475, 1448, 1473, 1452, 1452, 1470,
     1450, 1445, 1462, 1456, 1442, 1458,    0, 1463, 1437, 1442,
     1460, 1442, 1439, 1433, 1437, 1438, 1448, 1427, 1435, 1437,
      158, 1426, 1429, 1429, 1442, 1429, 1421, 1444, 1435, 1437,
     1418, 1417, 1418, 1417, 1412,  208, 1431,  210, 1653, 1435,
     1429, 1410, 1418, 1425,  200,  188, 1430, 1421, 1423, 1404,

     1421, 1420, 1419, 1423, 1412, 1421, 1400, 1409, 1412, 1407,
      210, 1402, 1394, 1409,    0, 1413, 1403, 1386, 1401, 1384,
     1398, 1390, 1406, 1400, 1394, 1379, 1402, 1389, 1394, 1373,
     1384, 1387, 1386, 1390, 1366,    0, 1393, 1379, 1386, 1390,
     1389, 1364, 1363, 1386, 1361, 1359, 1373, 1377, 1381, 1357,
     1363, 1372, 1371, 1352, 1354,  214, 1368, 1355, 1353, 1365,
     1350, 1359, 1344, 1353,    0, 1366, 1351,    0, 1364, 1339,
     1354, 1347, 1351,    0, 1359, 1349,    0, 1357, 1331, 1348,
        0, 1354, 1336, 1352,  206, 1339, 1350, 1340, 1342, 1324,
     1346, 1335, 1336, 1329, 1332,    0, 1341, 1320, 1314, 1324,

     1323, 1322, 1309, 1310, 1313, 1315, 1308, 1307, 1319, 1308,
     1322,  218, 1326, 1319, 1324, 1323, 1308, 1307, 1314, 1319,
     1318, 1307,  232, 1653, 1292, 1315,  229, 1294, 1284, 1300,
     1287, 1302, 1299, 1294,  228, 1307, 1281, 1299, 1299, 1278,
      235, 1276,    0, 1301, 1292, 1299, 1280, 1289, 1268, 1286,
     1275, 1274, 1273, 1291, 1272,  245, 1264, 1283, 1277, 1286,
     1260,    0, 1284, 1274, 1282, 1255, 1280, 1256, 1269, 1267,
     1267, 1275, 1251, 1253, 1258, 1246, 1264,    0, 1269,    0,
     1268, 1267, 1254, 1265, 1243, 1249, 1253, 1241,    0, 1260,
     1259,  221, 1237, 1236, 1229, 1234, 1230, 1228, 1234, 1230,

     1230,  224, 1232, 1238, 1237, 1227, 1226, 1234, 1218, 1223,
     1241, 1240, 1225, 1221, 1237,    0, 1236, 1224, 1234, 1233,
        0, 1232, 1214, 1205, 1223, 1228, 1221, 1210, 1214, 1224,
     1215, 1202, 1214, 1202, 1200, 1201, 1192, 1196, 1198, 1194,
     1194, 1203, 1202,  168, 1204, 1186, 1198, 1186, 1206, 1178,
        0, 1204, 1203, 1183, 1195, 1192, 1199, 1198, 1174, 1171,
        0, 1195, 1175, 1183, 1171, 1186, 1176, 1165, 1172, 1162,
     1169, 1179, 1174,    0, 1183, 1182, 1156, 1174, 1166, 1153,
     1167, 1166, 1154, 1149,    0, 1173,  247, 1147, 1165, 1170,
     1139, 1141, 1155, 1166, 1145, 1164, 1146, 1148, 1137, 1138,

     1159, 1145, 1137, 1156, 1132,    0, 1154, 1143, 1152,   78,
      102,  152,  163,  238,  162,  253,  233,  255,  259,    0,
      256,  252,  243,  264,  246,  266,  249,  238,  248,  249,
      257,  255,  248,  274,  270,  270,  269,  255,  255,  263,
      276,  277,  271,  272,  276,  276,  277,  288,  289,  270,
      281,  292,  293,  294,  295,  266,  277,  289,    0,  299,
      291,  301,  288,  303,  288,  282,  289,  301,  299,  300,
      310,  288,  282,  285,  308,  310,  306,  291,  312,  294,
      314,  315,  322,    0,  323,  314,    0,  325,  299,  310,
      318,    0,  329,    0,  330,  331,  326,  333,  334,  335,

      315,  329,  338,  339,  330,  324,  325,  324,  344,  320,
      323,  324,  323,  330,  329,  351,  342,  335,  329,  350,
      326,  357,  330,  345,  360,    0,  361,  335,    0,  363,
      355,  347,  342,  342,    0,  369,  370,  343,    0,  372,
      363,  350,  375,  376,  377,    0,  378,  372,  369,  381,
      382,  383,  363,    0,  385,  386, 1653,  378,  370,  390,
      383,    0,  392,  373,  373,  378,  379,  387,  368,  394,
      400,  395,  385,  387,  374,  400,  406,  393,  402,  410,
      411,  412,  404,  391,    0,  416,    0,  417,  399,  419,
        0,  420,  421,    0,  422,    0,  423,  424,  404,  414,

      399,  431,  422,    0,  433,  424,  405,  426,  412,  438,
      416,  440,  441,  442,  424,  437,  419,  437,  424,  436,
      449,  442,  434,  452,  453,  440,  455,  456,  457,  433,
      459,  460,  461,  445,  463,  464,  465,  437,  462,  468,
      457,    0,  470,  465,  464,  447,  448,  461,  466,  477,
      469,  459,  470,  463,  463,  483,    0,  484,  472,  462,
      488,  479,  479,  479,  478,  479,  494,  476,  496,  473,
        0,  498,    0,  499,    0,  500,  484,  502,  503,  504,
        0,  505,  489,  498,  508,    0,  509,  500,  484,  502,
      483,  500,  487,  516,  493,    0,  518,  496,  510,  514,

      522,  498,  524,  506,  503,  507,  508,  515,  522,  526,
      531,  533,  534,  537,  539,  540,  541,    0,  542,  543,
      544,  519,  541,    0,  547,  539,  540,  549,  551,  542,
      553,  534,    0,  555,  556,  557,  558,  542,  539,  561,
      538,  549,  564,  555,  566,    0,  567,  568,  545,  570,
      571,    0,  572,  563,    0,  574,    0,  575,    0,  576,
      571,  578,    0,  579,    0,  580,  556,  568,  583,  559,
      577,  573,  587,  569,  579,  573,    0,  591,  592,  566,
      576,  581,  575,  585,  598,  589,  586,    0,  601,  602,
      578,  604,  588,  585,    0,  607,  608,  609,  596,  601,

      612,    0,  613,    0,  614,  585,  616,  617,  618,  609,
      620,  621,  612,  623,  624,  604,  608,  627,  622,  629,
      617,    0,  631,  627,  615,  606,  612,  617,  628,  615,
      625,  621,  635,    0,  642,    0,  643,    0,  644,  645,
      646,  647,    0,  648,    0,  649,  650,  627,  645,  653,
      654,  654, 1653,  656,  648,    0,  659,  641,    0,  661,
        0,  662,  663,  654,  665,  666,  657,  662,    0,  671,
      672,  674,    0,  675,  662,    0,  677,    0,  678,  679,
      650,    0,  681,  682,  674,    0,  684,  672,  670,  687,
      688,  679,  681,  674,  692,  683,  670,  671,  686,  697,

        0,  698,  676,  693,  701,  702,  703,  687,  705,  706,
        0,  707,  681,  709,    0,  710,  711,  712,    0,  713,
      714,  697,  716,  717,  709,  719,    0,  720,  711,  702,
      723,  716,    0,  725,  703,  718,  708,  729,  711,  719,
      732,  713,  717,  726,  715,    0,  737,    0,  738,    0,
      739,    0,  740,  741,  722,  723,  724,  729,  740,  747,
      748,    0,  749,  751,  752,    0,  753,  754,  755,    0,
      756,  748,  752,  759,    0,  760,  754,  762,  753,  764,
      755,  766,  767,  768,    0,  769,  761,  771,  762,    0,
      773,  774,  775,  752,  760,  778,  769,  763,    0,  781,

      782,    0,  783,  784,  785,    0,  786,  777,  788,  789,
        0,  790,    0,  791,  783,    0,  794,    0,  795,  796,
        0,  797,  781,  773,    0,  800,  785,  776,  797,  778,
      805,  806,  807,  808,  792,  793,  811,  792,  813,  786,
      792,  807,  803,  799,  813,    0,  820,    0,  821,  822,
      823,  824,    0,  825,  826,  810,    0,  828,  812,    0,
      830,  808,    0,  832,  814,  834,  835,    0,  836,  837,
      838,  830,  840,  831,  842,  829,  827,    0,  845,  846,
      837,    0,  848,  849,    0,  850,  851,    0,  852,    0,
      853,  835,  855,  839,  834,  858,  859,  837,  838,    0,

      862,  863,  864,    0,  865,  849,  867,  868,  850,    0,
      870,  871,  853,  873,  857,  866,  855,    0,  877,    0,
      878,    0,  879,  880,  881,  872,  883,  859,    0,  885,
        0,  886,  887,    0,  888,  889,    0,  890,  872,    0,
      892,  876,  894,  895,  896,    0,  897,  898,  874,    0,
      900,  901,  902,  903,  904,  889,  906,    0,  907,    0,
      908,  909,  910,    0,  911,  912,  913,  914,  915,  899,
      917,  898,    0,  919,  920,  921,  922,  923,    0,  924,
      925,  901,  917,  928,    0,  929,  930,    0,  931,  932,
      933,  934,    0,  935,    0,  936,  937,  938,  939,    0,

      940,  941,    0,  942,  943,    0,  944,  945,  946,  928,
        0,  948,  949,    0,  950,  951,    0,  952,  953,  954,
        0,  955,    0,  956,  957,    0,  958,    0,  959,  960,
        0,  961,    0,  962,    0,  963,    0,  964,  965,    0,
      966,  967,    0,  968,    0,  969,  970,  971,    0,  972,
        0,  973,    0,  974,  975,    0,  976,    0,  977,    0,
      978, 1653,  980,  982,  984,  985,  987,  988,  989,  990,
      991,  992,  993,  994,  995,  996,  997,  998,  999, 1000,
     1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010,
     1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020,

     1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030,
     1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040,
     1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050,
     1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060,
     1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071,
     1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081,
     1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091,
     1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101,
     1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111,
     1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121,

     1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131,
     1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141,
     1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151,
     1152
    } ;

static yyconst short int yy_def[1632] =
    {   0,
     1463, 1462, 1464, 1464, 1462, 1465, 1462, 1466, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1467, 1467, 1467, 1465, 1466, 1462, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,

     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1468, 1465, 1469, 1467, 1467, 1467, 1467, 1470, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1471, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1472, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,

     1465, 1465, 1465, 1465, 1465, 1465, 1473, 1465, 1465, 1465,
     1465, 1468, 1468, 1465, 1469, 1469, 1467, 1470, 1470, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1474, 1465, 1475, 1465, 1465, 1465, 1465, 1476, 1465, 1477,
     1465, 1465, 1465, 1462, 1478, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1471, 1471, 1465, 1465,
     1479, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1462, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,

     1465, 1465, 1465, 1480, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1472, 1472, 1465, 1465, 1465, 1465,
     1465, 1465, 1481, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1473, 1473, 1465, 1465, 1482,
     1483, 1465, 1467, 1465, 1465, 1465, 1465, 1465, 1484, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1474, 1474, 1465, 1475, 1475, 1465,
     1465, 1465, 1465, 1476, 1476, 1465, 1477, 1477, 1465, 1465,
     1478, 1478, 1465, 1485, 1465, 1465, 1486, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1479, 1479, 1465, 1465, 1465,

     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1487, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1462, 1465, 1488, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1489, 1465, 1465, 1465, 1465,
     1465, 1465, 1480, 1480, 1465, 1490, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1481, 1481, 1465, 1465, 1465, 1491, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1482, 1482, 1483,
     1483, 1465, 1467, 1492, 1465, 1465, 1465, 1465, 1484, 1484,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,

     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1485, 1485, 1465, 1465, 1465,
     1486, 1486, 1465, 1465, 1465, 1493, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1494, 1465,
     1487, 1487, 1495, 1465, 1465, 1465, 1496, 1497, 1465, 1465,
     1488, 1488, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1489, 1489, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1490, 1490, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1498, 1465, 1499, 1465, 1465, 1465, 1465,

     1500, 1465, 1465, 1501, 1465, 1491, 1491, 1465, 1465, 1465,
     1465, 1502, 1465, 1465, 1465, 1465, 1465, 1503, 1467, 1492,
     1492, 1465, 1465, 1465, 1465, 1504, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1505, 1506, 1465,
     1465, 1507, 1465, 1508, 1509, 1465, 1465, 1465, 1493, 1493,
     1465, 1465, 1465, 1510, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1494, 1494, 1465, 1495, 1495, 1465, 1465,
     1465, 1496, 1496, 1497, 1497, 1465, 1465, 1465, 1465, 1465,

     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1511, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1512, 1465, 1465, 1465, 1498, 1498, 1465, 1499, 1499,
     1465, 1465, 1465, 1465, 1500, 1500, 1465, 1465, 1501, 1501,
     1465, 1465, 1513, 1514, 1515, 1502, 1502, 1465, 1465, 1465,
     1465, 1516, 1465, 1503, 1503, 1467, 1462, 1465, 1465, 1517,
     1465, 1504, 1504, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1518, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1505, 1505, 1506, 1506, 1465, 1465,
     1507, 1507, 1519, 1508, 1508, 1509, 1509, 1465, 1465, 1465,

     1465, 1520, 1465, 1510, 1510, 1465, 1465, 1465, 1465, 1465,
     1465, 1521, 1465, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1522, 1465, 1465, 1465, 1465, 1523, 1465,
     1524, 1525, 1526, 1465, 1465, 1527, 1528, 1465, 1465, 1465,
     1465, 1511, 1511, 1465, 1465, 1465, 1465, 1465, 1465, 1529,
     1465, 1465, 1465, 1465, 1465, 1465, 1512, 1512, 1465, 1465,
     1530, 1465, 1465, 1465, 1465, 1465, 1531, 1465, 1465, 1465,
     1513, 1513, 1514, 1514, 1515, 1515, 1465, 1465, 1532, 1533,
     1516, 1516, 1465, 1465, 1465, 1517, 1517, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1518, 1518, 1465, 1465, 1465,

     1465, 1465, 1534, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1535, 1536, 1537, 1465, 1465, 1465, 1538, 1519, 1519, 1539,
     1465, 1465, 1465, 1520, 1520, 1465, 1465, 1540, 1465, 1465,
     1541, 1465, 1521, 1521, 1542, 1543, 1465, 1465, 1465, 1465,
     1465, 1465, 1544, 1465, 1465, 1522, 1522, 1545, 1465, 1546,
     1547, 1523, 1523, 1465, 1524, 1524, 1525, 1525, 1526, 1526,
     1465, 1548, 1527, 1527, 1528, 1528, 1465, 1465, 1549, 1465,
     1465, 1465, 1465, 1465, 1465, 1465, 1529, 1529, 1465, 1465,
     1465, 1465, 1465, 1465, 1550, 1465, 1465, 1530, 1530, 1465,
     1465, 1465, 1465, 1465, 1531, 1531, 1465, 1551, 1465, 1465,

     1552, 1532, 1532, 1533, 1533, 1465, 1465, 1553, 1465, 1465,
     1465, 1465, 1465, 1465, 1554, 1465, 1465, 1465, 1465, 1555,
     1465, 1534, 1534, 1465, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1535, 1535, 1536, 1536, 1537, 1537, 1556,
     1557, 1558, 1538, 1538, 1539, 1539, 1559, 1465, 1465, 1465,
     1465, 1540, 1462, 1560, 1465, 1541, 1541, 1465, 1542, 1542,
     1543, 1543, 1561, 1465, 1465, 1562, 1465, 1465, 1544, 1544,
     1465, 1563, 1545, 1545, 1465, 1546, 1546, 1547, 1547, 1465,
     1465, 1548, 1548, 1465, 1465, 1549, 1549, 1465, 1465, 1465,
     1564, 1465, 1465, 1465, 1565, 1465, 1465, 1465, 1465, 1465,

     1550, 1550, 1465, 1465, 1566, 1465, 1567, 1465, 1465, 1568,
     1551, 1551, 1465, 1465, 1552, 1552, 1465, 1569, 1553, 1553,
     1570, 1465, 1571, 1572, 1465, 1573, 1554, 1554, 1465, 1465,
     1574, 1465, 1555, 1555, 1465, 1465, 1465, 1465, 1465, 1465,
     1465, 1465, 1465, 1465, 1465, 1556, 1556, 1557, 1557, 1558,
     1558, 1559, 1559, 1465, 1465, 1465, 1465, 1465, 1465, 1575,
     1576, 1560, 1560, 1465, 1465, 1561, 1561, 1465, 1577, 1562,
     1562, 1465, 1465, 1578, 1563, 1563, 1465, 1579, 1465, 1580,
     1465, 1465, 1465, 1581, 1564, 1564, 1465, 1465, 1465, 1565,
     1565, 1465, 1465, 1465, 1465, 1582, 1465, 1465, 1566, 1566,

     1583, 1567, 1567, 1465, 1584, 1568, 1568, 1465, 1585, 1586,
     1569, 1569, 1570, 1570, 1465, 1571, 1571, 1572, 1572, 1465,
     1573, 1573, 1465, 1465, 1574, 1574, 1465, 1465, 1465, 1465,
     1587, 1465, 1465, 1588, 1465, 1465, 1465, 1465, 1589, 1465,
     1465, 1465, 1465, 1465, 1465, 1575, 1575, 1576, 1576, 1590,
     1591, 1592, 1577, 1577, 1465, 1465, 1578, 1578, 1465, 1579,
     1579, 1465, 1580, 1580, 1465, 1593, 1594, 1581, 1581, 1465,
     1595, 1465, 1596, 1465, 1597, 1465, 1465, 1582, 1582, 1465,
     1465, 1583, 1583, 1598, 1584, 1584, 1465, 1585, 1585, 1586,
     1586, 1465, 1599, 1465, 1465, 1465, 1465, 1465, 1465, 1587,

     1587, 1600, 1601, 1588, 1588, 1465, 1465, 1602, 1465, 1589,
     1589, 1465, 1465, 1465, 1465, 1465, 1465, 1590, 1590, 1591,
     1591, 1592, 1592, 1603, 1465, 1465, 1465, 1465, 1593, 1593,
     1594, 1594, 1604, 1595, 1595, 1465, 1596, 1596, 1465, 1597,
     1597, 1465, 1465, 1605, 1465, 1598, 1598, 1606, 1465, 1599,
     1599, 1465, 1465, 1607, 1608, 1465, 1465, 1600, 1600, 1601,
     1601, 1465, 1609, 1602, 1602, 1465, 1610, 1465, 1611, 1465,
     1465, 1465, 1603, 1603, 1612, 1465, 1613, 1465, 1604, 1604,
     1614, 1465, 1465, 1615, 1605, 1605, 1616, 1606, 1606, 1465,
     1617, 1618, 1607, 1607, 1608, 1608, 1465, 1619, 1620, 1609,

     1609, 1621, 1610, 1610, 1622, 1611, 1611, 1465, 1623, 1465,
     1612, 1612, 1624, 1613, 1613, 1625, 1614, 1614, 1465, 1465,
     1615, 1615, 1616, 1616, 1626, 1617, 1617, 1618, 1618, 1627,
     1619, 1619, 1620, 1620, 1621, 1621, 1622, 1622, 1628, 1623,
     1623, 1465, 1624, 1624, 1625, 1625, 1629, 1630, 1626, 1626,
     1627, 1627, 1628, 1628, 1631, 1629, 1629, 1630, 1630, 1631,
     1631,    0, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,

     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,

     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462
    } ;

static yyconst short int yy_nxt[1687] =
    {   0,
     1462,   39,    7,    8,   40,    9,    6,    6,    7,    8,
        6,    9,    6,   10,   11,   12,   13,   14,   15,   16,
       17,   18,    6,   19,   20,   21,   22,   23,   24,    6,
       25,   26,   27,   28,   29,   30,   31,   32,    6,    7,
        7,   48,   34,   34,   50,  123,  205,  112,   49,   35,
       41,   51,   54,  206,  106,  124,   55,   86,   52,   42,
       56,   43,   57,   44,   53,   45,   60,   46,   47,   87,
      113,   64,   58,   67,  107,   88,   70,   61,   65,  744,
       62,   68,   59,   63,   66,   71,   72,   79,   69,   75,
       82,   73,  116,   76,   83,  117,   93,   77,   89,   39,

       94,   80,   40,  745,   84,   81,   90,   85,  231,   78,
      129,  152,   91,  153,  130,   92,   95,   96,  101,   97,
      160,  108,  102,  109,  161,  110,   98,  232,  164,  111,
       99,  103,  165,  162,  100,  180,  166,  163,  104,  175,
      176,  186,  189,  192,  245,  187,  181,  193,  199,  238,
      209,  200,  190,  747,  233,  188,  201,  210,  116,  191,
      194,  117,  246,  202,  211,  234,  243,  244,  239,  248,
      748,  262,  407,  235,  288,  289,  263,  678,  249,  236,
      264,  265,  266,  267,  268,  408,  269,  679,  270,  319,
      282,  283,  347,  320,  751,  321,  345,  346,  243,  244,

      271,  272,  284,  273,  292,  434,  293,  431,  348,  423,
      424,  288,  289,  294,  435,  432,  295,  451,  518,  296,
      355,  497,  356,  357,  433,  452,  519,  627,  358,  545,
      359,  546,  547,  423,  424,  360,  563,  361,  362,  572,
      363,  498,  580,  548,  564,  581,  596,  628,  638,  639,
      749,  597,  573,  718,  752,  753,  755,  621,  750,  582,
      756,  757,  719,  758,  759,  760,  761,  763,  764,  765,
      766,  767,  768,  769,  770,  771,  772,  773,  774,  775,
      776,  777,  778,  779,  780,  781,  782,  783,  784,  786,
      788,  789,  790,  792,  793,  795,  797,  798,  799,  800,

      660,  801,  802,  803,  805,  806,  807,  808,  809,  810,
      811,  812,  813,  814,  815,  816,  817,  818,  819,  820,
      821,  822,  823,  824,  685,  825,  688,  826,  827,  828,
      693,  695,  829,  830,  831,  832,  833,  834,  835,  836,
      837,  838,  839,  840,  841,  843,  844,  845,  846,  847,
      848,  849,  850,  851,  852,  853,  854,  856,  858,  859,
      860,  861,  727,  862,  730,  855,  863,  864,  865,  866,
      736,  867,  868,  740,  869,  870,  872,  874,  876,  747,
      877,  878,  879,  880,  882,  883,  755,  756,  757,  884,
      885,  887,  888,  763,  889,  890,  891,  892,  893,  894,

      895,  897,  898,  899,  900,  901,  902,  903,  904,  905,
      906,  911,  912,  913,  914,  915,  907,  786,  788,  916,
      917,  792,  919,  795,  797,  920,  908,  909,  921,  922,
      923,  910,  925,  926,  805,  927,  928,  929,  930,  931,
      932,  934,  935,  936,  937,  938,  939,  940,  941,  942,
      943,  944,  945,  947,  948,  949,  950,  951,  953,  954,
      956,  958,  960,  961,  962,  964,  966,  967,  968,  969,
      970,  843,  971,  972,  973,  974,  975,  976,  978,  979,
      980,  981,  982,  984,  985,  858,  986,  987,  983,  989,
      990,  991,  992,  993,  994,  996,  997,  998,  999,  872,

      874,  876, 1000, 1001, 1003, 1005,  882, 1006, 1007, 1008,
      887, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016,  897,
     1017, 1018, 1019, 1020, 1021, 1023, 1024, 1025, 1026, 1027,
     1028, 1030, 1035, 1032, 1037, 1039, 1029, 1033, 1040, 1031,
     1041, 1042, 1044,  919, 1046, 1047, 1048, 1049,  925, 1050,
     1051, 1053, 1054, 1055, 1057, 1058,  934, 1060, 1062, 1063,
     1064, 1065, 1066, 1067, 1068, 1070, 1071, 1072,  947, 1074,
     1075, 1077, 1079,  953, 1080,  956,  958,  960, 1081, 1083,
      964,  966, 1084, 1085, 1087, 1088, 1089, 1090, 1091, 1092,
     1093, 1094,  978, 1095, 1096, 1097, 1098, 1099, 1100, 1102,

     1103, 1104,  989, 1105, 1106, 1107, 1108, 1109,  996, 1110,
     1112, 1113, 1114, 1116, 1003, 1005, 1117, 1118, 1120, 1121,
     1122, 1123, 1124, 1125, 1126, 1128, 1129, 1130, 1131, 1132,
     1134, 1135, 1023, 1136, 1137, 1138, 1139, 1140, 1141, 1142,
     1143, 1144, 1145, 1035, 1037, 1039, 1147, 1149, 1151, 1044,
     1046, 1153, 1154, 1155, 1160, 1161, 1053, 1163, 1164, 1156,
     1057, 1165, 1060, 1062, 1167, 1168, 1169, 1171, 1172, 1157,
     1158, 1173, 1070, 1174, 1159, 1176, 1074, 1177, 1077, 1079,
     1178, 1179, 1083, 1180, 1181, 1087, 1182, 1183, 1184, 1186,
     1187, 1188, 1189, 1191, 1192, 1193, 1194, 1195, 1196, 1102,

     1197, 1198, 1200, 1201, 1203, 1204, 1205, 1207, 1112, 1208,
     1209, 1116, 1210, 1212, 1120, 1214, 1215, 1217, 1219, 1220,
     1222, 1128, 1223, 1224, 1226, 1227, 1134, 1228, 1229, 1230,
     1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, 1147, 1149,
     1151, 1153, 1239, 1240, 1241, 1242, 1243, 1244, 1247, 1249,
     1163, 1245, 1250, 1251, 1167, 1252, 1254, 1171, 1255, 1256,
     1258, 1176, 1259, 1261, 1262, 1264, 1265, 1266, 1267, 1269,
     1186, 1270, 1271, 1272, 1191, 1273, 1275, 1276, 1277, 1279,
     1280, 1281, 1200, 1283, 1203, 1284, 1286, 1207, 1287, 1289,
     1291, 1212, 1214, 1274, 1292, 1217, 1219, 1293, 1222, 1294,

     1295, 1226, 1296, 1297, 1298, 1299, 1301, 1302, 1303, 1305,
     1306, 1307, 1308, 1309, 1311, 1312, 1313, 1314, 1315, 1316,
     1317, 1247, 1249, 1319, 1321, 1323, 1254, 1324, 1325, 1258,
     1326, 1261, 1327, 1264, 1328, 1330, 1332, 1269, 1333, 1335,
     1336, 1338, 1339, 1341, 1342, 1343, 1279, 1344, 1345, 1283,
     1347, 1286, 1348, 1289, 1291, 1349, 1351, 1352, 1353, 1354,
     1355, 1356, 1357, 1301, 1359, 1361, 1305, 1362, 1363, 1365,
     1366, 1311, 1367, 1368, 1369, 1370, 1371, 1372, 1319, 1321,
     1323, 1374, 1375, 1376, 1377, 1378, 1330, 1332, 1380, 1335,
     1381, 1338, 1382, 1341, 1383, 1384, 1386, 1387, 1347, 1389,

     1390, 1351, 1391, 1392, 1394, 1396, 1397, 1398, 1359, 1361,
     1399, 1401, 1365, 1402, 1404, 1405, 1407, 1408, 1409, 1410,
     1374, 1412, 1413, 1415, 1416, 1380, 1418, 1419, 1420, 1422,
     1386, 1424, 1389, 1425, 1427, 1429, 1394, 1396, 1430, 1432,
     1434, 1401, 1436, 1404, 1438, 1407, 1439, 1441, 1442, 1412,
     1444, 1415, 1446, 1418, 1447, 1448, 1422, 1424, 1450, 1427,
     1429, 1452, 1432, 1434, 1436, 1438, 1454, 1441, 1455, 1444,
     1446, 1457, 1459, 1450, 1452, 1454, 1461, 1457, 1459, 1461,
        6,    6,   33,   33,   36,   37,   37,  115,  212,  215,
      218,  257,  315,  336,  365,  368,  374,  377,  381,  396,

      443,  462,  478,  480,  489,  516,  521,  551,  561,  574,
      585,  606,  620,  659,  684,  687,  692,  694,  726,  729,
      735,  739,  746,  754,  762,  785,  787,  791,  794,  796,
      804,  842,  857,  871,  873,  875,  881,  886,  896,  918,
      924,  933,  946,  952,  955,  957,  959,  963,  965,  977,
      988,  995, 1002, 1004, 1022, 1034, 1036, 1038, 1043, 1045,
     1052, 1052, 1056, 1059, 1061, 1069, 1073, 1076, 1078, 1082,
     1086, 1101, 1111, 1115, 1119, 1127, 1133, 1146, 1148, 1150,
     1152, 1162, 1166, 1170, 1175, 1185, 1190, 1199, 1202, 1206,
     1211, 1213, 1216, 1218, 1221, 1225, 1246, 1248, 1253, 1257,

     1260, 1263, 1268, 1278, 1282, 1285, 1288, 1290, 1300, 1304,
     1310, 1318, 1320, 1322, 1329, 1331, 1334, 1337, 1340, 1346,
     1350, 1358, 1360, 1364, 1373, 1379, 1385, 1388, 1393, 1395,
     1400, 1403, 1406, 1411, 1414, 1417, 1421, 1423, 1426, 1428,
     1431, 1433, 1435, 1437, 1440, 1443, 1445, 1449, 1451, 1453,
     1456, 1458, 1460,  743,  742,  607,  741,  740,  738,  737,
      736,  734,  733,  732,  731,  730,  728,  727,  725,  724,
      723,  722,  721,  720,  586,  717,  716,  715,  714,  713,
      712,  711,  710,  709,  575,  708,  707,  706,  705,  704,
      703,  702,  701,  700,  699,  698,  562,  697,  696,  695,

      693,  691,  690,  689,  688,  552,  686,  685,  683,  682,
      681,  680,  677,  676,  675,  674,  673,  672,  671,  670,
      669,  668,  667,  666,  665,  664,  663,  662,  661,  660,
      658,  657,  656,  522,  655,  654,  653,  517,  652,  651,
      650,  649,  648,  647,  646,  645,  644,  643,  642,  641,
      640,  637,  636,  635,  634,  633,  632,  631,  630,  629,
      626,  490,  625,  624,  623,  622,  621,  619,  618,  481,
      479,  617,  616,  615,  614,  613,  612,  611,  610,  609,
      608,  607,  605,  604,  603,  463,  602,  601,  600,  599,
      598,  595,  594,  593,  592,  591,  590,  589,  588,  587,

      586,  584,  444,  583,  579,  578,  577,  576,  575,  571,
      570,  569,  568,  567,  566,  565,  562,  560,  559,  558,
      557,  556,  555,  554,  553,  552,  550,  549,  544,  543,
      542,  541,  540,  539,  538,  537,  536,  535,  534,  533,
      532,  531,  397,  530,  529,  528,  527,  526,  525,  524,
      523,  522,  520,  517,  515,  382,  514,  513,  378,  512,
      375,  511,  510,  509,  508,  369,  507,  366,  506,  505,
      504,  503,  502,  501,  500,  499,  496,  495,  494,  493,
      492,  491,  490,  488,  487,  486,  485,  484,  483,  482,
      481,  479,  477,  476,  337,  475,  474,  473,  472,  471,

      470,  469,  468,  467,  466,  465,  464,  463,  461,  460,
      459,  458,  457,  456,  316,  455,  454,  453,  450,  449,
      448,  447,  446,  445,  444,  442,  441,  440,  439,  438,
      437,  436,  430,  429,  428,  427,  426,  425,  422,  421,
      420,  419,  418,  417,  416,  415,  414,  413,  412,  411,
      410,  409,  406,  405,  404,  403,  402,  401,  400,  399,
      398,  397,  395,  394,  258,  393,  392,  391,  390,  389,
      388,  387,  386,  385,  384,  383,  382,  380,  379,  378,
      376,  375,  373,  372,  371,  370,  369,  367,  366,  364,
      354,  353,  352,  351,  350,  349,  344,  219,  343,  216,

      342,  213,  341,  340,  339,  338,  337,  335,  334,  333,
      332,  331,  330,  329,  328,  327,  326,  325,  324,  323,
      322,  318,  317,  316,  314,  313,  312,  311,  310,  309,
      308,  307,  306,  305,  304,  303,  302,  301,  300,  299,
      298,  297,  291,  290,  287,  286,  285,  281,  280,  279,
      278,  277,  276,  275,  274,  261,  260,  259,  258,  256,
      255,  254,  253,  252,  251,  250,  247,  242,  241,  240,
      237,  230,  229,  228,  227,  226,  225,  224,  223,  222,
      221,  220,  219,  217,  216,  214,  213,  208,  207,  204,
      203,  198,  197,  196,  195,  185,  184,  183,  182,  179,

      178,  177,  174,  173,  172,  171,  170,  169,  168,  167,
      159,  158,  157,  156,  155,  154,  151,  150,  149,  148,
      147,  146,  145,  144,  143,  142,  141,  140,  139,  138,
      137,  136,  135,  134,  133,  132,  131,  128,  127,  126,
      125,  122,  121,  120,  119,   38,  118,  114,  105,   74,
       38, 1462,    5, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462
    } ;

static yyconst short int yy_chk[1687] =
    {   0,
        0,    9,    1,    1,    9,    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,    3,
        4,   11,    3,    4,   12,   45,  108,   31,   11,    4,
       10,   12,   13,  108,   29,   45,   13,   23,   12,   10,
       13,   10,   14,   10,   12,   10,   15,   10,   10,   23,
       31,   16,   14,   17,   29,   23,   18,   15,   16,  610,
       15,   17,   14,   15,   16,   18,   18,   21,   17,   20,
       22,   18,   34,   20,   22,   34,   25,   20,   24,   39,

       25,   21,   39,  611,   22,   21,   24,   22,  131,   20,
       50,   72,   24,   72,   50,   24,   25,   26,   27,   26,
       79,   30,   27,   30,   79,   30,   26,  131,   80,   30,
       26,   27,   80,   79,   26,   93,   80,   79,   27,   89,
       89,   98,   99,  100,  139,   98,   93,  100,  105,  134,
      111,  105,   99,  612,  132,   98,  105,  111,  116,   99,
      100,  116,  139,  105,  111,  132,  138,  138,  134,  141,
      613,  153,  271,  132,  167,  167,  153,  544,  141,  132,
      153,  154,  154,  154,  154,  271,  154,  544,  154,  192,
      163,  163,  222,  192,  615,  192,  221,  221,  243,  243,

      154,  154,  163,  154,  170,  296,  170,  295,  222,  286,
      286,  288,  288,  170,  296,  295,  170,  311,  385,  170,
      229,  356,  229,  229,  295,  311,  385,  492,  229,  412,
      229,  412,  412,  423,  423,  229,  427,  229,  229,  435,
      229,  356,  441,  412,  427,  441,  456,  492,  502,  502,
      614,  456,  435,  587,  616,  617,  618,  621,  614,  441,
      619,  619,  587,  622,  623,  624,  625,  626,  627,  628,
      629,  630,  631,  632,  633,  634,  635,  636,  637,  638,
      639,  640,  641,  642,  643,  644,  645,  646,  647,  648,
      649,  650,  651,  652,  653,  654,  655,  656,  657,  658,

      660,  661,  662,  663,  664,  665,  666,  667,  668,  669,
      670,  671,  672,  673,  674,  675,  676,  677,  678,  679,
      680,  681,  682,  683,  685,  686,  688,  689,  690,  691,
      693,  695,  696,  697,  698,  699,  700,  701,  702,  703,
      704,  705,  706,  707,  708,  709,  710,  711,  712,  713,
      714,  715,  716,  717,  718,  719,  720,  721,  722,  723,
      724,  725,  727,  728,  730,  720,  731,  732,  733,  734,
      736,  737,  738,  740,  741,  742,  743,  744,  745,  747,
      748,  749,  750,  751,  752,  753,  755,  756,  756,  758,
      759,  760,  761,  763,  764,  765,  766,  767,  768,  769,

      770,  771,  772,  773,  774,  775,  776,  777,  778,  779,
      779,  780,  781,  782,  783,  784,  779,  786,  788,  789,
      790,  792,  793,  795,  797,  798,  779,  779,  799,  800,
      801,  779,  802,  803,  805,  806,  807,  808,  809,  810,
      811,  812,  813,  814,  815,  816,  817,  818,  819,  820,
      821,  822,  823,  824,  825,  826,  827,  828,  829,  830,
      831,  832,  833,  834,  835,  836,  837,  838,  839,  840,
      841,  843,  844,  845,  846,  847,  848,  849,  850,  851,
      852,  853,  854,  855,  856,  858,  859,  860,  854,  861,
      862,  863,  864,  865,  866,  867,  868,  869,  870,  872,

      874,  876,  877,  878,  879,  880,  882,  883,  884,  885,
      887,  888,  889,  890,  891,  892,  893,  894,  895,  897,
      898,  899,  900,  901,  902,  903,  904,  905,  906,  907,
      908,  909,  911,  910,  912,  913,  908,  910,  914,  909,
      915,  916,  917,  919,  920,  921,  922,  923,  925,  926,
      927,  928,  929,  930,  931,  932,  934,  935,  936,  937,
      938,  939,  940,  941,  942,  943,  944,  945,  947,  948,
      949,  950,  951,  953,  954,  956,  958,  960,  961,  962,
      964,  966,  967,  968,  969,  970,  971,  972,  973,  974,
      975,  976,  978,  979,  980,  981,  982,  983,  984,  985,

      986,  987,  989,  990,  991,  992,  993,  994,  996,  997,
      998,  999, 1000, 1001, 1003, 1005, 1006, 1007, 1008, 1009,
     1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019,
     1020, 1021, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030,
     1031, 1032, 1033, 1035, 1037, 1039, 1040, 1041, 1042, 1044,
     1046, 1047, 1048, 1049, 1050, 1051, 1052, 1054, 1055, 1049,
     1057, 1058, 1060, 1062, 1063, 1064, 1065, 1066, 1067, 1049,
     1049, 1068, 1070, 1071, 1049, 1072, 1074, 1075, 1077, 1079,
     1080, 1081, 1083, 1084, 1085, 1087, 1088, 1089, 1090, 1091,
     1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1102,

     1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1112, 1113,
     1114, 1116, 1117, 1118, 1120, 1121, 1122, 1123, 1124, 1125,
     1126, 1128, 1129, 1130, 1131, 1132, 1134, 1135, 1136, 1137,
     1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1147, 1149,
     1151, 1153, 1154, 1155, 1156, 1157, 1158, 1159, 1160, 1161,
     1163, 1159, 1164, 1165, 1167, 1168, 1169, 1171, 1172, 1173,
     1174, 1176, 1177, 1178, 1179, 1180, 1181, 1182, 1183, 1184,
     1186, 1187, 1188, 1189, 1191, 1192, 1193, 1194, 1195, 1196,
     1197, 1198, 1200, 1201, 1203, 1204, 1205, 1207, 1208, 1209,
     1210, 1212, 1214, 1192, 1215, 1217, 1219, 1220, 1222, 1223,

     1224, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 1233, 1234,
     1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, 1243, 1244,
     1245, 1247, 1249, 1250, 1251, 1252, 1254, 1255, 1256, 1258,
     1259, 1261, 1262, 1264, 1265, 1266, 1267, 1269, 1270, 1271,
     1272, 1273, 1274, 1275, 1276, 1277, 1279, 1280, 1281, 1283,
     1284, 1286, 1287, 1289, 1291, 1292, 1293, 1294, 1295, 1296,
     1297, 1298, 1299, 1301, 1302, 1303, 1305, 1306, 1307, 1308,
     1309, 1311, 1312, 1313, 1314, 1315, 1316, 1317, 1319, 1321,
     1323, 1324, 1325, 1326, 1327, 1328, 1330, 1332, 1333, 1335,
     1336, 1338, 1339, 1341, 1342, 1343, 1344, 1345, 1347, 1348,

     1349, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1359, 1361,
     1362, 1363, 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1372,
     1374, 1375, 1376, 1377, 1378, 1380, 1381, 1382, 1383, 1384,
     1386, 1387, 1389, 1390, 1391, 1392, 1394, 1396, 1397, 1398,
     1399, 1401, 1402, 1404, 1405, 1407, 1408, 1409, 1410, 1412,
     1413, 1415, 1416, 1418, 1419, 1420, 1422, 1424, 1425, 1427,
     1429, 1430, 1432, 1434, 1436, 1438, 1439, 1441, 1442, 1444,
     1446, 1447, 1448, 1450, 1452, 1454, 1455, 1457, 1459, 1461,
     1463, 1463, 1464, 1464, 1465, 1466, 1466, 1467, 1468, 1469,
     1470, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479,

     1480, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489,
     1490, 1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499,
     1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509,
     1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519,
     1520, 1521, 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529,
     1530, 1531, 1532, 1533, 1534, 1535, 1536, 1537, 1538, 1539,
     1540, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548,
     1549, 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, 1558,
     1559, 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, 1568,
     1569, 1570, 1571, 1572, 1573, 1574, 1575, 1576, 1577, 1578,

     1579, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588,
     1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598,
     1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, 1607, 1608,
     1609, 1610, 1611, 1612, 1613, 1614, 1615, 1616, 1617, 1618,
     1619, 1620, 1621, 1622, 1623, 1624, 1625, 1626, 1627, 1628,
     1629, 1630, 1631,  609,  608,  607,  605,  604,  603,  602,
      601,  600,  599,  598,  597,  596,  595,  594,  593,  592,
      591,  590,  589,  588,  586,  584,  583,  582,  581,  580,
      579,  578,  577,  576,  575,  573,  572,  571,  570,  569,
      568,  567,  566,  565,  564,  563,  562,  560,  559,  558,

      557,  556,  555,  554,  553,  552,  550,  549,  548,  547,
      546,  545,  543,  542,  541,  540,  539,  538,  537,  536,
      535,  534,  533,  532,  531,  530,  529,  528,  527,  526,
      525,  524,  523,  522,  520,  519,  518,  517,  515,  514,
      513,  512,  511,  510,  509,  508,  507,  506,  505,  504,
      503,  501,  500,  499,  498,  497,  496,  495,  494,  493,
      491,  490,  488,  487,  486,  485,  484,  483,  482,  481,
      479,  477,  476,  475,  474,  473,  472,  471,  470,  469,
      468,  467,  466,  465,  464,  463,  461,  460,  459,  458,
      457,  455,  454,  453,  452,  451,  450,  449,  448,  447,

      446,  445,  444,  442,  440,  439,  438,  437,  436,  434,
      433,  432,  431,  430,  429,  428,  426,  425,  422,  421,
      420,  419,  418,  417,  416,  415,  414,  413,  411,  410,
      409,  408,  407,  406,  405,  404,  403,  402,  401,  400,
      399,  398,  397,  395,  394,  393,  392,  391,  390,  389,
      388,  387,  386,  384,  383,  382,  380,  379,  378,  376,
      375,  373,  372,  371,  370,  369,  367,  366,  364,  363,
      362,  361,  360,  359,  358,  357,  355,  354,  353,  352,
      351,  350,  349,  348,  347,  346,  345,  344,  343,  342,
      341,  340,  339,  338,  337,  335,  334,  333,  332,  331,

      330,  329,  328,  327,  326,  325,  324,  323,  322,  321,
      320,  319,  318,  317,  316,  314,  313,  312,  310,  309,
      308,  307,  306,  305,  304,  303,  302,  301,  300,  299,
      298,  297,  294,  293,  292,  291,  290,  287,  285,  284,
      283,  282,  281,  280,  279,  278,  277,  276,  275,  274,
      273,  272,  270,  269,  268,  267,  266,  265,  264,  263,
      262,  261,  260,  259,  258,  256,  255,  254,  253,  252,
      251,  250,  249,  248,  247,  246,  245,  242,  241,  240,
      239,  238,  237,  236,  235,  234,  233,  232,  231,  230,
      228,  227,  226,  225,  224,  223,  220,  219,  217,  216,

      214,  213,  211,  210,  209,  208,  207,  206,  205,  204,
      203,  202,  201,  200,  199,  198,  197,  196,  195,  194,
      193,  191,  190,  189,  188,  187,  186,  185,  184,  183,
      182,  181,  180,  179,  178,  177,  176,  175,  174,  173,
      172,  171,  169,  168,  166,  165,  164,  162,  161,  160,
      159,  158,  157,  156,  155,  152,  151,  150,  149,  148,
      147,  146,  145,  144,  143,  142,  140,  137,  136,  135,
      133,  130,  129,  128,  127,  126,  125,  124,  123,  122,
      121,  120,  119,  118,  114,  113,  112,  110,  109,  107,
      106,  104,  103,  102,  101,   97,   96,   95,   94,   92,

       91,   90,   88,   87,   86,   85,   84,   83,   82,   81,
       78,   77,   76,   75,   74,   73,   71,   70,   69,   68,
       67,   66,   65,   64,   63,   62,   61,   60,   59,   58,
       57,   56,   55,   54,   53,   52,   51,   49,   48,   47,
       46,   44,   43,   42,   41,   37,   35,   32,   28,   19,
        8,    5, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462,
     1462, 1462, 1462, 1462, 1462, 1462
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
char *yytext;
#line 1 "loader.l"
#define INITIAL 0
#line 2 "loader.l"
/*
 * static char *rcsid_object_c =
 *   "$Id: loader.l,v 1.2 1998/05/16 02:15:20 master Exp master $";
 */

/*
    CrossFire, A Multiplayer game for X-windows

    Copyright (C) 1994 Mark Wedel
    Copyright (C) 1992 Frank Tore Johansen

    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., 675 Mass Ave, Cambridge, MA 02139, USA.

    The author can be reached via e-mail to master@rahul.net
*/

/* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects.
   sub/add_weight will transcend the environment updating the carrying
   variable. */


#include <global.h>
#include <loader.h>
#include <newserver.h>

#define NEW_LOAD

/* All the variable names.  Each entry should correspond to the 
 * V_ vlaue in loader.h (that is, the 20'th value in this array should
 * correspond to the 20'th V_(value) in loader.h)  The V_??? get
 * used as indexes into this array.
 */

/* If you change this list (add/delete/rename), also update the list
 * in crossedit/Attr.c, around line 360.  That list is the variables
 * that can be set in crossedit for various objects.
 */
static char *variable_const[NR_OF_VARIABLES] = {
  "Object","name","race","slaying","msg","endmsg",
  "Inventory","arch","other_arch","More",
  "animation","end","last_heal","last_sp","last_grace","last_eat",
  "speed","speed_left","slow_move",
  "face","Str","Dex","Con","Wis","Cha","Int","Pow","hp","maxhp","sp","maxsp",
  "grace","maxgrace",
  "exp","food","dam","wc","ac","x","y","nrof","level","direction",
  "type","material","value", "weight","carrying",
  "immune","protected","attacktype","vulnerable",
  "path_attuned","path_repelled","path_denied",
  "invisible","magic","state","alive","applied","unpaid","need_an","need_ie",
  "no_pick","no_pass","walk_on","walk_off","fly_on","fly_off","is_animated",
  "flying","monster",
  "friendly","generator","is_thrown","auto_apply","treasure",
  "apply_once","see_invisible","can_roll","is_turning","is_turnable",
  "is_used_up","identified","reflecting","changing","splitting","hitback",
  "startequip","blocksview","editable","undead","scared","unaggressive",
  "reflect_missile","reflect_spell","no_magic",
  "wiz","was_wiz","no_fix_player","tear_down", "luck",
  "run_away","pass_thru",
  "can_pass_thru","pick_up","anim_speed","container","no_drop",
  "no_pretext","will_apply","random_movement", "can_apply",
  "can_cast_spell","can_use_scroll","can_use_wand","can_use_bow",
  "can_use_armour","can_use_weapon","can_use_ring","has_ready_wand",
  "has_ready_bow","xrays","is_floor","lifesave","no_strength",
  "sleep","stand_still","random_move","only_attack","armour",
  "attack_movement","move_state","confused","stealth","connected",
  "cursed","damned","see_anywhere","known_magical","known_cursed",
  "can_use_skill","been_applied","title","has_ready_rod","can_use_rod",
  "has_ready_horn","can_use_horn","expmul",
  "unique","make_invisible","inv_locked",
  "is_wooded","is_hilly","has_ready_skill","has_ready_weapon",
  "no_skill_ident","glow_radius","is_blind","can_see_in_dark",
  "is_cauldron","randomitems","is_dust", "no_steal",
#ifdef NPC_PROG
  "npc_status","npc_program",
#endif
};

#define YY_DECL int lex_load(object *op)

static char *yval();

#define FREE_AND_COPY(sv,nv) { if (sv) free_string(sv); sv=add_string(nv); }
#define SET_OR_CLEAR_FLAG(op, flag, val) \
	{ if (val) SET_FLAG(op, flag); else CLEAR_FLAG(op, flag); }

#define IVAL	atoi(yval())
#define FVAL	atof(yval())

#define MESSAGE 1

/* Don't have to link with -lfl with this */
/* need yy_push_state, yy_pop_state */
#define YY_STACK_USED 1

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

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap YY_PROTO(( void ));
#else
extern int yywrap YY_PROTO(( void ));
#endif
#endif

#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif

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

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

#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif

#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif

#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 = '*', n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	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

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		yy_current_buffer->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

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

#line 117 "loader.l"



/* Declare some local variables */
    char msgbuf[HUGE_BUF];
    int ismore=0;




	if ( yy_init )
		{
		yy_init = 0;

#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_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();
		}

	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;
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yy_last_accepting_state = yy_current_state;
				yy_last_accepting_cpos = 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 >= 1463 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_base[yy_current_state] != 1653 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			yy_act = 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 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = yy_hold_char;
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			goto yy_find_action;

case 1:
*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_RULE_SETUP
#line 126 "loader.l"
{	BEGIN( MESSAGE ); msgbuf[0]='\0'; }
	YY_BREAK
case 2:
*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_RULE_SETUP
#line 127 "loader.l"
{	BEGIN( INITIAL );
			op->msg=add_string(msgbuf);
			/* Just print a warning so we can be reasonably safe
			 * about not overflowing the buffer.
			 */
			if (strlen(op->msg) > (HUGE_BUF/2))
			    LOG(llevDebug, "\n\tWarning message length > %d (max allowed=%d): %d\n>%.80s<\n",
				HUGE_BUF/2, HUGE_BUF, strlen(op->msg),op->msg);
		    }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 136 "loader.l"
{strcat(msgbuf, yytext); strcat(msgbuf,"\n"); }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 139 "loader.l"
{	char *yv=yval();

			if (*yv=='\0') {
			    LOG(llevError,"Object lacks name.\n");
			    return LL_IGNORED;
			}
			if (op->arch!=NULL) op->arch->name=add_string(yv);
			op->name = add_string(yv);
		    }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 149 "loader.l"
{	char *yv=yval();

			if (*yv=='\0') LOG(llevError,"Name without val\n");
			else FREE_AND_COPY(op->name, yv);
		    }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 154 "loader.l"
FREE_AND_COPY(op->race,yval());
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 155 "loader.l"
FREE_AND_COPY(op->slaying, yval());
	YY_BREAK
case 8:
*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_RULE_SETUP
#line 156 "loader.l"
LOG(llevError,"Got depreciated Inventory command?\n");
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 159 "loader.l"
{	/* If op->arch has been set, then this new object
			 * must be part of the inventory.  So process
			 * appropriately.
			 */
			if (op->arch) {
			    object *tmp;

			    tmp=get_object();
			    tmp->arch = find_archetype(yval());
			    if (tmp->arch!=NULL) 
				copy_object(&tmp->arch->clone,tmp);
			    lex_load(tmp);
			    insert_ob_in_ob(tmp,op);
			}
			/* This is the actual archetype definition then */
			else {
			    op->arch=find_archetype(yval());
			    if (op->arch!=NULL) copy_object(&op->arch->clone,op);
			}
		    }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 180 "loader.l"
op->other_arch=find_archetype(yval());
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 181 "loader.l"
{	
			op->animation_id = find_animation(yval());
			SET_FLAG(op,FLAG_ANIMATE);
		    }
	YY_BREAK
case 12:
*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_RULE_SETUP
#line 186 "loader.l"
{ /* We need to record that this is a multipart object,
		       * so the calling function can glue things back together
		       */
			ismore=1;
		    }
	YY_BREAK
case 13:
*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_RULE_SETUP
#line 192 "loader.l"
{ if (ismore) return LL_MORE; else return LL_NORMAL; }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 193 "loader.l"
op->last_heal = IVAL;
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 194 "loader.l"
op->last_sp = IVAL;
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 195 "loader.l"
op->last_grace = IVAL;
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 196 "loader.l"
op->last_eat = IVAL;
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 197 "loader.l"
{	op->speed = FVAL;
			if (op->speed<0) op->speed_left = op->speed_left-RANDOM()%100/100.0;
			update_ob_speed(op);
		    }
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 201 "loader.l"
op->speed_left = FVAL;
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 202 "loader.l"
{	SET_SLOW_PENALTY(op,FVAL);
			SET_FLAG(op, FLAG_SLOW_MOVE);
		    }
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 205 "loader.l"
op->face = &new_faces[FindFace(yval(), 0)];
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 206 "loader.l"
op->stats.Str = IVAL;
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 207 "loader.l"
op->stats.Dex = IVAL;
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 208 "loader.l"
op->stats.Con = IVAL;
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 209 "loader.l"
op->stats.Wis = IVAL;
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 210 "loader.l"
op->stats.Cha = IVAL;
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 211 "loader.l"
op->stats.Int = IVAL;
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 212 "loader.l"
op->stats.Pow = IVAL;
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 213 "loader.l"
op->stats.hp = IVAL;
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 214 "loader.l"
op->stats.maxhp = IVAL;
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 215 "loader.l"
op->stats.sp = IVAL;
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 216 "loader.l"
op->stats.maxsp = IVAL;
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 217 "loader.l"
op->stats.grace = IVAL;
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 218 "loader.l"
op->stats.maxgrace = IVAL;
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 219 "loader.l"
op->stats.exp = atol(yval());
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 220 "loader.l"
op->stats.food = IVAL;
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 221 "loader.l"
op->stats.dam = IVAL;
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 222 "loader.l"
op->stats.wc = IVAL;
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 223 "loader.l"
op->stats.ac = IVAL;
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 224 "loader.l"
{op->x = IVAL; op->ox= op->x; }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 225 "loader.l"
{op->y = IVAL; op->oy= op->y; }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 226 "loader.l"
op->nrof= atol(yval());
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 227 "loader.l"
op->level = IVAL;
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 228 "loader.l"
op->direction = IVAL;
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 229 "loader.l"
op->type = IVAL;
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 230 "loader.l"
op->material = IVAL;
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 231 "loader.l"
op->value = IVAL;
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 232 "loader.l"
op->weight = atol(yval());
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 233 "loader.l"
op->carrying = atol(yval());
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 234 "loader.l"
op->immune = IVAL;
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 235 "loader.l"
op->protected = IVAL;
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 236 "loader.l"
op->attacktype = IVAL;
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 237 "loader.l"
op->vulnerable = IVAL;
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 238 "loader.l"
op->path_attuned = IVAL;
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 239 "loader.l"
op->path_repelled = IVAL;
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 240 "loader.l"
op->path_denied = IVAL;
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 241 "loader.l"
op->invisible = IVAL;
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 242 "loader.l"
op->magic = IVAL;
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 243 "loader.l"
op->state = IVAL;
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 244 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_ALIVE, IVAL);
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 245 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_APPLIED, IVAL);
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 246 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_UNPAID, IVAL);
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 247 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_AN, IVAL);
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 248 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NEED_IE, IVAL);
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 249 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_PICK, IVAL);
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 250 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_PASS, IVAL);
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 251 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_WALK_ON, IVAL);
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 252 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_WALK_OFF, IVAL);
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 253 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_FLY_ON, IVAL);
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 254 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_FLY_OFF, IVAL);
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 255 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_ANIMATE, IVAL);
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 256 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_FLYING, IVAL);
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 257 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_MONSTER, IVAL);
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 258 "loader.l"
{	if (IVAL) {
			    SET_FLAG(op, FLAG_FRIENDLY);
			    if (op->type != PLAYER) {
				LOG(llevDebug,"Adding friendly object %s.\n",op->name);
				add_friendly_object(op);
			    }
			}
			else CLEAR_FLAG(op, FLAG_FRIENDLY);
		    }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 267 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_GENERATOR, IVAL);
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 268 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_THROWN, IVAL);
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 269 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_AUTO_APPLY, IVAL);
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 270 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_TREASURE, IVAL);
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 271 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_APPLY_ONCE, IVAL);
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 272 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SEE_INVISIBLE, IVAL);
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 273 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CAN_ROLL, IVAL);
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 274 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_TURNABLE, IVAL);
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 275 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_USED_UP, IVAL);
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 276 "loader.l"
{	if (IVAL) {
			    SET_FLAG(op, FLAG_IDENTIFIED);
			    CLEAR_FLAG(op, FLAG_KNOWN_MAGICAL);
			}
			else CLEAR_FLAG(op, FLAG_IDENTIFIED);
		    }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 282 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_REFLECTING, IVAL);
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 283 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CHANGING, IVAL);
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 284 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SPLITTING, IVAL);
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 285 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_HITBACK, IVAL);
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 286 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_STARTEQUIP, IVAL);
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 287 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_BLOCKSVIEW, IVAL);
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 288 "loader.l"
op->arch->editable = IVAL;
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 289 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_UNDEAD, IVAL);
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 290 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SCARED, IVAL);
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 291 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_UNAGGRESSIVE, IVAL);
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 292 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_REFL_MISSILE, IVAL);
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 293 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_REFL_SPELL, IVAL);
	YY_BREAK
case 97:
YY_RULE_SETUP
#line 294 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_MAGIC, IVAL);
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 295 "loader.l"
{	if (IVAL) {
			    SET_FLAG(op, FLAG_WIZ);
			    SET_FLAG(op, FLAG_WAS_WIZ);
			    SET_FLAG(op, FLAG_WIZPASS);
			}
			else {
			    CLEAR_FLAG(op, FLAG_WIZ);
			    CLEAR_FLAG(op, FLAG_WIZPASS);
			}
		    }
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 305 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_WAS_WIZ, IVAL);
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 306 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_FIX_PLAYER, IVAL);
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 307 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_TEAR_DOWN, IVAL);
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 308 "loader.l"
op->stats.luck = IVAL;
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 309 "loader.l"
op->run_away = IVAL;
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 310 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_PASS_THRU, IVAL);
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 311 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CAN_PASS_THRU, IVAL);
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 312 "loader.l"
op->pick_up = IVAL;
	YY_BREAK
case 107:
YY_RULE_SETUP
#line 313 "loader.l"
op->anim_speed = IVAL;
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 314 "loader.l"
op->weight_limit = IVAL;
	YY_BREAK
case 109:
YY_RULE_SETUP
#line 315 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_DROP, IVAL);
	YY_BREAK
case 110:
YY_RULE_SETUP
#line 316 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_PRETEXT, IVAL);
	YY_BREAK
case 111:
YY_RULE_SETUP
#line 317 "loader.l"
op->will_apply = IVAL;
	YY_BREAK
case 112:
YY_RULE_SETUP
#line 318 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_RANDOM_MOVE, IVAL);
	YY_BREAK
case 113:
YY_RULE_SETUP
#line 319 "loader.l"
op->can_apply = IVAL;
	YY_BREAK
case 114:
YY_RULE_SETUP
#line 320 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CAST_SPELL, IVAL);
	YY_BREAK
case 115:
YY_RULE_SETUP
#line 321 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_SCROLL, IVAL);
	YY_BREAK
case 116:
YY_RULE_SETUP
#line 322 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_WAND, IVAL);
	YY_BREAK
case 117:
YY_RULE_SETUP
#line 323 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_BOW, IVAL);
	YY_BREAK
case 118:
YY_RULE_SETUP
#line 324 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_ARMOUR, IVAL);
	YY_BREAK
case 119:
YY_RULE_SETUP
#line 325 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_WEAPON, IVAL);
	YY_BREAK
case 120:
YY_RULE_SETUP
#line 326 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_RING, IVAL);
	YY_BREAK
case 121:
YY_RULE_SETUP
#line 327 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_WAND, IVAL);
	YY_BREAK
case 122:
YY_RULE_SETUP
#line 328 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_BOW, IVAL);
	YY_BREAK
case 123:
YY_RULE_SETUP
#line 329 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_XRAYS, IVAL);
	YY_BREAK
case 124:
YY_RULE_SETUP
#line 330 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_FLOOR, IVAL);
	YY_BREAK
case 125:
YY_RULE_SETUP
#line 331 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_LIFESAVE, IVAL);
	YY_BREAK
case 126:
YY_RULE_SETUP
#line 332 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_STRENGTH, IVAL);
	YY_BREAK
case 127:
YY_RULE_SETUP
#line 333 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SLEEP, IVAL);
	YY_BREAK
case 128:
YY_RULE_SETUP
#line 334 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_STAND_STILL, IVAL);
	YY_BREAK
case 129:
YY_RULE_SETUP
#line 335 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_RANDOM_MOVE, IVAL);
	YY_BREAK
case 130:
YY_RULE_SETUP
#line 336 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_ONLY_ATTACK, IVAL);
	YY_BREAK
case 131:
YY_RULE_SETUP
#line 337 "loader.l"
op->armour = IVAL;
	YY_BREAK
case 132:
YY_RULE_SETUP
#line 338 "loader.l"
op->move_type = IVAL;
	YY_BREAK
case 133:
YY_RULE_SETUP
#line 339 "loader.l"
op->move_status = IVAL;
	YY_BREAK
case 134:
YY_RULE_SETUP
#line 340 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CONFUSED, IVAL);
	YY_BREAK
case 135:
YY_RULE_SETUP
#line 341 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_STEALTH, IVAL);
	YY_BREAK
case 136:
YY_RULE_SETUP
#line 342 "loader.l"
add_button_link(op, op->map, IVAL);
	YY_BREAK
case 137:
YY_RULE_SETUP
#line 343 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CURSED, IVAL);
	YY_BREAK
case 138:
YY_RULE_SETUP
#line 344 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_DAMNED, IVAL);
	YY_BREAK
case 139:
YY_RULE_SETUP
#line 345 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SEE_ANYWHERE, IVAL);
	YY_BREAK
case 140:
YY_RULE_SETUP
#line 346 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_KNOWN_MAGICAL, IVAL);
	YY_BREAK
case 141:
YY_RULE_SETUP
#line 347 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_KNOWN_CURSED, IVAL);
	YY_BREAK
case 142:
YY_RULE_SETUP
#line 348 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_CAN_USE_SKILL, IVAL);
	YY_BREAK
case 143:
YY_RULE_SETUP
#line 349 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_BEEN_APPLIED, IVAL);
	YY_BREAK
case 144:
YY_RULE_SETUP
#line 350 "loader.l"
{	char *y=yval();
			if (*y=='\0') LOG(llevError,"Title without value.\n");
			else FREE_AND_COPY(op->title, y);
		    }
	YY_BREAK
case 145:
YY_RULE_SETUP
#line 354 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_ROD, IVAL);
	YY_BREAK
case 146:
YY_RULE_SETUP
#line 355 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_ROD, IVAL);
	YY_BREAK
case 147:
YY_RULE_SETUP
#line 356 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_HORN, IVAL);
	YY_BREAK
case 148:
YY_RULE_SETUP
#line 357 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_USE_HORN, IVAL);
	YY_BREAK
case 149:
YY_RULE_SETUP
#line 358 "loader.l"
op->expmul = FVAL;
	YY_BREAK
case 150:
YY_RULE_SETUP
#line 359 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_UNIQUE, IVAL);
	YY_BREAK
case 151:
YY_RULE_SETUP
#line 360 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_MAKE_INVIS, IVAL);
	YY_BREAK
case 152:
YY_RULE_SETUP
#line 361 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_INV_LOCKED, IVAL);
	YY_BREAK
case 153:
YY_RULE_SETUP
#line 362 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_WOODED, IVAL);
	YY_BREAK
case 154:
YY_RULE_SETUP
#line 363 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_HILLY, IVAL);
	YY_BREAK
case 155:
YY_RULE_SETUP
#line 364 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_SKILL, IVAL);
	YY_BREAK
case 156:
YY_RULE_SETUP
#line 365 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_READY_WEAPON, IVAL);
	YY_BREAK
case 157:
YY_RULE_SETUP
#line 366 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_SKILL_IDENT, IVAL);
	YY_BREAK
case 158:
YY_RULE_SETUP
#line 367 "loader.l"
op->glow_radius = IVAL;
	YY_BREAK
case 159:
YY_RULE_SETUP
#line 368 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_BLIND, IVAL);
	YY_BREAK
case 160:
YY_RULE_SETUP
#line 369 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_SEE_IN_DARK, IVAL);
	YY_BREAK
case 161:
YY_RULE_SETUP
#line 370 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_IS_CAULDRON, IVAL);
	YY_BREAK
case 162:
YY_RULE_SETUP
#line 371 "loader.l"
op->randomitems = find_treasurelist(yval());
	YY_BREAK
case 163:
YY_RULE_SETUP
#line 372 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_DUST, IVAL);
	YY_BREAK
case 164:
YY_RULE_SETUP
#line 373 "loader.l"
SET_OR_CLEAR_FLAG(op, FLAG_NO_STEAL, IVAL);
	YY_BREAK
case 165:
YY_RULE_SETUP
#line 376 "loader.l"
{ /* Some archetypes have these values in them */ }
	YY_BREAK
case 166:
YY_RULE_SETUP
#line 377 "loader.l"
{ /* Probably the pupland archetypes - I imagined */ }
	YY_BREAK
case 167:
YY_RULE_SETUP
#line 378 "loader.l"
{ /* That these are for the new combat code */ }
	YY_BREAK
case 168:
YY_RULE_SETUP
#line 379 "loader.l"
{ /* just ignore for now */ }
	YY_BREAK
case 169:
YY_RULE_SETUP
#line 380 "loader.l"
{ }
	YY_BREAK
case 170:
YY_RULE_SETUP
#line 382 "loader.l"
{/* ignore empty lines, newlines we don't do above */}
	YY_BREAK
case 171:
YY_RULE_SETUP
#line 383 "loader.l"
{}
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(MESSAGE):
#line 384 "loader.l"
return LL_EOF;
	YY_BREAK
case 172:
YY_RULE_SETUP
#line 385 "loader.l"
yyerror( "Unrecognized string" );
	YY_BREAK
case 173:
YY_RULE_SETUP
#line 386 "loader.l"
ECHO;
	YY_BREAK

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = (int) (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;
	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 = (int) (yy_c_buf_p - yytext_ptr) - 1;

	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 =
				(int) (yy_c_buf_p - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					yy_flex_realloc( (void *) b->yy_ch_buf,
							 b->yy_buf_size + 2 );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

			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 )
			{
			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_ptr = &yy_current_buffer->yy_ch_buf[0];

	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;

	yy_current_state = yy_start;
	yy_current_state += YY_AT_BOL();

	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);
		if ( yy_accept[yy_current_state] )
			{
			yy_last_accepting_state = yy_current_state;
			yy_last_accepting_cpos = 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 >= 1463 )
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	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 char *yy_cp = yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = 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 >= 1463 )
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
	yy_is_jam = (yy_current_state == 1462);

	return yy_is_jam ? 0 : yy_current_state;
	}


#ifndef YY_NO_UNPUT
#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 += (int) (dest - source);
		yy_bp += (int) (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" );
		}

	*--yy_cp = (char) c;


	yytext_ptr = yy_bp;
	yy_hold_char = *yy_cp;
	yy_c_buf_p = yy_cp;
	}
#endif	/* ifndef YY_NO_UNPUT */


#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;
						}

					if ( ! yy_did_buffer_switch_on_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;

	yy_current_buffer->yy_at_bol = (c == '\n');

	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()" );

	b->yy_is_our_buffer = 1;

	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 )
		return;

	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		yy_flex_free( (void *) b->yy_ch_buf );

	yy_flex_free( (void *) b );
	}


#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif

#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


	{
	yy_flush_buffer( b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

#if YY_ALWAYS_INTERACTIVE
	b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
	b->yy_is_interactive = 0;
#else
	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
	}


#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif

	{
	b->yy_n_chars = 0;

	/* 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[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

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

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == yy_current_buffer )
		yy_load_buffer_state();
	}


#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
	{
	YY_BUFFER_STATE b;

	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = 0;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer( b );

	return b;
	}
#endif


#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *str )
#else
YY_BUFFER_STATE yy_scan_string( str )
yyconst char *str;
#endif
	{
	int len;
	for ( len = 0; str[len]; ++len )
		;

	return yy_scan_bytes( str, len );
	}
#endif


#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
	{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;

	/* Get memory for full buffer, including space for trailing EOB's. */
	n = len + 2;
	buf = (char *) yy_flex_alloc( n );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < len; ++i )
		buf[i] = bytes[i];

	buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
	}
#endif


#ifndef YY_NO_PUSH_STATE
#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 )
		{
		yy_size_t 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);
	}
#endif


#ifndef YY_NO_POP_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]);
	}
#endif


#ifndef YY_NO_TOP_STATE
static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}
#endif

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

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



/* 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, yyconst char *s2, int n )
#else
static void yy_flex_strncpy( s1, s2, n )
char *s1;
yyconst 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( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
	{
	/* The cast to (char *) in the following accommodates both
	 * implementations that use char* generic pointers, and those
	 * that use void* generic pointers.  It works with the latter
	 * because both ANSI C and C++ allow castless assignment from
	 * any pointer type to void*, and deal with argument conversions
	 * as though doing an assignment.
	 */
	return (void *) realloc( (char *) 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 );
	}

#if YY_MAIN
int main()
	{
	yylex();
	return 0;
	}
#endif
#line 386 "loader.l"


int yyerror(char *s)
{
  LOG(llevError, "%s: %s\n", s, yytext);
  return 0;
}


/* Our save file syntax is very simple, so we can use a very simple
 * processing mechanism here instead using something like bison
 * This skips over the space and returns the value, or "" if no value
 * is found.
 */
static char *yval()
{
    static char *em="";
    char *cp;

    cp=strchr(yytext,' ');
    if (cp) return cp+1;
    else return em;
}


#ifdef NEW_LOAD
/*
 * Loads an object from the given file-pointer.
 * Variables will be read and parsed and patched into the object
 * until the string "end" is reached, or the end of the file.
 *
 * bufstat is used to determine various file attributes:
 *  LO_REPATE (0): We are reading from the same buffer as the last call.
 *  LO_LINEMODE (1): file that is being read from is multi purpose (ie, other functions
 *	will also be reading from this (treasure file, artifacts.)
 *  LO_NEWFILE (2): This is the first read from a particular file, so the buffers should
 *	be reset.
 *  LO_NOREAD (3): Reset the buffers, but don't read from it. (op can be null)
 *
 */

int load_object(FILE *fp, object *op, int bufstate) {
    int retval;
    char inbuf[MAX_BUF];

    if (bufstate==LO_NEWFILE || bufstate==LO_NOREAD) {
	LOG(llevDebug,"Switching lex buffers\n");
	yy_delete_buffer(YY_CURRENT_BUFFER);
	yy_switch_to_buffer(yy_create_buffer(fp, YY_BUF_SIZE));
	if (bufstate==LO_NOREAD) return LL_NORMAL;
    } 
    if (bufstate==LO_LINEMODE) {
	YY_BUFFER_STATE  yybufstate;
	while (fgets(inbuf, MAX_BUF-3, fp)) {
	    yybufstate=yy_scan_string(inbuf);
	    retval=lex_load(op);
	    yy_delete_buffer(yybufstate);
	    if (retval==LL_NORMAL) return retval;
	}
	LOG(llevDebug,"Got eof while scanning strings\n");
	return LL_EOF;
    }

    retval=lex_load(op);
/*    LOG(llevDebug,"load completed, object=%s\n",op->name);*/
    return retval;
}


/* This takes a buffer, scans it for variables, and sets those variables
 * as appropriate in op.
 *
 * This function appears to be used in only 2 places - in crossedit to
 * override values and in c_wiz to mutate values.
 */
int set_variable(object *op,char *buf) {
    YY_BUFFER_STATE  yybufstate,yycurbuf=YY_CURRENT_BUFFER;
    int retval;

    yy_push_state(INITIAL);
    yybufstate=yy_scan_string(buf);
    retval=lex_load(op);
    yy_switch_to_buffer(yycurbuf);
    yy_delete_buffer(yybufstate);
    yy_pop_state();
    return retval;
}
#endif

/* Start of C code */

char *variables[NR_OF_VARIABLES];

/* This array equates the FLAG_ values with the V_ values.  Use -1 to
 * put gaps in the array that should not be processed.
 * The order matches the order of the define values in 'define.h'.
 */

int flag_links[NUM_FLAGS+1][2] ={
{FLAG_ALIVE, V_ALIVE}, {FLAG_WIZ, V_WIZ},
{-1, -1}, {-1, -1},	/* REMOVED and FREED flags */
{FLAG_WAS_WIZ, V_WAS_WIZ}, {FLAG_APPLIED, V_APPLIED},
{FLAG_UNPAID, V_UNPAID}, {FLAG_AN, V_NEED_AN},
{FLAG_NO_PICK, V_NO_PICK}, {FLAG_WALK_ON, V_WALK_ON},
{FLAG_NO_PASS, V_NO_PASS},{FLAG_ANIMATE, V_IS_ANIMATED},
{FLAG_SLOW_MOVE, -1}, {FLAG_FLYING, V_FLYING},
{FLAG_MONSTER, V_MONSTER}, {FLAG_FRIENDLY, V_FRIENDLY},
{FLAG_GENERATOR, V_GENERATOR}, {FLAG_IS_THROWN, V_IS_THROWN},
{FLAG_AUTO_APPLY, V_AUTO_APPLY}, {FLAG_TREASURE, V_TREASURE},
{FLAG_APPLY_ONCE, V_APPLY_ONCE},{FLAG_SEE_INVISIBLE, V_SEE_INVISIBLE},
{FLAG_CAN_ROLL, V_CAN_ROLL}, {-1, -1},
{FLAG_IS_TURNABLE, V_IS_TURNABLE},{FLAG_WALK_OFF, V_WALK_OFF},
{FLAG_FLY_ON, V_FLY_ON},{FLAG_FLY_OFF, V_FLY_OFF}, 
{FLAG_IS_USED_UP, V_IS_USED_UP}, {FLAG_IDENTIFIED, V_IDENTIFIED},
{FLAG_REFLECTING, V_REFLECTING}, {FLAG_CHANGING, V_CHANGING},
{FLAG_SPLITTING, V_SPLITTING}, {FLAG_HITBACK, V_HITBACK},
{FLAG_STARTEQUIP, V_STARTEQUIP}, {FLAG_BLOCKSVIEW, V_BLOCKSVIEW},
{FLAG_UNDEAD, V_UNDEAD}, {FLAG_SCARED, V_SCARED},
{FLAG_UNAGGRESSIVE, V_UNAGGRESSIVE}, {FLAG_REFL_MISSILE, V_REFLECT_MISSILE},
{FLAG_REFL_SPELL, V_REFLECT_SPELL}, {FLAG_NO_MAGIC, V_NO_MAGIC},
{FLAG_NO_FIX_PLAYER, V_NO_FIX_PLAYER}, {FLAG_NEED_IE, V_NEED_IE}, 
{FLAG_TEAR_DOWN, V_TEAR_DOWN}, {FLAG_RUN_AWAY, V_RUN_AWAY},
{FLAG_PASS_THRU, V_PASS_THRU}, {FLAG_CAN_PASS_THRU, V_CAN_PASS_THRU},
{FLAG_PICK_UP, V_PICK_UP}, {FLAG_UNIQUE, V_UNIQUE},
{FLAG_NO_DROP, V_NO_DROP}, {FLAG_NO_PRETEXT, V_NO_PRETEXT},
{FLAG_CAST_SPELL, V_CAN_CAST_SPELL}, {FLAG_USE_SCROLL, V_CAN_USE_SCROLL},
{FLAG_USE_WAND, V_CAN_USE_WAND},{FLAG_USE_BOW, V_CAN_USE_BOW},
{FLAG_USE_ARMOUR, V_CAN_USE_ARMOUR},{FLAG_USE_WEAPON, V_CAN_USE_WEAPON},
{FLAG_USE_RING, V_CAN_USE_RING}, {FLAG_READY_WAND, V_HAS_READY_WAND},
{FLAG_READY_BOW, V_HAS_READY_BOW}, {FLAG_XRAYS, V_XRAYS},
{-1, -1 /*NO_APPLY*/},  {FLAG_IS_FLOOR, V_IS_FLOOR},
{FLAG_LIFESAVE, V_LIFESAVE}, {FLAG_NO_STRENGTH, V_NO_STRENGTH},
{FLAG_SLEEP, V_SLEEP}, {FLAG_STAND_STILL, V_STAND_STILL},
{FLAG_RANDOM_MOVE, V_RANDOM_MOVEMENT}, {FLAG_ONLY_ATTACK, V_ONLY_ATTACK},
{FLAG_CONFUSED, V_CONFUSED}, {FLAG_STEALTH, V_STEALTH},
{-1, -1 /*WIZPASS*/}, {-1, -1 /*IS_LINKED */},
{FLAG_CURSED, V_CURSED}, {FLAG_DAMNED, V_DAMNED},
{FLAG_SEE_ANYWHERE, V_SEE_ANYWHERE}, {FLAG_KNOWN_MAGICAL, V_KNOWN_MAGICAL},
{FLAG_KNOWN_CURSED, V_KNOWN_CURSED}, {FLAG_CAN_USE_SKILL, V_CAN_USE_SKILL},
{FLAG_BEEN_APPLIED, V_BEEN_APPLIED},  {FLAG_READY_ROD, V_HAS_READY_ROD},
{FLAG_USE_ROD, V_CAN_USE_ROD}, {FLAG_READY_HORN, V_HAS_READY_HORN}, 
{FLAG_USE_HORN, V_CAN_USE_HORN},{FLAG_MAKE_INVIS,V_MAKE_INVIS},
{FLAG_INV_LOCKED,V_INV_LOCKED},{FLAG_IS_WOODED,V_IS_WOODED},
{FLAG_IS_HILLY,V_IS_HILLY},{FLAG_READY_SKILL,V_HAS_READY_SKILL},
{FLAG_READY_WEAPON,V_HAS_READY_WEAPON},{FLAG_NO_SKILL_IDENT,V_NO_SKILL_IDENT},
{FLAG_BLIND,V_BLIND},{FLAG_SEE_IN_DARK,V_SEE_IN_DARK},
{FLAG_IS_CAULDRON,V_IS_CAULDRON},{FLAG_DUST,V_DUST},{FLAG_NO_STEAL,V_NO_STEAL}
};


void save_double(char *buf,char *name,double v)
{
  char tbuf[200];

  sprintf(tbuf,"%s %f\n",name,v);
  strcat(buf,tbuf);
}

/*
 * Initialises the array of variable-names.  Needed before any
 * objects can be loaded.  Called by init_library().
 */

void init_vars() {
  int i;
  for(i=0;i<NR_OF_VARIABLES;i++)
    variables[i]=add_string(variable_const[i]);
}
/*
 * Returns a pointer to a static string which contains all variables
 * which are different in the two given objects.  op is the what object
 * the different values will be taken from.  This function is
 * typically used to dump objects (op2=empty object), or to save objects
 * (op2 is the objects original archetype)
 */

char *get_ob_diff(object *op,object *op2) {/* I plan to optimize this heavily */
  static char buf2[HUGE_BUF];
  static char buf[HUGE_BUF];
  int tmp;

  buf[0]='\0';
  if(op->name && op->name!=op2->name) {
    sprintf(buf2,"name %s\n",op->name);
    strcat(buf,buf2);
  }
  if(op->title && op->title!=op2->title) {
    sprintf(buf2,"title %s\n", op->title);
    strcat(buf, buf2);
  }
  if(op->race && op->race!=op2->race) {
    sprintf(buf2,"race %s\n",op->race);
    strcat(buf,buf2);
  }
  if(op->slaying && op->slaying!=op2->slaying) {
    sprintf(buf2,"slaying %s\n",op->slaying);
    strcat(buf,buf2);
  }
  if(op->msg && op->msg!=op2->msg) {
    strcat(buf,"msg\n");
    strcat(buf,op->msg);
    strcat(buf,"endmsg\n");
  }
  if(op->other_arch!=op2->other_arch&&op->other_arch!=NULL && 
     op->other_arch->name) {
    sprintf(buf2,"other_arch %s\n",op->other_arch->name);
    strcat(buf,buf2);
  }
  if(op->face!=op2->face) {
      sprintf(buf2,"%s %s\n",variable_const[V_FACE], 
		op->face->name);
      strcat(buf,buf2);
  }
  if (op->animation_id != op2->animation_id) {
    sprintf(buf2,"animation %s\n", animations[GET_ANIM_ID(op)].name);
    strcat(buf, buf2);
  }
  if(op->stats.Str!=op2->stats.Str)
    save_long(buf,variable_const[V_STR],op->stats.Str);
  if(op->stats.Dex!=op2->stats.Dex)
    save_long(buf,variable_const[V_DEX],op->stats.Dex);
  if(op->stats.Con!=op2->stats.Con)
    save_long(buf,variable_const[V_CON],op->stats.Con);
  if(op->stats.Wis!=op2->stats.Wis)
    save_long(buf,variable_const[V_WIS],op->stats.Wis);
  if(op->stats.Pow!=op2->stats.Pow)
    save_long(buf,variable_const[V_POW],op->stats.Pow);
  if(op->stats.Cha!=op2->stats.Cha)
    save_long(buf,variable_const[V_CHA],op->stats.Cha);
  if(op->stats.Int!=op2->stats.Int)
    save_long(buf,variable_const[V_INT],op->stats.Int);
  if(op->stats.hp!=op2->stats.hp)
    save_long(buf,variable_const[V_HP],op->stats.hp);
  if(op->stats.maxhp!=op2->stats.maxhp)
    save_long(buf,variable_const[V_MAXHP],op->stats.maxhp);
  if(op->stats.sp!=op2->stats.sp)
    save_long(buf,variable_const[V_SP],op->stats.sp);
  if(op->stats.maxsp!=op2->stats.maxsp)
    save_long(buf,variable_const[V_MAXSP],op->stats.maxsp);
  if(op->stats.grace!=op2->stats.grace)
    save_long(buf,variable_const[V_GRACE],op->stats.grace);
  if(op->stats.maxgrace!=op2->stats.maxgrace)
    save_long(buf,variable_const[V_MAXGRACE],op->stats.maxgrace);
  if(op->stats.exp!=op2->stats.exp)
    save_long(buf,variable_const[V_EXP],op->stats.exp);
  if(op->expmul!=op2->expmul) 
    save_double(buf,variable_const[V_EXPMUL],op->expmul);
  if(op->stats.food!=op2->stats.food)
    save_long(buf,variable_const[V_FOOD],op->stats.food);
  if(op->stats.dam!=op2->stats.dam)
    save_long(buf,variable_const[V_DAM],op->stats.dam);
  if(op->stats.luck!=op2->stats.luck)
    save_long(buf,variable_const[V_LUCK],op->stats.luck);
  if(op->stats.wc!=op2->stats.wc)
    save_long(buf,variable_const[V_WC],op->stats.wc);
  if(op->stats.ac!=op2->stats.ac)
    save_long(buf,variable_const[V_AC],op->stats.ac);
  if(op->armour!=op2->armour)
    save_long(buf,variable_const[V_ARMOUR],op->armour);
  if(op->x!=op2->x) 
    save_long(buf,variable_const[V_X],op->x);
  if(op->y!=op2->y)
    save_long(buf,variable_const[V_Y],op->y);
  if(op->speed!=op2->speed) {
    sprintf(buf2,"speed %f\n",op->speed);
    strcat(buf,buf2);
  }
  if(op->speed > 0 && op->speed_left!=op2->speed_left) {
    sprintf(buf2,"speed_left %f\n",op->speed_left);
    strcat(buf,buf2);
  }
  if(op->move_status != op2->move_status)
    save_long(buf,variable_const[V_MOVE_STATUS],op->move_status);
  if(op->move_type != op2->move_type)
    save_long(buf,variable_const[V_ATT_MOVE],op->move_type);
  if(op->nrof!=op2->nrof)
    save_long(buf,variable_const[V_NROF],op->nrof);
  if(op->level!=op2->level)
    save_long(buf,variable_const[V_LEVEL],op->level);
  if(op->direction!=op2->direction)
    save_long(buf,variable_const[V_DIRECTION],op->direction);
  if(op->type!=op2->type)
    save_long(buf,variable_const[V_TYPE],op->type);
  if(op->immune!=op2->immune)
    save_long(buf,variable_const[V_IMMUNE],op->immune);
  if(op->protected!=op2->protected)
    save_long(buf,variable_const[V_PROTECTED],op->protected);
  if(op->attacktype!=op2->attacktype)
    save_long(buf,variable_const[V_ATTACKTYPE],op->attacktype);
  if(op->vulnerable!=op2->vulnerable)
    save_long(buf,variable_const[V_VULNERABLE],op->vulnerable);
  if(op->path_attuned!=op2->path_attuned)
    save_long(buf,variable_const[V_PATH_ATTUNED],op->path_attuned);
  if(op->path_repelled!=op2->path_repelled)
    save_long(buf,variable_const[V_PATH_REPELLED],op->path_repelled);
  if(op->path_denied!=op2->path_denied)
    save_long(buf,variable_const[V_PATH_DENIED],op->path_denied);
  if(op->material!=op2->material)
    save_long(buf,variable_const[V_MATERIAL],op->material);
  if(op->value!=op2->value)
    save_long(buf,variable_const[V_VALUE],op->value);
  if(op->carrying!=op2->carrying)
    save_long(buf,variable_const[V_CARRYING],op->carrying);
  if(op->weight!=op2->weight)
    save_long(buf,variable_const[V_WEIGHT],op->weight);
  if(op->invisible!=op2->invisible)
    save_long(buf,variable_const[V_INVISIBLE],op->invisible);
  if(op->state!=op2->state)
    save_long(buf,variable_const[V_STATE],op->state);
  if(op->magic!=op2->magic)
    save_long(buf,variable_const[V_MAGIC],op->magic);
  if(op->last_heal!=op2->last_heal)
    save_long(buf,variable_const[V_LAST_HEAL],op->last_heal);
  if(op->last_sp!=op2->last_sp)
    save_long(buf,variable_const[V_LAST_SP],op->last_sp);
  if(op->last_grace!=op2->last_grace)
    save_long(buf,variable_const[V_LAST_GRACE],op->last_grace);
  if(op->last_eat!=op2->last_eat)
    save_long(buf,variable_const[V_LAST_EAT],op->last_eat);
  if(QUERY_FLAG(op,FLAG_IS_LINKED) && (tmp = get_button_value(op)))
    save_long(buf,variable_const[V_CONNECTED],tmp);
  if(op->glow_radius!=op2->glow_radius) 
    save_long(buf,variable_const[V_GLOW_RADIUS],op->glow_radius);
  if (op->randomitems!=op2->randomitems) {
    sprintf(buf2,"randomitems %s\n",(op->randomitems?op->randomitems->name:"none"));
    strcat(buf,buf2);
  }
#ifdef NPC_PROG
  if(op->npc_status!=op2->npc_status)
    save_long(buf,variable_const[V_NPC_STATUS],op->npc_status);
  if(op->npc_program!=op2->npc_program)
    save_long(buf,variable_const[V_NPC_PROGRAM],op->npc_program);
#endif


/* Eneq(@csd.uu.se): Handles run_away and pick_up */
  if(op->run_away!=op2->run_away)
    save_long(buf,variable_const[V_RUN_AWAY],op->run_away);
  if(op->pick_up!=op2->pick_up)
    save_long(buf,variable_const[V_PICK_UP],op->pick_up);
  if(op->weight_limit!=op2->weight_limit)
    save_long(buf,variable_const[V_CONTAINER],op->weight_limit);


/* Vick (@bern.docs.uu.se) @921107 -> Handle 'will_apply' &
   'random_movement.*/

  if (op->will_apply!=op2->will_apply)
    save_long(buf,variable_const[V_WILL_APPLY],op->will_apply);

/* Mol(@meryl.csd.uu.se) 921108  Handle can_apply */
  if (op->can_apply!=op2->can_apply)
    save_long(buf,variable_const[V_CAN_APPLY],op->can_apply);

  for (tmp=0; tmp <= NUM_FLAGS; tmp++) {
    if ((flag_links[tmp][0]!=-1) && (QUERY_FLAG(op, flag_links[tmp][0]) != 
	QUERY_FLAG(op2, flag_links[tmp][0]))) {
	    if (flag_links[tmp][0]==FLAG_SLOW_MOVE) {
		sprintf(buf2,"%s %f\n",variable_const[V_SLOW_MOVE],SLOW_PENALTY(op));
		strcat(buf,buf2);
	    }
	    else 
	        BUFADD(QUERY_FLAG(op, flag_links[tmp][0]), flag_links[tmp][1]);
	}
  }
  if(buf[0]=='\0')
    return NULL;
  return buf;
}

/*
 * Dumps all variables in an object to a file.
 * If bit 0 of flag is set, unpaid objects will be saved.  As of now,
 * the only place this is not set is when saving the player.
 * If bit 1 of flag is set, don't remove the object after save.  As of now,
 * all of the callers are setting this.
 */

void save_object(FILE *fp,object *op, int flag) {
    archetype *at;
    char *cp;
    object *tmp,*old;

    /* Even if the object does have an owner, it would seem that we should
     * still save it.
     */
    if(op->owner!=NULL || fp == NULL)
	return;

    /* If it is unpaid and we don't want to save those, just return. */
    if(!(flag&1)&&(QUERY_FLAG(op, FLAG_UNPAID))) {
	return;
    }

    if((at=op->arch)==NULL) at=empty_archetype;
    fprintf(fp,"arch %s\n",at->name);

    if((cp=get_ob_diff(op,&at->clone))!=NULL)
	fputs(cp,fp);	/* We really should do some status checking on this */

    /* Eneq(@csd.uu.se): Added this to allow containers being saved with contents*/

    old=NULL;

    if (flag & 2 )
	for(tmp=op->inv;tmp!=NULL;tmp=tmp->below)
	    save_object(fp,tmp,flag);

    /* Slightly different logic because tmp/op will be removed by
     * the save_object we call.  So we just keep looking at op->inv
     * until there is nothing left.  In theory, the variable old
     * should not be needed, as recursive loops shouldn't happen.
     */
    else while ((tmp=op->inv)!=NULL) {
	if(old==tmp) {
	    LOG(llevError,"Recursive loop in inventory\n");
	    break;
	}
	save_object(fp,tmp,flag); 
	old=tmp;
    }
   
    if (!(flag&2)) {
	remove_ob(op);
	free_object (op);
    }

    fprintf(fp,"end\n");
}

#ifndef NEW_LOAD 

/*
 * Searches through all possible variables to find any that matches
 * the given string.  An index to the variable_const[] array is returned,
 * or -1 on failure.
 */

int get_variable(char *name) {
  int i;
  char *tmp=find_string(name);
  for(i=0;i<NR_OF_VARIABLES;i++)
    if(variables[i]==tmp)
      return i;
  return -1;
}
/*
 * set_variable() expects buf to be a line with two arguments, the first
 * being a variable and the second being the value (which can be anything from
 * an integer to a string). 
 * The object given will have the given variable modified.
 *
 * -1 will be returned if there is no such variable
 * 0 will be returned if the variable is to be ignored
 * 1 will be returned if the variable was "anim"
 * 2 will be returned if the variable was "end"
 * 3 will be returned if the variable was "Inventory"
 * 4 will be returned if the variable was "More"
 * 5 will be returned if the variable was "msg"
 * 6 will be returned if the variable was "endmsg"
 * otherwise 0 will be returned
 */

int set_variable(object *op,char *buf) {
  char *vbp;
  int value,tmp,var;

  if((vbp=strchr(buf,'\n'))!=NULL) /* Change newline into end of string */
    *vbp='\0';
  else
    LOG(llevDebug, "Line too long.\n");
  if((vbp=strchr(buf,' '))==NULL) /* No argument to the variable */
    value=0,vbp=NULL;
  else {
    *vbp='\0',vbp++;
    value=atol(vbp);
  }
  switch(var=get_variable(buf)) {
  case V_ARCH:
    op->arch=find_archetype(vbp);
    if(op->arch!=NULL)
      copy_object(&op->arch->clone,op);
    break;
  case V_OTHER_ARCH:
    op->other_arch=find_archetype(vbp);
    break;
  case V_RACE:
    if(op->race!=NULL)
      free_string(op->race);
    op->race=add_string(vbp);
    break;
  case V_SLAYING:
    if(op->slaying!=NULL)
      free_string(op->slaying);
    op->slaying=add_string(vbp);
    break;
  case V_MSG:
    return 5;
  case V_MSGEND:
    return 6;
  case V_INVENTORY:
    return 3;
  case V_MORE:
    return 4;
  case V_ANIMATION:
    op->animation_id = find_animation(vbp);
    SET_FLAG(op,FLAG_ANIMATE);
    return 1;
  case V_END:
    return 2;
  case V_OBJECT:
    if(vbp==NULL) {
      LOG(llevError,"Object lacks name.\n");
      return 0;
    }
    if(op->arch!=NULL)
      op->arch->name=add_string(vbp);
    op->name=add_string(vbp);
    break;
  case V_NAME:
    if(*vbp=='\0') {
      LOG(llevError,"name without name\n");
      break;
    }
    if(op->name!=NULL)
      free_string(op->name);
    op->name=add_string(vbp);
    break;
  case V_TITLE:
    if(*vbp=='\0') {
      LOG(llevError, "title without name\n");
      break;
    }
    if(op->title!=NULL)
      free_string(op->title);
    op->title = add_string(vbp);
    break;
  case V_SPEED:
    sscanf(vbp,"%f",&op->speed);
    if (op->speed<0)
      op->speed_left=op->speed_left-RANDOM()%100/100.0;
    update_ob_speed(op);
    break;
  case V_SPEED_LEFT:
    sscanf(vbp,"%f",&op->speed_left);
    break;
  case V_SLOW_MOVE:
    {
      float f;
      sscanf(vbp,"%f",&f);
      SET_SLOW_PENALTY(op,f);
      SET_FLAG(op,FLAG_SLOW_MOVE);
    }
    break;
/* Eneq(@csd.uu.se): Added handleof archetype-field anim_speed */

  case V_ANIM_SPEED:
    op->anim_speed = (unsigned char) value;
    break;
/* kholland @ sunlab.cit.cornell.edu added move_type and status */
  case V_ATT_MOVE:
    op->move_type = (unsigned short) value;
    break;
  case V_MOVE_STATUS:
    op->move_status = (signed long) value;
    break;
/*
 * Eneq(@csd.uu.se): Added handle of container <no> where no is containers
 * weight limit, and no_drop which makes an item undroppable
 */
  case V_CONTAINER:
    op->weight_limit=(signed long) value;
    break;
  case V_FACE:
    op->face = &new_faces[FindFace(vbp,0)];
    break;
  case V_STR:
    op->stats.Str=(signed char) value;
    break;
  case V_DEX:
    op->stats.Dex=(signed char) value;
    break;
  case V_CON:
    op->stats.Con=(signed char) value;
    break;
  case V_WIS:
    op->stats.Wis=(signed char) value;
    break;
  case V_POW:
    op->stats.Pow=(signed char) value;
    break;
  case V_CHA:
    op->stats.Cha=(signed char) value;
    break;
  case V_INT:
    op->stats.Int=(signed char) value;
    break;
  case V_HP:
    op->stats.hp=(signed short) value;
    break;
  case V_MAXHP:
    op->stats.maxhp=(signed short) value;
    break;
  case V_SP:
    op->stats.sp=(signed short) value;
    break;
  case V_MAXSP:
    op->stats.maxsp=(signed short) value;
    break;
  case V_GRACE:
    op->stats.grace=(signed short) value;
    break;
  case V_MAXGRACE:
    op->stats.maxgrace=(signed short) value;
    break;
  case V_EXP:
    op->stats.exp=(signed long) value;
    break;
  case V_EXPMUL:
    sscanf(vbp,"%lf",&(op->expmul));
    break;
  case V_FOOD:
    op->stats.food=(sint16) value;
    break;
  case V_DAM:
    op->stats.dam=(sint16) value;
    break;
  case V_LUCK:
    op->stats.luck=(signed char) value;
    break;
  case V_WC:
    op->stats.wc=(signed char) value;
    break;
  case V_AC:
    op->stats.ac=(signed char) value;
    break;
  case V_ARMOUR:
    op->armour=(signed char) value;
    break;
  case V_X:
    op->x=(signed short) value,
    op->ox=(signed short) value;
    break;
  case V_Y:
    op->y=(signed short) value,
    op->oy=(signed short) value;
    break;
  case V_NROF:
    op->nrof=(unsigned long) value;
    break;
  case V_LEVEL:
    op->level=(signed char) value;
    break;
  case V_DIRECTION:
    op->direction=(signed char) value;
    break;
  case V_TYPE:
    op->type=(unsigned char) value;
    break;
  case V_IMMUNE:
    op->immune=(unsigned int) value;
    break;
  case V_PROTECTED:
    op->protected=(unsigned int) value;
    break;
  case V_ATTACKTYPE:
    op->attacktype=(unsigned int) value;
    break;
  case V_VULNERABLE:
    op->vulnerable=(unsigned int) value;
    break;
  case V_PATH_ATTUNED:
    op->path_attuned=(uint32) value;
    break;
  case V_PATH_REPELLED:
    op->path_repelled=(uint32) value;
    break;
  case V_PATH_DENIED:
    op->path_denied=(uint32) value;
    break;
  case V_MATERIAL:
    op->material=(uint16) value;
    break;
  case V_VALUE:
    op->value=(signed long) value;
    break;
  case V_CARRYING:
    op->carrying=(signed long) value;
    break;
  case V_WEIGHT:
    op->weight=(signed long) value;
    break;
  case V_INVISIBLE:
    op->invisible=(signed short) value;
    break;
  case V_MAGIC:
    op->magic=(unsigned char) value;
    break;
  case V_STATE:
    op->state=(unsigned char) value;
    break;
  case V_LAST_HEAL:
    op->last_heal=(signed short) value;
    break;
  case V_LAST_SP:
    op->last_sp=(signed short) value;
    break;
  case V_LAST_GRACE:
    op->last_grace=(signed short) value;
    break;
  case V_LAST_EAT:
    op->last_eat=(signed short) value;
    break;
  case V_CONNECTED:
    add_button_link(op, op->map, value);
    break;
#ifdef NPC_PROG
  case V_NPC_STATUS:
    op->npc_status=(unsigned short) value;
    break;
  case V_NPC_PROGRAM:
    op->npc_program=(unsigned short) value;
    break;
#endif

  case V_EDITABLE:
    op->arch->editable = value;
    break;

/* Eneq(@csd.uu.se): Handle PICK_UP */

  case V_PICK_UP:
    op->pick_up=(unsigned char) value;
    break;

/* Eneq(@csd.uu.se): Handle RUN_AWAY, (CAN_)PASS_THRU. */

  case V_RUN_AWAY:
    op->run_away = (unsigned short) value;
    break;

/* Vick's (vick@bern.docs.uu.se) patch 921107 : will_apply, which
   enables a monster to apply things on the ground. */

  case V_WILL_APPLY:
    op->will_apply = (unsigned char) value;
    break;

  case V_GLOW_RADIUS:
    op->glow_radius = (signed short) value;
    break;

/* Note: With the new FLAG value method, most all of these bits are
 * set in the default area.  The only ones not set there are
 * special cases (those needing to check the object, print debugging
 * messages, or SET/CLEAR multiple flags.
 */

  case V_WIZ:
    if (value) {
	SET_FLAG(op, FLAG_WIZ);
	SET_FLAG(op, FLAG_WAS_WIZ);
	SET_FLAG(op, FLAG_WIZPASS);
    }
    else {
	CLEAR_FLAG(op, FLAG_WIZ);
	CLEAR_FLAG(op, FLAG_WIZPASS);
    }
    break;

/* Mol(@csd.docs.uu.se) patch 921108 : can_apply, is similair to will_apply,
   but applies thing it has picked up. */

  case V_CAN_APPLY:
    op->can_apply = (unsigned char) value;
    break;

  case V_FRIENDLY:
    if(value) {
      SET_FLAG(op,FLAG_FRIENDLY);
      if (op->type != PLAYER) {
        LOG(llevDebug, "Adding friendly object %s.\n",op->name);
        add_friendly_object(op);
      }
    }
    else
      CLEAR_FLAG(op,FLAG_FRIENDLY);
    break;

  case V_IDENTIFIED:
    if(value) {
      SET_FLAG(op,FLAG_IDENTIFIED);
      CLEAR_FLAG(op, FLAG_KNOWN_MAGICAL);
    }
    else
      CLEAR_FLAG(op,FLAG_IDENTIFIED);
    break;

  case V_WAS_WIZ:
    if(value)
      SET_FLAG(op,FLAG_WAS_WIZ);
    else
      CLEAR_FLAG(op,FLAG_WAS_WIZ);
    break;
  case V_RANDOMITEMS:
    op->randomitems=find_treasurelist(vbp);
    break;
    

 /* In the default statement, it will handle all cases above.
  * First search through the flag_links, to match corresponding
  * variables.  If it doesn't find anything, then print the error messages.
  */
  default:
    for (tmp=0; tmp<=NUM_FLAGS; tmp++) {
	if (flag_links[tmp][1]==var) {
	    if (value) SET_FLAG(op, flag_links[tmp][0]);
	    else CLEAR_FLAG(op, flag_links[tmp][0]);
	    return 0;
	}
    }
    sprintf(errmsg,"Warning, unknown (or oldfashioned) variable: %s",buf);
    return -1;
  }
  return 0;
}

/*
 * Loads an object from the given file-pointer.
 * Variables will be read and parsed and patched into the object
 * until the string "end" is reached, or the end of the file.
 * If EOF is reached, it returnes false, otherwise true.
 */

int load_object(FILE *fp, object *op, int a) {
  char buf[MAX_BUF];
  char msgbuf[HUGE_BUF];
  int position=1; /* 1 = standalone, 2 = inventory, 3 = head/tail link */
  int msg_start=0;
  object *tmp;

  buf[MAX_BUF - 1] = '\0';
  while(fgets(buf,sizeof(buf),fp)!=NULL) {
    if(*buf=='#')
      continue;
    if(msg_start&&strncmp(buf,"endmsg",6)) {
      strcat(msgbuf,buf);
      continue;
    }
    /* found an arch in the object.  Must be part of the
     * objects inventory.
     */
    if(!strncmp(buf,"arch ",5)&&op->arch!=NULL) {
        object *otmp;

        tmp=get_object();
	set_variable(tmp, buf);
        load_object(fp, tmp,0);
        if (op->inv!=NULL) {
            for (otmp=op->inv; otmp->below!=NULL; otmp=otmp->below);
            otmp->below=tmp;
        }
	else op->inv=tmp;
        return load_object (fp, op,0);
    }
    switch(set_variable(op,buf)) {
    case -1:
      LOG(llevError,"%s\n",errmsg);
      break;
    case 2:
      return position;
    case 3:
      position=2;
      break;
    case 4:
      position=3;
      break;
    case 5:
      msg_start=1;
      msgbuf[0]='\0';
      break;
    case 6:
      msg_start=0;
      op->msg=add_string(msgbuf);
	/* Only reason to worry about this is if we might be in danger
	 * of going beyond the limits of the buffer.
	 */
      if (strlen(op->msg) > (HUGE_BUF/2))
	LOG(llevDebug, "\n\tWarning message length > %d (max allowed=%d): %d\n>%.80s<\n",
	    HUGE_BUF/2, HUGE_BUF,
	    strlen(op->msg),op->msg);
      break;
    }
  }
  return 0;
}


/*
 * Loads an object from the given file-pointer.
 * Variables will be read and parsed and patched into the object
 * until the string "end" is reached, or the end of the file.
 * If EOF is reached, it returnes false, otherwise true.
 */

enum LoadState { unknown, arch, anim, message };

object *LoadObject (FILE *fp, char *inbuf) {
    char buf[256];
    char msgbuf[HUGE_BUF];
    object *op = NULL;
    enum LoadState state = unknown;
    
   if (inbuf!=NULL) {
     if (strncmp("arch", inbuf, 4))
	LOG (llevError, "parse error in inbuf: %s\n (expecting arch)", inbuf);
      else {
	state = arch;
	op = get_object();
	set_variable (op, inbuf);
      }
   }

    while(fgets(buf,sizeof(buf),fp)!=NULL) {
	if(*buf=='#')
	    continue;

	switch (state) {
	  case unknown:
	    if (strncmp ("arch", buf, 4))
		LOG (llevError, "parse error in: %s\n (expecting arch)", buf);
	    else {
		state = arch;
		op = get_object();
		set_variable (op, buf);
	    }
	    break;

	  case arch:
	    if(!strncmp (buf, "arch ", 5)) {
		object *tmp;
		tmp = LoadObject(fp,buf);
		/* If we don't have an arch or name, chances are the object
		 * is one that has been removed or isn't available.  Just
		 * drop it then (can't really dump it - no information
		 * to show.)
		 */
		if (!tmp->arch && !tmp->name) {
		    LOG(llevDebug,"Dropping null object.\n");
		    free_object(tmp);
		}
		else
		    (void) insert_ob_in_ob (tmp, op);
		break;
	    }

	    switch(set_variable (op, buf)) {
	      case -1:
		LOG(llevError,"%s\n",errmsg);
		break;
		
	      case 0:
		break;

	      case 2:
		return op;

	      case 5:
		state = message;
		msgbuf[0] = '\0';
		break;

	      default:
		LOG(llevError,"LoadObject()\n");
		break;
	    }       
	    break;

	  case message:
	    if(!strncmp (buf, "endmsg", 6)) {
		op->msg = add_string (msgbuf);
		state = arch;
		break;
	    }
	    strcat(msgbuf,buf);
	}
    }
    if (op)
	free_object (op);

    return NULL;
}

#endif
