/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header$
 */

#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_RESTORE_YY_MORE_OFFSET \
		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 *yy_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 50
#define YY_END_OF_BUFFER 51
static yyconst short int yy_accept[405] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
       51,   48,   48,   49,    1,   48,    1,   48,   48,   48,
       48,   48,   48,   48,   48,   48,   48,   48,   48,   48,
       48,   48,   48,   48,   48,   48,   48,   48,   48,   48,
       48,   48,   48,   48,   48,   48,   48,   48,   48,   48,
       48,    0,    1,    1,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    1,    2,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,

        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,   21,    0,    0,   21,   24,
        0,    0,    0,   28,    0,   34,    0,   33,    0,   32,
        0,   31,    0,   26,    0,   30,    0,   29,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,   14,    0,    0,    0,    0,    0,    0,   42,    0,
        0,   45,    0,    0,    0,    0,    0,   27,    0,    0,
        0,    0,    0,    0,    0,   25,    0,    0,    0,   25,

        0,    0,    0,    0,    0,   25,    0,    0,    0,    0,
        0,    0,    0,    0,    4,    3,   17,    5,    0,    0,
        0,    0,    0,    0,    0,    0,   40,   41,   43,   44,
        0,    0,   24,    0,    0,    0,    0,    0,    0,    0,
        0,   25,   25,    0,    0,    0,    0,    0,    0,    6,
        0,    0,    5,    5,    0,    0,    0,   35,    0,   38,
        0,    0,    0,    0,    0,    0,    0,    0,   25,   25,
        0,    0,    0,   25,   25,    0,    0,    0,    0,    0,
       13,    0,    0,    0,    5,    5,    0,    0,   36,    0,
       39,    0,   20,    0,    0,   46,   47,    0,    0,   25,

       25,   46,   47,    0,    0,    0,    0,    6,    0,    0,
        0,    0,    0,    0,   18,    0,    0,   25,   25,    0,
        0,    0,    0,    0,   15,   16,    7,    0,    0,    0,
       19,   46,   47,    0,    0,    0,    0,   12,   11,    0,
       37,    0,    0,    0,    0,    0,    7,    6,    6,    6,
        6,    0,    6,    6,    6,    0,    0,   10,    0,   10,
        6,    6,    6,    0,    0,    0,    0,    0,    6,    6,
        6,    0,    0,    0,   10,    9,    6,    6,    6,    0,
        0,   25,    0,    6,    6,    6,    0,    0,   10,    0,
        6,    6,    6,    6,   23,    0,    8,    0,    0,    0,

        0,    8,   22,    0
    } ;

static yyconst int yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    1,    6,    7,    1,    1,    1,    1,    1,
        1,    1,    8,    9,   10,    1,    1,   11,   12,   13,
       11,   14,   11,   15,   11,   11,   11,   16,    1,    1,
       17,    1,    1,    1,   18,   19,   20,   21,   19,   19,
       19,   19,   19,   19,   19,   19,   22,   19,   23,   24,
       19,   19,   19,   19,   19,   25,   19,   26,   19,   19,
       27,    1,   28,    1,    1,    1,   29,   30,   31,   32,

       33,   34,   35,   36,   37,   38,   39,   40,   41,   42,
       43,   44,   38,   45,   46,   47,   48,   49,   38,   50,
       51,   38,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    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[52] =
    {   0,
        1,    2,    3,    4,    5,    6,    7,    1,    8,    1,
        9,    9,    9,    9,    9,   10,    8,   11,   11,   11,
       11,   11,   11,   11,   11,   11,    1,    1,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11
    } ;

static yyconst short int yy_base[435] =
    {   0,
        0,    7,   57,   63,   67,   61,   73,   79,   80,   86,
     1034, 1687,   88, 1687,    0,  135, 1027,  116,  164,  106,
      122,   76,  999,   34,  986,  991,  994,   98,  209,  973,
      979,  968,  959,  945,  173,  136,  189,  929,  927,  928,
      190,   85,  199,  910,  904,  916,  195,  129,  219,  903,
      247,  238,    0,    0,    0,  171,    0,  248,  254,   95,
      905,   98,  892,  883,  238,  906, 1687,  248,  271,  172,
      273,  229,  287,  292,  306,  311,  325,  330,  344,  264,
      345,  350,  861,  865,  832,  828,  820,  814,  239,  815,
      819,  307,  804,    0,  810,  809,  798,  787,  781,  775,

      781,  755,  751,  748,    0,  334,  367,  747,  740,  736,
      707,  712,  717,  346,  165,  368,  708,  703,  707,  685,
      686,  690,  378,  185,  288,  376,  153,    0,  424,  390,
        0,  408,  438,  391,  277, 1687,  443,  448,  462,  457,
      476,  471,  490,  485,  504,  499,  518,  513,  532,  534,
      550,  536,  426,  542,  552,  554,  407,  567,  576,  565,
      590,  674,  674,  669,  326,  649,  653,  599,  380,  425,
      591, 1687,  640,  600,  636,  638,  630,  616, 1687,  608,
      611, 1687,  603,  597,  591,  598,  622,  611,  613,  628,
      643,  629,  659,  661,  672,  677,  682,  690,  695,  707,

      689,  584,  566,  705,  633,  614,  719,    0,  721,  567,
      560,  442,  726,  548, 1687,  728,  572,  756,    0,  554,
      742,  761,  743,  747,  535,  533, 1687, 1687, 1687, 1687,
      525,  510, 1687,  775,  776,  777,  793,  799,  540,  806,
      782,  801,  818,  502,  500,  816,  530,  490,  834,  825,
        0,  130,  851,  865,  515,  475,  870,  875,  833, 1687,
      838,  889,  852,  472,  453,  571,  890,  903,  908, 1687,
      891,  174,  290,  909,  916,  442,  437,  914,  455,  429,
      948,  459,  399,  384,  914,  953,  660,  967,  962,  931,
     1687,  937, 1687,  404,  402,  981,  982,   71,  146,  938,

      990, 1687, 1687,  992,  370,  353,  983, 1687,  667,  302,
      998, 1000, 1005,  363, 1687,   83,  328, 1014, 1016, 1022,
      329,  360,  364, 1030, 1687, 1687, 1044,    0, 1046, 1046,
     1687,  357,  352, 1060,  325,  305,  271, 1687, 1061,  285,
     1067, 1081, 1086,  238,  238, 1062, 1687, 1088, 1094, 1105,
     1107, 1129, 1147, 1112, 1161,  214,  186, 1117,    0, 1138,
     1145, 1169, 1171, 1177, 1183, 1201, 1217, 1191, 1231, 1245,
     1247,  172,  182,  192, 1185, 1210, 1215, 1233, 1256, 1286,
     1300, 1265, 1273,    0, 1314, 1316,  165,   93, 1687, 1284,
     1302, 1322, 1330, 1332, 1687,   91, 1324,    0,   27,   61,

       33, 1687, 1687, 1687, 1365, 1376, 1387, 1397, 1406, 1416,
     1425, 1435, 1446, 1457, 1468, 1479, 1490, 1501, 1511, 1521,
     1532, 1543, 1554, 1565, 1576, 1587, 1598, 1609, 1620, 1631,
     1642, 1653, 1664, 1675
    } ;

static yyconst short int yy_def[435] =
    {   0,
      405,  404,  405,    2,  405,    2,  405,    2,  405,    2,
      404,  404,  404,  404,  406,  404,  407,  408,  404,  409,
      409,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,   16,  404,  404,  404,  404,  404,
       16,  404,  404,  404,  404,  404,   16,  404,  410,  404,
       16,  404,  406,  406,   16,  408,   19,  409,  409,  404,
      404,  404,  404,  404,  404,  407,  404,  411,  411,  404,
      404,  412,  404,  404,  404,  404,  404,  404,  409,  413,
      414,  409,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,   29,  404,  404,  404,  404,  404,  404,

      404,  404,  404,  404,   35,  404,  404,  404,  404,  404,
      404,  404,  404,   16,  404,  404,  404,  404,  404,  404,
      404,  404,   16,  404,  410,  404,  404,   51,  404,  411,
      415,  404,  404,  404,  412,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  409,
      413,  414,  416,  404,  413,  404,  404,  414,  404,  417,
      409,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      418,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  415,  404,  419,  413,
      413,  404,  414,  414,  414,  416,  417,  416,  420,  417,

      404,  404,  404,  404,  419,  417,  417,  421,  409,  404,
      404,  404,  422,  404,  404,  404,  404,  418,  423,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  413,  414,  414,  420,  421,  421,  420,
      421,  417,  417,  404,  404,  409,  404,  404,  404,  422,
      424,  404,  404,  418,  423,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  414,  414,  413,  404,
      421,  421,  421,  417,  417,  404,  404,  409,  404,  404,
      404,  424,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  414,  414,  421,  421,  417,

      417,  404,  404,  409,  404,  404,  404,  404,  404,  404,
      425,  404,  404,  404,  404,  421,  421,  417,  417,  409,
      404,  404,  404,  404,  404,  404,  425,  426,  404,  404,
      404,  421,  421,  414,  404,  404,  404,  404,  404,  426,
      404,  422,  427,  404,  404,  428,  404,  429,  422,  422,
      427,  430,  422,  427,  427,  404,  404,  428,  431,  428,
      429,  422,  422,  430,  424,  430,  424,  432,  422,  427,
      427,  404,  404,  431,  428,  428,  422,  422,  414,  424,
      424,  432,  432,  421,  427,  427,  404,  404,  404,  433,
      422,  422,  427,  427,  404,  404,  433,  434,  404,  434,

      404,  404,  404,    0,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404
    } ;

static yyconst short int yy_nxt[1739] =
    {   0,
      404,   13,   14,  404,   13,  404,   15,   12,   16,   14,
       12,   16,   12,   17,   12,   18,   19,   18,   18,   18,
       18,   18,   12,   12,   20,   20,   20,   20,   20,   20,
       21,   20,   20,   22,   12,   12,   23,   12,   24,   25,
       12,   12,   12,   26,   12,   12,   12,   27,   12,   12,
       12,   12,   28,   12,   12,   12,   12,   12,   29,   14,
      403,   29,   41,   15,   35,   41,  402,   35,   37,   14,
       86,   37,  401,   15,   43,   14,  270,   43,   87,   15,
       47,   49,   14,   47,   49,   30,   15,   51,  270,   52,
       51,   30,   52,   42,   53,   31,   83,   84,   32,   38,

       39,   31,   33,   34,   32,   44,   39,   40,   36,   34,
      316,   48,   45,   40,   80,   83,   84,   68,   45,   46,
       68,   81,   80,  399,   88,   46,  111,   91,  396,   50,
       80,   92,   69,  332,   86,   50,   55,   81,   80,   55,
       93,   53,   87,   56,   57,   56,   56,   56,   56,   56,
       82,  270,   58,   58,   58,   58,   58,   58,   59,   58,
       58,   60,  283,  284,   61,   91,   62,   63,   88,   92,
      120,   64,   68,  132,  105,   68,  132,  105,   93,  270,
       65,   70,  103,   71,  185,  317,   72,   69,   73,   74,
      107,  114,  395,  107,  114,   53,  123,  389,  186,  123,

      116,   95,   75,  116,   88,   53,  111,   76,   77,   78,
       94,   96,  388,   94,   97,   53,  298,  387,  106,   99,
      125,  108,  115,  125,   88,   53,  120,  124,  109,  109,
      135,  117,  373,  135,  118,  110,  110,   95,  118,   52,
      168,  119,   52,  168,   53,  119,  372,   96,  128,   68,
       97,  128,   68,  131,   98,   99,   80,  129,  129,  129,
      129,  129,   80,   81,   80,  154,  357,   91,  155,   81,
       80,   92,  404,  356,  133,  404,  131,  133,  135,  156,
       93,  135,   82,  134,  134,  134,  134,  134,  137,  125,
      347,  137,  125,  139,   53,  270,  139,  138,  138,  138,

      138,  138,  140,  140,  140,  140,  140,  141,  171,  338,
      141,  171,  143,  325,  326,  143,  142,  142,  142,  142,
      142,  144,  144,  144,  144,  144,  145,  213,  345,  145,
      213,  147,  299,  270,  147,  146,  146,  146,  146,  146,
      148,  148,  148,  148,  148,  149,  157,  114,  150,  158,
      114,  149,  151,  159,  150,  344,  172,  270,  151,  152,
      153,  160,  270,   91,  336,  152,  153,   92,  107,  116,
      333,  107,  116,   53,   53,  335,   93,  331,  115,  123,
      103,  217,  123,  322,  217,  109,  126,  126,  126,  126,
      126,  404,  110,  337,  404,  404,  161,  338,  321,  108,

      117,  134,  134,  134,  134,  134,  109,  118,  157,  132,
      124,  157,  132,  110,  119,  315,  314,  118,  188,  188,
      188,  188,  188,  160,  119,   68,  171,  197,   68,  171,
      198,  199,   56,  310,  129,  129,  129,  129,  129,  133,
       69,  200,  133,  249,  137,  309,  249,  137,  134,  134,
      134,  134,  134,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  139,  308,  306,  139,  140,  140,  140,
      140,  140,  140,  140,  140,  140,  140,  141,  305,  303,
      141,  142,  142,  142,  142,  142,  142,  142,  142,  142,
      142,  143,  302,  293,  143,  144,  144,  144,  144,  144,

      144,  144,  144,  144,  144,  145,  292,  287,  145,  146,
      146,  146,  146,  146,  146,  146,  146,  146,  146,  147,
      286,  280,  147,  148,  148,  148,  148,  148,  148,  148,
      148,  148,  148,  149,  279,  149,  149,  192,  150,  277,
      193,  276,  151,  154,  159,  270,  154,  156,  160,  152,
      153,  189,  160,  154,  190,  201,  155,  156,  201,  266,
      191,  191,  191,  191,  191,  156,  207,  156,  157,  207,
      208,  158,  265,  217,  264,  159,  217,  204,  263,  194,
      204,  195,  294,  160,  256,  295,  205,  205,  205,  205,
      205,  149,  171,  252,  150,  171,  219,  202,  151,  203,

      168,  221,  248,  168,  221,  152,  153,  247,  245,  216,
      216,  216,  216,  216,  189,  404,  222,  189,  404,  404,
      209,  188,  188,  188,  188,  188,  244,  233,  156,  189,
      192,  232,  190,  192,  157,  231,  230,  157,  191,  191,
      191,  191,  191,  156,  149,  160,  229,  234,  404,  160,
      228,  227,  226,  191,  191,  191,  191,  191,  156,  153,
      192,  311,  157,  193,  311,  158,  225,  159,  324,  159,
      224,  324,  202,  157,  203,  160,  158,  160,  154,  223,
      159,  155,   80,  197,  220,  215,  197,  208,  160,  214,
      201,  197,  200,  201,  198,  199,  238,  200,  239,  240,

       80,  239,  194,  235,  195,  200,  204,  212,  201,  204,
      241,  201,  404,  211,  236,  205,  205,  205,  205,  205,
      207,  210,  149,  207,  208,  150,  184,  213,  183,  151,
      213,  251,  202,  182,  203,  122,  152,  153,  216,  216,
      216,  216,  216,  221,  259,  121,  221,  259,  261,  120,
      242,  261,  243,  181,  180,  179,  246,  253,  222,  260,
      253,  404,  257,  262,  113,  257,  254,  254,  254,  254,
      254,  258,  258,  258,  258,  258,  149,  157,  157,  234,
      158,  158,  112,  271,  159,  159,  271,  270,  111,  178,
      156,  153,  160,  160,  238,  177,  239,  240,  269,  239,

      238,  176,  404,  238,  270,  404,  404,  238,  241,  239,
      240,  269,  239,  175,  241,  267,  268,  149,  174,  404,
      150,  241,  404,  404,  151,  272,  404,  273,  104,  404,
      404,  152,  153,  103,  259,  249,  278,  259,  249,  261,
      102,  101,  261,  274,  281,  281,  281,  281,  281,  260,
      100,  173,  253,  290,  262,  253,  290,  170,  169,  167,
      275,  285,  285,  285,  285,  285,  253,  166,  291,  253,
      404,  257,  165,  164,  257,  254,  254,  254,  254,  254,
      258,  258,  258,  258,  258,  258,  258,  258,  258,  258,
      288,  157,  271,  288,  158,  271,  270,  163,  159,  289,

      289,  289,  289,  289,  157,  162,  160,  158,   67,  154,
      404,  159,  155,  404,  404,  149,   89,  404,  150,  160,
      404,  404,  151,  156,  285,  285,  285,  285,  285,  152,
      153,   88,  290,   85,  272,  290,  273,  127,  312,  404,
      296,  312,  404,  404,  122,  297,  121,  291,  300,  307,
      304,  120,  307,  313,  253,  301,  113,  253,  281,  281,
      281,  281,  281,  285,  285,  285,  285,  285,  288,  112,
      111,  288,  289,  289,  289,  289,  289,  289,  289,  289,
      289,  289,  157,  157,  307,  158,  158,  307,  318,  159,
      159,  404,  104,  149,  404,  404,  150,  160,  160,  311,

      151,  312,  311,  328,  312,  103,  329,  152,  153,  329,
      102,  101,  330,  100,  330,  404,  313,  404,  404,  404,
      404,  404,   90,  149,   89,   88,  150,   85,  323,   67,
      151,  324,  319,  404,  324,  404,  320,  334,  153,  404,
      339,  339,  339,  339,  339,  404,  404,  329,  404,  404,
      329,  404,  404,  330,  404,  330,  341,  341,  341,  341,
      341,  342,  346,  346,  343,  346,  346,  359,  159,  404,
      404,  339,  339,  339,  339,  339,  160,  341,  341,  341,
      341,  341,  342,  404,  404,  342,  251,  342,  404,  207,
      343,  352,  207,  208,  353,  404,  404,  348,  404,  404,

      404,  404,  348,  194,  404,  195,  404,  360,  157,  404,
      404,  158,   81,  157,  404,  353,  158,   81,  404,  404,
      353,  404,  404,  348,  349,  404,  350,  404,  348,  354,
      365,  355,  282,  366,   81,  282,  362,  367,  404,  404,
      404,  404,  404,  404,  404,  368,  404,  363,  204,  404,
      404,  204,  404,  404,  370,  404,  404,  369,  369,  369,
      369,  369,  157,  404,  404,  158,   81,  375,  404,  353,
      404,  376,  404,  404,  404,  404,  404,  348,  365,  404,
      282,  366,  379,  282,  365,  367,  404,  365,  308,  404,
      404,  404,  383,  368,  282,  383,  384,  282,  404,  368,

      404,  404,  365,  371,  282,  366,  379,  282,  377,  367,
      378,  390,  404,  404,  390,  404,  404,  368,  380,  404,
      404,  380,  308,  376,  404,  404,  404,  381,  381,  381,
      381,  381,  157,  404,  404,  157,  404,  404,  404,  404,
      404,  369,  369,  369,  369,  369,  157,  348,  157,  158,
       81,  158,   81,  353,  404,  353,  404,  157,  404,  404,
      158,  348,  404,  348,  159,  391,  282,  404,  282,  282,
      308,  282,  160,  404,  383,  392,  282,  383,  384,  282,
      404,  404,  404,  404,  385,  390,  386,  380,  390,  398,
      380,  308,  404,  404,  404,  404,  381,  381,  381,  381,

      381,  365,  404,  404,  365,  308,  404,  404,  404,  404,
      381,  381,  381,  381,  381,  157,  368,  157,  158,   81,
      158,   81,  353,  404,  353,  404,  404,  404,  404,  404,
      348,  157,  348,  157,  158,   81,  158,   81,  353,  404,
      353,  404,  404,  404,  404,  404,  348,  404,  348,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  394,  404,
      404,  404,  404,  404,  393,   12,   12,   12,   12,   12,
       12,   12,   12,   12,   12,   12,   54,   54,  404,   54,
       54,   54,   54,   54,   54,   54,   54,   66,   66,   66,
       66,   66,   66,   66,   66,   66,   66,   66,   56,  404,

      404,   56,  404,  404,   56,   56,   79,  404,  404,  404,
       79,   79,  404,   79,   79,   79,   79,  126,  404,  404,
      126,  404,  126,  404,  126,  130,  130,  404,  404,  130,
      130,  404,  130,  130,  130,  130,  136,  404,  404,  136,
      404,  404,  404,  404,  404,  136,   80,   80,  404,  404,
       80,   80,  404,   80,   80,   80,   80,   81,   81,  404,
      404,   81,   81,  404,   81,   81,   81,   81,  187,  187,
      404,  187,  187,  404,  187,  187,  187,  187,  187,  196,
      196,  404,  404,  196,  196,  404,  196,  196,  196,  196,
      206,  206,  404,  404,  206,  206,  404,  206,  206,  206,

      206,  218,  218,  404,  404,  218,  218,  404,  218,  218,
      218,  218,  205,  404,  404,  205,  404,  404,  404,  205,
      205,  237,  237,  404,  237,  237,  237,  237,  237,  237,
      237,  237,  239,  239,  404,  239,  239,  404,  239,  239,
      239,  239,  239,  250,  250,  404,  404,  250,  250,  404,
      250,  250,  250,  250,  255,  255,  404,  255,  255,  404,
      255,  255,  255,  255,  255,  282,  282,  404,  282,  282,
      404,  282,  282,  282,  282,  282,  327,  327,  404,  404,
      327,  327,  404,  327,  327,  327,  327,  340,  340,  404,
      340,  340,  404,  340,  340,  340,  340,  340,  351,  351,

      404,  404,  351,  351,  404,  351,  351,  351,  351,  358,
      358,  404,  404,  358,  358,  404,  358,  358,  358,  358,
      361,  361,  404,  404,  361,  361,  404,  361,  361,  361,
      361,  364,  364,  404,  364,  364,  364,  364,  364,  364,
      364,  364,  374,  374,  404,  374,  374,  404,  374,  374,
      374,  374,  374,  382,  382,  404,  382,  382,  382,  382,
      382,  382,  382,  382,  397,  397,  404,  404,  397,  397,
      404,  397,  397,  397,  397,  400,  400,  404,  400,  400,
      404,  400,  400,  400,  400,  400,   11,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,

      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404
    } ;

static yyconst short int yy_chk[1739] =
    {   0,
        0,    1,    1,    0,    1,    0,    1,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    2,    2,    2,    2,    2,    2,    2,    3,    3,
      401,    3,    6,    3,    4,    6,  400,    4,    5,    5,
       24,    5,  399,    5,    7,    7,  298,    7,   24,    7,
        8,    9,    9,    8,    9,    3,    9,   10,  316,   13,
       10,    4,   13,    6,   13,    3,   22,   22,    3,    5,

        6,    4,    3,    3,    4,    7,    5,    6,    4,    4,
      298,    8,    7,    5,   20,   60,   60,   18,    8,    7,
       18,   20,   20,  396,   42,    8,   42,   28,  388,    9,
       21,   28,   18,  316,   62,   10,   16,   21,   21,   16,
       28,   16,   62,   16,   16,   16,   16,   16,   16,   16,
       21,  299,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,  252,  252,   16,   36,   16,   16,   48,   36,
       48,   16,   56,   70,   35,   56,   70,   35,   36,  272,
       16,   19,   36,   19,  127,  299,   19,   56,   19,   19,
       37,   41,  387,   37,   41,   37,   47,  374,  127,   47,

       43,   35,   19,   43,  115,   43,  115,   19,   19,   19,
       29,   35,  373,   29,   35,   29,  272,  372,   35,   35,
       49,   37,   41,   49,  124,   49,  124,   47,   37,   41,
       72,   43,  357,   72,   47,   37,   41,   29,   43,   52,
       89,   47,   52,   89,   52,   43,  356,   29,   51,   68,
       29,   51,   68,   68,   29,   29,   58,   51,   51,   51,
       51,   51,   59,   58,   58,   80,  345,   65,   80,   59,
       59,   65,   69,  344,   71,   69,   69,   71,  135,   80,
       65,  135,   59,   71,   71,   71,   71,   71,   73,  125,
      340,   73,  125,   74,  125,  273,   74,   73,   73,   73,

       73,   73,   74,   74,   74,   74,   74,   75,   92,  337,
       75,   92,   76,  310,  310,   76,   75,   75,   75,   75,
       75,   76,   76,   76,   76,   76,   77,  165,  336,   77,
      165,   78,  273,  317,   78,   77,   77,   77,   77,   77,
       78,   78,   78,   78,   78,   79,   81,  114,   79,   81,
      114,   82,   79,   81,   82,  335,   92,  333,   82,   79,
       79,   81,  332,  106,  322,   82,   82,  106,  107,  116,
      317,  107,  116,  107,  116,  321,  106,  314,  114,  123,
      106,  169,  123,  306,  169,  114,  126,  126,  126,  126,
      126,  130,  114,  323,  130,  130,   82,  323,  305,  107,

      116,  134,  134,  134,  134,  134,  107,  116,  157,  132,
      123,  157,  132,  107,  116,  295,  294,  123,  132,  132,
      132,  132,  132,  157,  123,  129,  170,  153,  129,  170,
      153,  153,  129,  284,  129,  129,  129,  129,  129,  133,
      129,  153,  133,  212,  137,  283,  212,  137,  133,  133,
      133,  133,  133,  137,  137,  137,  137,  137,  138,  138,
      138,  138,  138,  139,  282,  280,  139,  140,  140,  140,
      140,  140,  139,  139,  139,  139,  139,  141,  279,  277,
      141,  142,  142,  142,  142,  142,  141,  141,  141,  141,
      141,  143,  276,  265,  143,  144,  144,  144,  144,  144,

      143,  143,  143,  143,  143,  145,  264,  256,  145,  146,
      146,  146,  146,  146,  145,  145,  145,  145,  145,  147,
      255,  248,  147,  148,  148,  148,  148,  148,  147,  147,
      147,  147,  147,  149,  247,  150,  149,  152,  150,  245,
      152,  244,  150,  154,  152,  239,  154,  149,  149,  150,
      150,  151,  152,  155,  151,  156,  155,  154,  156,  232,
      151,  151,  151,  151,  151,  151,  160,  155,  158,  160,
      160,  158,  231,  217,  226,  158,  217,  159,  225,  152,
      159,  152,  266,  158,  220,  266,  159,  159,  159,  159,
      159,  161,  171,  214,  161,  171,  171,  156,  161,  156,

      168,  174,  211,  168,  174,  161,  161,  210,  203,  168,
      168,  168,  168,  168,  189,  206,  174,  189,  206,  206,
      161,  188,  188,  188,  188,  188,  202,  187,  189,  190,
      192,  186,  190,  192,  205,  185,  184,  205,  190,  190,
      190,  190,  190,  190,  191,  192,  183,  191,  205,  205,
      181,  180,  178,  191,  191,  191,  191,  191,  191,  191,
      193,  287,  194,  193,  287,  194,  177,  193,  309,  194,
      176,  309,  192,  195,  192,  193,  195,  194,  196,  175,
      195,  196,  196,  197,  173,  167,  197,  197,  195,  166,
      201,  198,  196,  201,  198,  198,  199,  197,  199,  199,

      199,  199,  193,  194,  193,  198,  204,  164,  200,  204,
      199,  200,  200,  163,  195,  204,  204,  204,  204,  204,
      207,  162,  209,  207,  207,  209,  122,  213,  121,  209,
      213,  213,  201,  120,  201,  119,  209,  209,  216,  216,
      216,  216,  216,  221,  223,  118,  221,  223,  224,  117,
      200,  224,  200,  113,  112,  111,  209,  218,  221,  223,
      218,  218,  222,  224,  110,  222,  218,  218,  218,  218,
      218,  222,  222,  222,  222,  222,  234,  235,  236,  234,
      235,  236,  109,  241,  235,  236,  241,  241,  108,  104,
      234,  234,  235,  236,  237,  103,  237,  237,  237,  237,

      238,  102,  242,  238,  238,  242,  242,  240,  237,  240,
      240,  240,  240,  101,  238,  235,  236,  246,  100,  243,
      246,  240,  243,  243,  246,  241,  250,  241,   99,  250,
      250,  246,  246,   98,  259,  249,  246,  259,  249,  261,
       97,   96,  261,  242,  249,  249,  249,  249,  249,  259,
       95,   93,  253,  263,  261,  253,  263,   91,   90,   88,
      243,  253,  253,  253,  253,  253,  254,   87,  263,  254,
      254,  257,   86,   85,  257,  254,  254,  254,  254,  254,
      257,  257,  257,  257,  257,  258,  258,  258,  258,  258,
      262,  267,  271,  262,  267,  271,  271,   84,  267,  262,

      262,  262,  262,  262,  268,   83,  267,  268,   66,  269,
      274,  268,  269,  274,  274,  278,   64,  275,  278,  268,
      275,  275,  278,  269,  285,  285,  285,  285,  285,  278,
      278,   63,  290,   61,  271,  290,  271,   50,  292,  300,
      267,  292,  300,  300,   46,  268,   45,  290,  274,  281,
      278,   44,  281,  292,  286,  275,   40,  286,  281,  281,
      281,  281,  281,  286,  286,  286,  286,  286,  288,   39,
       38,  288,  289,  289,  289,  289,  289,  288,  288,  288,
      288,  288,  296,  297,  307,  296,  297,  307,  300,  296,
      297,  301,   34,  304,  301,  301,  304,  296,  297,  311,

      304,  312,  311,  311,  312,   33,  313,  304,  304,  313,
       32,   31,  313,   30,  313,  318,  312,  319,  318,  318,
      319,  319,   27,  320,   26,   25,  320,   23,  307,   17,
      320,  324,  301,   11,  324,    0,  304,  320,  320,    0,
      324,  324,  324,  324,  324,  327,    0,  329,  327,  327,
      329,    0,    0,  329,    0,  329,  330,  330,  330,  330,
      330,  334,  339,  346,  334,  339,  346,  346,  334,    0,
        0,  339,  339,  339,  339,  339,  334,  341,  341,  341,
      341,  341,  342,    0,    0,  342,  342,  343,    0,  348,
      343,  343,  348,  348,  343,  349,    0,  342,  349,  349,

        0,    0,  343,  334,    0,  334,  350,  346,  351,  350,
      350,  351,  351,  354,    0,  351,  354,  354,  358,    0,
      354,  358,  358,  351,  342,    0,  342,    0,  354,  343,
      352,  343,  352,  352,  352,  352,  349,  352,    0,  360,
        0,    0,  360,  360,    0,  352,  361,  350,  353,  361,
      361,  353,  353,    0,  354,    0,    0,  353,  353,  353,
      353,  353,  355,    0,    0,  355,  355,  360,    0,  355,
      362,  360,  363,  362,  362,  363,  363,  355,  364,    0,
      364,  364,  364,  364,  365,  364,  375,  365,  365,  375,
      375,    0,  368,  364,  368,  368,  368,  368,    0,  365,

        0,    0,  366,  355,  366,  366,  366,  366,  362,  366,
      363,  376,    0,    0,  376,  376,  377,  366,  367,  377,
      377,  367,  367,  375,    0,    0,    0,  367,  367,  367,
      367,  367,  369,    0,  378,  369,  369,  378,  378,    0,
        0,  369,  369,  369,  369,  369,  370,  369,  371,  370,
      370,  371,  371,  370,    0,  371,    0,  379,    0,    0,
      379,  370,    0,  371,  379,  377,  382,    0,  382,  382,
      382,  382,  379,    0,  383,  378,  383,  383,  383,  383,
        0,    0,    0,    0,  370,  390,  371,  380,  390,  390,
      380,  380,    0,    0,    0,    0,  380,  380,  380,  380,

      380,  381,    0,  391,  381,  381,  391,  391,    0,    0,
      381,  381,  381,  381,  381,  385,  381,  386,  385,  385,
      386,  386,  385,  392,  386,  397,  392,  392,  397,  397,
      385,  393,  386,  394,  393,  393,  394,  394,  393,    0,
      394,    0,    0,    0,    0,    0,  393,    0,  394,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  386,    0,
        0,    0,    0,    0,  385,  405,  405,  405,  405,  405,
      405,  405,  405,  405,  405,  405,  406,  406,    0,  406,
      406,  406,  406,  406,  406,  406,  406,  407,  407,  407,
      407,  407,  407,  407,  407,  407,  407,  407,  408,    0,

        0,  408,    0,    0,  408,  408,  409,    0,    0,    0,
      409,  409,    0,  409,  409,  409,  409,  410,    0,    0,
      410,    0,  410,    0,  410,  411,  411,    0,    0,  411,
      411,    0,  411,  411,  411,  411,  412,    0,    0,  412,
        0,    0,    0,    0,    0,  412,  413,  413,    0,    0,
      413,  413,    0,  413,  413,  413,  413,  414,  414,    0,
        0,  414,  414,    0,  414,  414,  414,  414,  415,  415,
        0,  415,  415,    0,  415,  415,  415,  415,  415,  416,
      416,    0,    0,  416,  416,    0,  416,  416,  416,  416,
      417,  417,    0,    0,  417,  417,    0,  417,  417,  417,

      417,  418,  418,    0,    0,  418,  418,    0,  418,  418,
      418,  418,  419,    0,    0,  419,    0,    0,    0,  419,
      419,  420,  420,    0,  420,  420,  420,  420,  420,  420,
      420,  420,  421,  421,    0,  421,  421,    0,  421,  421,
      421,  421,  421,  422,  422,    0,    0,  422,  422,    0,
      422,  422,  422,  422,  423,  423,    0,  423,  423,    0,
      423,  423,  423,  423,  423,  424,  424,    0,  424,  424,
        0,  424,  424,  424,  424,  424,  425,  425,    0,    0,
      425,  425,    0,  425,  425,  425,  425,  426,  426,    0,
      426,  426,    0,  426,  426,  426,  426,  426,  427,  427,

        0,    0,  427,  427,    0,  427,  427,  427,  427,  428,
      428,    0,    0,  428,  428,    0,  428,  428,  428,  428,
      429,  429,    0,    0,  429,  429,    0,  429,  429,  429,
      429,  430,  430,    0,  430,  430,  430,  430,  430,  430,
      430,  430,  431,  431,    0,  431,  431,    0,  431,  431,
      431,  431,  431,  432,  432,    0,  432,  432,  432,  432,
      432,  432,  432,  432,  433,  433,    0,    0,  433,  433,
        0,  433,  433,  433,  433,  434,  434,    0,  434,  434,
        0,  434,  434,  434,  434,  434,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,

      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404,  404,  404,
      404,  404,  404,  404,  404,  404,  404,  404
    } ;

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
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "./cfg.l"
#define INITIAL 0
#line 2 "./cfg.l"
/*
 * Cfg file reader, Greg Lee, 8/93.
 * Adapted from Adagio for KMidi 12/99.
 *	$Id$
 */
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "gtim.h"
#include "common.h"
#include "instrum.h"
#include "playmidi.h"
#include "effects.h"
#include "md.h"
#include "readmidi.h"
#include "output.h"
#include "controls.h"
#include "tables.h"
#include "version.h"

#define YY_ALWAYS_INTERACTIVE 0
#define YY_NEVER_INTERACTIVE 1

#define YY_INPUT(buf,result,max_size) \
	 result = fread( buf, 1, max_size, yyin );

#ifdef STANDALONE
extern int set_play_mode(char *cp);
#endif
static int prescanning;
static char doing_drums = 0;
static char doing_sf = 0;
static int patchno = -1;
static int i, j;
static char *patchname;
static char cfg_flag = 1;
static int tone_bank;
static void set_patchno(char *m);

static char *s_dirname = 0;
static char *sfname = 0;

static int current_toneset = 0;
static int current_drumset = 0;

static int cfg_condition = -1;

static ToneBank *bank=0;
static int banknum=0;
static int rcf_count=1;
static int font_type=FONT_NORMAL;


#define MAX_INCLUDE_DEPTH 40
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
static int include_stack_ptr = 0;

static void new_toneset(int n);
static void new_patch(const char *vname, int num);

#include "xmap.h"

static int map_col, map_row;

#define YY_NO_UNPUT 1
#define P 1
#define K 2
#define S 3
#define M 4


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

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#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 79 "./cfg.l"



	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 >= 405 )
					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_current_state != 404 );
		yy_cp = yy_last_accepting_cpos;
		yy_current_state = yy_last_accepting_state;

yy_find_action:
		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_RULE_SETUP
#line 81 "./cfg.l"
;
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 82 "./cfg.l"
;
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 84 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 2;
	cfg_condition = atoi(yytext+i);
}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 90 "./cfg.l"
{
	cfg_condition = 0;
}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 93 "./cfg.l"
{
	int sf_oldbank, sf_newbank = banknum;
	int i = 0, j;
	while (isspace(yytext[i])) i++;
	if (yytext[i+1] == 'f') i += 2;
	else i += 3;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == '"') {
		i++;
		for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
		/*j--;*/
	}
	else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
	sfname = strncpy( (char *)malloc(j-i+1), yytext+i, j-i );
	sfname[j-i] = '\0';
	if (doing_drums) sf_newbank += 256;
	sf_oldbank = sf_newbank;
	if (j < yyleng) {
		while (j < yyleng && isspace(yytext[j])) j++;
		if (j < yyleng && isdigit(yytext[j])) sf_oldbank = atoi(yytext+j);
	}
	if (!init_soundfont(sfname, sf_oldbank, sf_newbank, rcf_count)) return -1;
}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 116 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == 'd') i += 3;
	else i += 9;
	while (isspace(yytext[i])) i++;
	s_dirname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );
	add_to_pathlist(s_dirname, rcf_count);
	free(s_dirname);
}
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 126 "./cfg.l"
{
	char *fname;
	int i = 0;
	FILE *save_yyin;

	while (isspace(yytext[i])) i++;
	i += 6;
	while (isspace(yytext[i])) i++;

	 if (prescanning && cfg_condition >= 0 && cfg_condition < 30 &&
		rcf_count==1 && !cfg_names[cfg_condition])
	  {
	    cfg_names[cfg_condition] = (char *)safe_malloc(strlen(yytext+i)+1);
	    strcpy(cfg_names[cfg_condition], yytext+i);
	  }

    if (!prescanning && (cfg_condition < 0 || cfg_condition == cfg_select)) {


        if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Probable source loop in configuration files");
		return (-1);
        }
        include_stack[include_stack_ptr++] =
                YY_CURRENT_BUFFER;

	fname = strcpy( (char *)malloc(strlen(yytext+i)+1), yytext+i );

	save_yyin = yyin;
	yyin = NULL;

	yyin = open_file(fname, 1, OF_VERBOSE, rcf_count);

	if (yyin == NULL) {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Source file %s not found\n", fname);
		include_stack_ptr--;
	}

	if (yyin == NULL) yyin = save_yyin;
	else {
            cfg_condition = -1;
	    rcf_count++;
            yy_switch_to_buffer(
                yy_create_buffer( yyin, YY_BUF_SIZE ) );
	}
    }
    cfg_condition = -1;
}  
	YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(P):
case YY_STATE_EOF(K):
case YY_STATE_EOF(S):
case YY_STATE_EOF(M):
#line 177 "./cfg.l"
{
        if ( --include_stack_ptr < 0 ) {
                yyterminate();
        }
        else {
		if (yyin) close_file(yyin);
                yy_delete_buffer( YY_CURRENT_BUFFER );
		rcf_count--;
                yy_switch_to_buffer(
                     include_stack[include_stack_ptr] );
        }
}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 190 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 1;
	new_toneset(current_drumset);
	font_type=FONT_SBK;
    if (!bank->name) {
	while (isspace(yytext[i])) i++;
	while (isdigit(yytext[i])) i++;
	while (isspace(yytext[i])) i++;
	if (yytext[i+1] == 'f') i += 2; else i += 3;
	while (isspace(yytext[i])) i++;
	patchname = yytext + i;
	if (patchname[0] == '"') {
		bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
		bank_name[strlen(patchname)-2] = '\0';
	}
	else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
	bank->name = bank_name;
    }

}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 216 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 1;
	new_toneset(current_drumset);
	font_type=FONT_SBK;
}
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 226 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
    if (!bank->name) {
	while (isspace(yytext[i])) i++;
	while (isdigit(yytext[i])) i++;
	while (isspace(yytext[i])) i++;
	patchname = yytext + i;
	if (patchname[0] == '"') {
		bank_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
		bank_name[strlen(patchname)-2] = '\0';
	}
	else bank_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
	bank->name = bank_name;
    }
}
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 249 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	current_drumset = atoi(yytext+i);
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 259 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 4;
	current_toneset = atoi(yytext+i);
	doing_drums = 0;
	doing_sf = 1;
	new_toneset(current_toneset);
	font_type=FONT_SBK;
}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 269 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 4;
	current_toneset = atoi(yytext+i);
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 279 "./cfg.l"
{
	current_toneset = SFXBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 286 "./cfg.l"
{
	current_drumset = SFXDRUM1;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
	bank->name = "drumsfx1";
}
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 294 "./cfg.l"
{
	current_drumset = SFXDRUM2;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
	bank->name = "drumsfx2";
}
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 303 "./cfg.l"
{
	BEGIN(M);
	if (xmap[map_row][0]) {
		if (xmap[map_row][1] == xmap[map_row][3] &&
		    xmap[map_row][2] == xmap[map_row][4] )
			xmap[map_row][0] = 0;
		else if (map_row < XMAPMAX) map_row++;
	}
	map_col = -1;
}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 314 "./cfg.l"
{
	xmap[map_row][0] = SFXBANK;
	map_col = 1;
	current_toneset = SFXBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset);
	font_type=FONT_NORMAL;
}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 323 "./cfg.l"
{
	xmap[map_row][0] = SFXDRUM1;
	map_col = 1;
	current_drumset = SFXDRUM1;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset);
	font_type=FONT_NORMAL;
	bank->name = "drumsfx1";
}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 333 "./cfg.l"
{
	xmap[map_row][0] = XGDRUM;
	map_col = 1;
}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 338 "./cfg.l"
{
	if (map_col >= 1 && map_col <= 4)
		xmap[map_row][map_col++] = atoi(yytext);
}
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 343 "./cfg.l"
{
	doing_drums = 0;
}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 346 "./cfg.l"
{
	doing_drums = 1;
	current_drumset = current_toneset;
}
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 351 "./cfg.l"
{
	const char *gm_name = NULL;
	char *vc_name = NULL;
	patchno = atoi(yytext);
	tone_bank = 0;
	if (patchno >= 0) {
		i = 0;
		while (isspace(yytext[i])) i++;
		while (isdigit(yytext[i])) i++;
		if (yytext[i] == ',') {
			i++;
			tone_bank = atoi(yytext + i);
			while (isdigit(yytext[i])) i++;
		}
		else {
			if (doing_drums) tone_bank = current_drumset;
			else tone_bank = current_toneset;
		}
		new_toneset(tone_bank);

		while (isspace(yytext[i])) i++;
		if (!cfg_flag && yytext[i] == '=') i++;
		if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
			patchname = yytext + i;
		else patchname++;
		if (patchname[0] == '"') {
			vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
			vc_name[strlen(patchname)-2] = '\0';
		}
		else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
		if (patchno < 128) gm_name = gm_voice[doing_drums? patchno+128 : patchno].vname;
		else {
		    ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad patch number %d in cfg file.", patchno);
		}
		if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";

	        ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
			gm_name, patchno, tone_bank, vc_name);

		new_patch(vc_name, patchno);

	}
	BEGIN(P);
}
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 396 "./cfg.l"
{
	const char *gm_name = NULL;
	char *vc_name = NULL;
	int i;
	set_patchno(yytext);
	tone_bank = 0;
	if (patchno < 256) {
		i = 0;
		while (yytext[i] != '=' && yytext[i] != ',') i++;
		if (yytext[i] == ',') {
			i++;
			tone_bank = atoi(yytext + i);
		}
		else {
			if (doing_drums) tone_bank = current_drumset;
			else tone_bank = current_toneset;
		}

		while (yytext[i] != '=') i++;
		i++;
		while (isspace(yytext[i])) i++;
		if ( (patchname = strrchr(yytext + i, '\\')) == NULL)
			patchname = yytext + i;
		else patchname++;
		if (patchname[0] == '"') {
			vc_name = strncpy( (char *)malloc(strlen(patchname)-1), patchname + 1, strlen(patchname)-1 );
			vc_name[strlen(patchname)-2] = '\0';
		}
		else vc_name = strcpy( (char *)malloc(strlen(patchname)+1), patchname );
		gm_name = gm_voice[patchno].vname;
		if (gm_name == NULL) gm_name = (doing_drums)? "drum":"instr";

	        ctl->cmsg(CMSG_INFO, VERB_DEBUG, "config: voice %s[%d,%d] = patch %s",
			gm_name, patchno, tone_bank, vc_name);

	}
	else {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "Bad line \"%s ...\" in cfg file.", yytext);
	}
	new_patch(vc_name, patchno);
	
	BEGIN(P);
}
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 440 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j <= MAX_VOICES) config_voices = j;
	} }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 445 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j <= MAX_AMPLIFICATION) config_amplification = j;
	} }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 450 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j > 1 && j <= MAX_CONTROL_RATIO) control_ratio = j;
	} }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 455 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j < 100) j *= 1000;
		if (j > MIN_OUTPUT_RATE && j <= MAX_OUTPUT_RATE) play_mode->rate = j;
	} }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 461 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		max_patch_memory = j * 1000000;
	} }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 466 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 3) config_interpolation = j;
	} }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 471 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_expression_curve = j;
	} }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 476 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_volume_curve = j;
	} }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 481 "./cfg.l"
{ if (prescanning) {
		i=0; while(isspace(yytext[i])) i++;
		i+=2;
		while(isspace(yytext[i])) i++;
#ifdef STANDALONE
		if (set_play_mode(yytext+i)) /* error */;
#endif
	} }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 490 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].amp = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 496 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].note = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 502 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') i++;
	bank->tone[patchno].tuning = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 508 "./cfg.l"
BEGIN(K);
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 509 "./cfg.l"
BEGIN(S);
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 511 "./cfg.l"
{
		  bank->tone[patchno].strip_loop=0;
	BEGIN(P);
}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 515 "./cfg.l"
{
		  bank->tone[patchno].strip_tail=0;
	BEGIN(P);
}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 519 "./cfg.l"
{
		  bank->tone[patchno].strip_envelope=0;
	BEGIN(P);
}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 523 "./cfg.l"
{
		  bank->tone[patchno].strip_loop=1;
	BEGIN(P);
}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 527 "./cfg.l"
{
		  bank->tone[patchno].strip_tail=1;
	BEGIN(P);
}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 531 "./cfg.l"
{
		  bank->tone[patchno].strip_envelope=1;
	BEGIN(P);
}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 535 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags &= ~SOLO_MASK;
}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 539 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags |= SOLO_MASK;
}
	YY_BREAK
case 48:
#line 545 "./cfg.l"
case 49:
YY_RULE_SETUP
#line 545 "./cfg.l"
{
	patchno = -1;
	BEGIN(0);
}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 549 "./cfg.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;
		YY_RESTORE_YY_MORE_OFFSET

		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_last_accepting_cpos;
				yy_current_state = yy_last_accepting_state;
				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 single character, 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_current_buffer->yy_n_chars = 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 );

		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	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 >= 405 )
				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 >= 405 )
			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 == 404);

	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_current_buffer->yy_n_chars =
			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 */
			int offset = yy_c_buf_p - yytext_ptr;
			++yy_c_buf_p;

			switch ( yy_get_next_buffer() )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because yy_g_n_b()
					 * sees that we've accumulated a
					 * token and flags that we need to
					 * try matching the token before
					 * proceeding.  But for input(),
					 * there's no matching to consider.
					 * So convert the EOB_ACT_LAST_MATCH
					 * to EOB_ACT_END_OF_FILE.
					 */

					/* Reset buffer status. */
					yyrestart( yyin );

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						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 + offset;
					break;
				}
			}
		}

	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

	{
	if ( ! b )
		return;

	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 *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
	{
	int len;
	for ( len = 0; yy_str[len]; ++len )
		;

	return yy_scan_bytes( yy_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_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_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
	{
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
	}
#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 549 "./cfg.l"


static void new_toneset(int n)
{
	banknum=n;

	if (!doing_drums) {
	  if (!tonebank[n]) {
		tonebank[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
	      	memset(tonebank[n], 0, sizeof(ToneBank));
	  }
	  bank=tonebank[n];
	}
	else {
	  if (!drumset[n]) {
		drumset[n]=(ToneBank *)safe_malloc(sizeof(ToneBank));
	      	memset(drumset[n], 0, sizeof(ToneBank));
	  }
	  bank=drumset[n];
	}
}

static void new_patch(const char *vname, int num)
{
	if (bank->tone[num].name) return;
	bank->tone[num].name=vname;
	bank->tone[num].note=bank->tone[num].amp=bank->tone[num].pan=
	  bank->tone[num].strip_loop=bank->tone[num].strip_envelope=
	    bank->tone[num].sf_ix=
	    bank->tone[num].strip_tail=bank->tone[num].last_used=-1;
	bank->tone[num].font_type=font_type;
	bank->tone[num].tuning=0;
	bank->tone[num].layer=0;
}

static void set_patchno(char *m)
{
	int i,j,w,y;
	const char *vn;
	y = w = 0;
	while (isspace(m[w])) w++;
	for (i = 0; i < 256; i++) {
		vn = gm_voice[i].vname;
		if (vn == NULL) continue;
		for (j = 0; m[j+w] && vn[j+y] && m[j+w] == vn[j+y]; j++)
		    if (vn[j+y+1] && isspace(vn[j+y+1]) && m[j+w+1] && !isspace(m[j+w+1]) ) y++ ;
		if (!m[j+w] || m[j+w] == '=' || m[j+w] == ',' || m[j+w] == ':') break;
		if (!vn[j+y] && isspace(m[j+w])) break;
	}
	if (i < 256 && vn != NULL) patchno = i;
	else patchno = 256;
}


char *current_config_file = 0;
int current_config_pc42b = 0;

static int pc42b_config_file(const char *name, int prescan);

int read_config_file(const char *name, int prescan)
{
	int retvalue = 0, i;
	prescanning = prescan;
	include_stack_ptr = 0;
	rcf_count = 1;

	if (current_config_pc42b) {
		return pc42b_config_file(name, prescan);
	}

	if (current_config_file) {
		yyin = fopen(current_config_file, "r");
	}
	else yyin = open_file(name, 1, OF_VERBOSE, rcf_count);

	if (!yyin) return -1;

	if (!current_config_file) {
	   current_config_file = (char *)safe_malloc(strlen(current_filename)+1);
	   strcpy(current_config_file, current_filename);
	}

	for (i = 0; i < XMAPMAX; i++) xmap[i][0] = 0;
	map_row = map_col = 0;
	current_toneset = current_drumset = 0;
	doing_drums = doing_sf = 0;
	if (!(retvalue = yylex())) {
	   if (prescan) got_a_configuration = 1;
	   else got_a_configuration = 2;
	}

#if 0
	if (!prescan) {
		fprintf(stderr,"int xmap[][] = {\n");

		for (i = 0; i < XMAPMAX; i++) {
			 if (!xmap[i][0]) break;
			fprintf(stderr,"{ %d, %d, %d, %d, %d }\n",
				xmap[i][0],
				xmap[i][1],
				xmap[i][2],
				xmap[i][3],
				xmap[i][4]
				);
		}
		fprintf(stderr,"};\n");
	}
#endif
	close_file(yyin);
	return retvalue;
}

#include "PC42b.h"

static int pc42b_config_file(const char *name, int prescan)
{
	int retvalue = 0;
	int i = 0;
	prescanning = prescan;
	rcf_count = 1;

	doing_drums = 0;
	new_toneset(3);
	new_toneset(4);
	new_toneset(5);
	new_toneset(6);
	new_toneset(7);
	new_toneset(8);
	new_toneset(9);
	new_toneset(120);

	doing_drums = 1;
	new_toneset(26);
	new_toneset(49);
	new_toneset(50);
	new_toneset(121);
	new_toneset(122);
	new_toneset(127);

	current_toneset = current_drumset = 0;
	doing_drums = doing_sf = 0;

	while (1) {
		int action, which;
		const char *sfname;

		action = PC42b[i].font_code;
		which = PC42b[i].num;
		sfname = PC42b[i].name;

		switch (action) {
			case FONT_TONESET:
				current_toneset = which;
				doing_drums = 0;
				doing_sf = 1;
				new_toneset(current_toneset);
				font_type=FONT_SBK;
				break;
			case FONT_DRUMSET:
				current_drumset = which;
				doing_drums = 1;
				doing_sf = 1;
				new_toneset(current_drumset);
				font_type=FONT_SBK;
    				if (!bank->name) bank->name = sfname;
				break;
			case FONT_PRESET:
				patchno = which;
				if (doing_drums) tone_bank = current_drumset;
				else tone_bank = current_toneset;
				new_toneset(tone_bank);
				new_patch(sfname, patchno);
				break;
			case FONT_SBK:
				if (!init_soundfont((char *)sfname, which, which, 1)) retvalue = -1;
				break;
		}

		if (action == FONT_SBK) break;
		i++;
	}

	/*if (prescan) got_a_configuration = 1;
	else*/ got_a_configuration = 2;
	return retvalue;
}

