#line 2 "cfg.c"

#line 4 "cfg.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 31
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

/* First, we deal with  platform-specific or compiler-specific issues. */

/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */

#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t; 
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN               (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN              (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN              (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX               (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX              (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX              (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX              (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX             (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX             (4294967295U)
#endif

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_CONST

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

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#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. */
#ifndef YY_BUF_SIZE
#define YY_BUF_SIZE 16384
#endif

#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

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

    #define YY_LESS_LINENO(n)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = (yy_hold_char); \
		YY_RESTORE_YY_MORE_OFFSET \
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - 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).
 */

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef unsigned int yy_size_t;
#endif

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
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;

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */
    
	/* 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

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */

/* 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".
 *
 * Returns the top of the stack, or NULL.
 */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)

/* Same as previous macro, but useful when we know that the buffer stack is not
 * NULL or when we need an lvalue. For internal use only.
 */
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]

/* 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 (FILE *input_file  );
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
void yy_delete_buffer (YY_BUFFER_STATE b  );
void yy_flush_buffer (YY_BUFFER_STATE b  );
void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
void yypop_buffer_state (void );

static void yyensure_buffer_stack (void );
static void yy_load_buffer_state (void );
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )

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

void *yyalloc (yy_size_t  );
void *yyrealloc (void *,yy_size_t  );
void yyfree (void *  );

#define yy_new_buffer yy_create_buffer

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

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

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

#define yywrap(n) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;

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

typedef int yy_state_type;

extern int yylineno;

int yylineno = 1;

extern char *yytext;
#define yytext_ptr yytext

static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
static int yy_get_next_buffer (void );
static void yy_fatal_error (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 = (size_t) (yy_cp - yy_bp); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
	(yy_c_buf_p) = yy_cp;

#define YY_NUM_RULES 53
#define YY_END_OF_BUFFER 54
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static yyconst flex_int16_t yy_accept[532] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   54,   52,
       52,   51,   33,   52,   33,   52,   52,   52,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,   52,
       52,   52,   52,    0,   33,   33,    0,   33,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
       33,   34,   33,    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,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,   33,   33,   21,    0,    0,    0,   25,
        0,   32,    0,   31,    0,   30,    0,   29,    0,   28,
        0,   23,    0,   27,    0,   26,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,   16,
        0,    0,    0,    0,    0,    0,    0,    0,    0,   43,

        0,    0,    0,   47,    0,    0,    0,   33,   33,    0,
       24,    0,    0,    0,    0,    0,    0,    0,   22,    0,
        0,    0,   22,    0,    0,    0,    0,    0,   22,    0,
        0,    0,    0,    0,    0,    0,    0,    2,    1,    0,
        3,    0,    0,    0,    0,   14,    0,    0,    0,    0,
        0,    0,    0,   41,    0,   42,   45,    0,   46,   33,
       33,   21,    0,    0,    0,    0,    0,    0,    0,    0,
       22,   22,    0,    0,    0,    0,    0,    0,    0,    5,
        0,    0,    0,    3,    3,    0,   15,    0,    0,    0,
       35,    0,    0,   39,    0,    0,    0,    0,    0,    0,

       33,   33,    0,    0,   22,   22,    0,    0,    0,   22,
       22,    0,    0,    0,    0,    0,   12,    0,    0,    0,
        0,    0,    3,    3,    0,    0,    0,    0,   36,    0,
       40,    0,    0,    0,   33,   33,   49,   50,    0,    0,
       22,   22,   49,   50,    0,    0,    0,    0,    5,    0,
        0,   13,    0,    0,    0,    0,    0,    0,   44,   48,
       33,   33,    0,    0,   22,   22,    0,    0,    0,    0,
        0,    0,   17,   18,    0,    6,    0,    0,   37,    0,
        0,   33,   33,   49,   50,    0,    0,    0,    0,   11,
       10,   10,    0,    0,   38,   33,   33,   33,   33,   33,

       33,   33,   33,   33,   33,   33,    0,    0,    0,    0,
        0,    0,    0,    6,   33,   33,   33,   33,   33,   33,
       33,   33,   33,   33,   33,   33,   25,   33,   32,   33,
       31,   33,   30,   33,   29,   33,   28,   33,   23,   33,
       27,   33,   26,    5,    5,    5,    5,    0,    5,    5,
        5,    0,    0,    9,    0,    0,    9,    4,    0,   33,
       33,   25,   33,   32,   33,   31,   33,   30,   33,   29,
       33,   28,   33,   23,   33,   27,   33,   26,   24,    5,
        5,    5,    0,    0,    0,    0,    0,    5,    5,    5,
        0,    0,    0,    0,    9,    8,    0,   24,    5,    5,

        5,    0,    0,   22,    0,    5,    5,    5,    0,    0,
        9,    0,    0,    4,    5,    5,    5,    5,   20,    0,
        7,    0,    0,    0,    0,    0,    0,    7,    0,   19,
        0
    } ;

static yyconst flex_int32_t 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,
       14,   14,   14,   14,   14,   14,   14,   15,    1,    1,
       16,    1,    1,    1,   17,   18,   19,   20,   18,   21,
       18,   18,   18,   18,   18,   18,   22,   23,   24,   25,
       18,   18,   18,   18,   18,   26,   18,   27,   18,   18,
       28,   29,   30,    1,    1,    1,   31,   32,   33,   34,

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

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

static yyconst flex_int16_t yy_base[564] =
    {   0,
        0,    7,   59,  107,  155,   69,  203,   71, 1195, 2207,
       63, 2207,    0,  251,   60,   67,  286,   66,   70,   58,
     1159,   48, 1138, 1143, 1128,   57, 1131,  333,   94, 1125,
     1116, 1119, 1102, 1093, 1071,  381,   78,  119, 1076, 1065,
     1055, 1073,  128,   87,   96,  137, 1055, 1034, 1024, 1042,
      145,   93,  133,  193,    0,    0,    0, 1027,  186,    0,
      166,  198,  123, 1036,  127, 1013, 1018,  998,  179, 1001,
     1034, 2207,   88,  147,  214,  120,  220,  216,  187,  235,
      304,  309,  334,  339,  356,  282,  194,  234,  382,  989,
      996,  976,  972,  952,  946,  221,  973,  936,  252,  920,

      239,    0,  290,  926,  913,  920,  902,  897,  877,  323,
      371,  859,  850,  863,  845,  846,  836,    0,  343,  397,
      835,  825,  814,  832,  811,  809,  796,  795,    0,  129,
      358,  413,  789,  781,  763,  771,  750,  749,  741,  749,
        0,  238,  391,  741,  181,  354,    0,  438,  452,  456,
      469, 2207,  352, 2207,  471,  475,  488,  483,  501,  496,
      514,  509,  527,  522,  540,  535,  391,  419,  553,  554,
      411,  567,  569,  555,  442,  571,  581,  454,  602,  732,
      728,  728,  470,  718,  724,  608,  742,  573,  583,  594,
      561,  625,    0,  607,  699,  691,  698,  685,  684, 2207,

      670,  666,  666, 2207,  653,  645,  651,  639,  285,  675,
      620,  638,  643,  657,  658,  673,  675,  681,  690,  696,
      707,  723,  712,  639,  622,  621,  729,  734,  623,  659,
        0,  747,  604,  601,  705,  749,  594, 2207,  753,  615,
      766,    0,  779,  590,  583,  762,  781,  793,  579,  794,
      798,  568,  562, 2207,  567, 2207, 2207,  566, 2207,  552,
      156, 2207,  806,  807,  815,  823,  830,  584,  835,  813,
      841,  846,  539,  537,  851,  572,  528,  863,  524,  867,
        0,   80,  674,  876,  890,  544,  871,  508,  508,  895,
      899,  501,  912, 2207,  913,  919,  918,  494,  491,  485,

      473,  252,  933,  934,  939, 2207,  920,  236,  366,  946,
      951,  464,  466,  956,  480,  465,  962,  698,  492,  443,
      439,  978,  985,  998,  434,  730,  999, 1011,  994, 1012,
     2207, 1016,  434,  433,  409,  957, 1024, 1025,  295,  313,
     1033, 1040, 2207, 2207, 1042,  411,  405, 1047, 2207,  853,
     1048, 1051,  393,  976, 1054, 1064, 1066, 1082, 2207, 2207,
      914, 1078,  206,  374, 1091, 1096, 1098,  384,  404,   62,
     1104, 1117, 2207, 2207,  356, 1106,    0, 1121, 1125, 1138,
     1138,  935, 1150,  395,  389, 1154,  356,  360,  330, 2207,
     1170, 1199,  982,  359, 1174, 1197, 1122, 1217, 1230, 1245,

     1265, 1278, 1282, 1295, 1299, 1312, 1314, 1326,  325,  318,
     1155, 1187, 1139, 2207, 1089, 1332, 1153, 1374, 1336, 1352,
     1356, 1394, 1407, 1411, 1424, 1428, 1440, 1260,  340, 1454,
      339, 1474, 1478, 1491, 1495, 1508, 1512, 1525, 1529, 1542,
     1546, 1559, 1563, 1203, 1350, 1469, 1576, 1582, 1588, 1601,
     1603,  296,  281, 1442,    0,  306, 1609, 1234,    0, 1616,
     1620, 1380, 1638,    0, 1650,    0, 1670, 1624, 1683, 1656,
     1687, 1691, 1704, 1699, 1717, 1712, 1730, 1725, 1737, 1316,
     1685, 1750, 1755, 1395, 1761, 1767, 1780, 1791, 1804, 1806,
      260,  267,  283, 1232, 1793, 1812,  261, 1777, 1495, 1819,

     1821, 1827, 1863, 1845, 1851,    0, 1857, 1876,  236,  197,
     2207, 1865, 1881, 2207, 1334, 1529, 1888, 1893, 2207,  182,
     1901,    0,  141,   36,   71, 1264,   37, 2207, 1909, 2207,
     2207, 1921, 1930, 1939, 1947, 1955, 1964, 1972, 1981, 1990,
     1999, 2008, 2017, 2026, 2035, 2044, 2053, 2062, 2071, 2080,
     2089, 2098, 2107, 2116, 2125, 2134, 2143, 2152, 2161, 2170,
     2179, 2188, 2197
    } ;

static yyconst flex_int16_t yy_def[564] =
    {   0,
      532,  531,  532,    2,  532,    2,  532,    2,  531,  531,
      531,  531,  533,  531,  534,  535,  531,  536,  536,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,   14,  531,  531,  531,  531,
      531,  531,   14,  531,  531,  531,  531,  531,  531,  531,
       14,  531,  531,  531,  533,  533,   14,  533,  535,   17,
      536,  536,  531,  531,  531,  531,  531,  531,  531,  531,
      534,  531,  534,  537,  537,  531,  531,  531,  538,  531,
      531,  531,  531,  531,  531,  536,  539,  540,  536,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,

      531,   28,  531,  531,  531,  531,  531,  531,  531,  531,
       28,  531,  531,  531,  531,  531,  531,   36,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,   43,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
       51,  531,  531,  533,  534,  537,  541,  531,  531,  531,
      531,  531,  538,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  536,  539,  540,
      542,  531,  539,  531,  531,  540,  531,  543,  536,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  544,  531,
      531,  531,  111,  531,  531,  531,  531,  531,  531,  531,

      531,  531,  531,  531,  531,  531,  531,  533,  534,  541,
      531,  531,  539,  539,  531,  540,  540,  540,  542,  543,
      542,  545,  543,  531,  531,  531,  531,  531,  543,  543,
      546,  536,  531,  531,  531,  547,  531,  531,  531,  531,
      544,  548,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  533,
      534,  531,  539,  540,  540,  545,  546,  546,  545,  546,
      543,  543,  531,  531,  536,  531,  531,  531,  531,  547,
      549,  531,  531,  531,  544,  548,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,

      533,  534,  540,  540,  539,  531,  546,  546,  546,  543,
      543,  531,  531,  536,  531,  531,  531,  531,  549,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  533,  534,  540,  540,  546,  546,
      543,  543,  531,  531,  536,  531,  531,  531,  531,  531,
      531,  531,  531,  550,  531,  531,  531,  531,  531,  531,
      533,  534,  546,  546,  543,  543,  536,  531,  531,  531,
      531,  531,  531,  531,  531,  550,  551,  531,  531,  531,
      531,  533,  534,  546,  546,  540,  531,  531,  531,  531,
      531,  531,  531,  551,  531,  533,  534,  534,  534,  552,

      534,  534,  534,  534,  534,  534,  547,  553,  531,  531,
      554,  554,  555,  531,  533,  533,  533,  556,  533,  533,
      533,  533,  533,  533,  534,  534,  534,  534,  534,  552,
      534,  534,  534,  534,  534,  534,  534,  534,  534,  534,
      534,  534,  534,  557,  547,  547,  553,  558,  547,  553,
      553,  531,  531,  554,  559,  531,  554,  555,  560,  533,
      533,  533,  533,  533,  556,  533,  533,  533,  533,  533,
      533,  533,  533,  533,  533,  533,  533,  533,  534,  557,
      547,  547,  558,  549,  558,  549,  561,  547,  553,  553,
      531,  531,  559,  531,  554,  554,  560,  533,  547,  547,

      540,  549,  549,  561,  561,  546,  553,  553,  531,  531,
      531,  554,  562,  531,  547,  547,  553,  553,  531,  531,
      562,  563,  531,  531,  563,  531,  531,  531,  562,  531,
        0,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531
    } ;

static yyconst flex_int16_t yy_nxt[2261] =
    {   0,
      531,   11,   12,  531,   11,  531,   13,   10,   14,   12,
       10,   14,   10,   15,   10,   16,   17,   16,   16,   16,
       16,   10,   10,   18,   18,   18,   18,   18,   18,   18,
       18,   19,   18,   18,   20,   10,   10,   10,   21,   10,
       22,   23,   10,   10,   10,   24,   10,   10,   10,   25,
       10,   10,   10,   10,   26,   10,   10,   27,   10,   10,
       28,   12,   72,   28,   54,   13,  530,   54,   74,   55,
       43,   74,   51,   43,   87,   51,  528,   90,   87,   91,
       88,   87,   75,  527,   88,   87,   93,   29,   98,   30,
       72,   31,   99,  389,   94,  110,  111,  390,  110,   32,

       89,  100,   33,   44,   73,   52,   34,   35,   36,   98,
       40,   36,   48,   99,  320,  321,   45,   42,   53,   50,
      120,  148,  100,  120,  148,   55,  116,   98,   95,  129,
      125,   99,  129,  145,   95,   29,  137,   30,  132,   31,
      100,  132,   90,   55,   91,  127,  141,   32,   74,  141,
       33,   74,  147,  121,   37,   35,   38,   12,   72,   38,
      122,   13,  130,  526,   98,   93,  123,  124,   99,  122,
       95,  133,  125,   94,   87,  131,  124,  100,  134,  142,
       88,   87,  139,   72,  135,  136,  134,   74,  153,   39,
       74,  153,  143,  136,   54,  172,   40,   54,  173,   55,

      302,   75,   41,   42,   46,   12,   87,   46,  174,   13,
       98,  306,   88,   87,   99,  531,  524,  151,  531,  147,
      151,  149,  186,  100,  149,  186,  152,  152,   89,  209,
      150,  150,  150,  150,  520,  175,  155,   47,  176,  155,
      192,  306,  177,  192,   48,  156,  156,  156,  156,  178,
       49,   50,   57,  189,   72,   57,  189,   58,  384,   59,
       60,   59,   59,   59,   59,  519,  514,   61,   61,   61,
       61,   61,   61,   61,   61,   62,   61,   61,   63,   95,
      339,  137,   64,  167,   65,   66,  168,   72,  511,   67,
      169,  110,  111,   68,  110,  336,  170,  171,   69,  510,

      306,   70,   76,  190,   77,  157,   78,  509,  157,   79,
      159,   80,   81,  159,  158,  158,  158,  158,  306,  160,
      160,  160,  160,  261,  110,  111,   82,  110,  494,  492,
      491,   83,   84,   85,  102,  161,  363,  102,  161,   55,
      163,   72,   72,  163,  162,  162,  162,  162,  453,  164,
      164,  164,  164,  153,  364,  531,  153,  165,  531,  531,
      165,  103,  452,  104,  414,  105,  166,  166,  166,  166,
      390,  306,  193,  106,   98,  193,  107,  531,   99,  306,
      108,  109,  118,  167,  410,  118,  168,  100,  409,   98,
      169,  116,  167,   99,  306,  167,  170,  171,  120,  531,

      306,  120,  100,   55,  393,  174,  178,  127,  388,  103,
      340,  104,  220,  105,  132,  221,  222,  132,  385,   55,
      167,  106,   98,  168,  107,  223,   99,  169,  119,  109,
      179,  121,  387,  170,  171,  100,  375,  369,  122,  148,
      139,  368,  148,  175,  123,  124,  175,  133,  211,  211,
      211,  211,  361,  149,  134,  230,  149,  178,  230,  231,
      135,  136,  150,  150,  150,  150,  150,  150,  150,  150,
      151,  236,  155,  151,  236,  155,  360,  359,  353,  152,
      152,  156,  156,  156,  156,  156,  156,  156,  156,  157,
      351,  350,  157,  158,  158,  158,  158,  349,  158,  158,

      158,  158,  159,  347,  346,  159,  160,  160,  160,  160,
      344,  160,  160,  160,  160,  161,  343,  335,  161,  162,
      162,  162,  162,  334,  162,  162,  162,  162,  163,  333,
      332,  163,  164,  164,  164,  164,  327,  164,  164,  164,
      164,  165,  326,  325,  165,  166,  166,  166,  166,  324,
      166,  166,  166,  166,  212,  215,  224,  213,  216,  224,
      318,  316,  177,  214,  214,  214,  214,  174,  172,  178,
      172,  172,  175,  173,  189,  176,  315,  189,  313,  177,
      312,  174,  227,  174,  189,  227,  178,  189,  242,  306,
      301,  228,  228,  228,  228,  243,  300,  299,  243,  217,

      225,  218,  226,  167,  244,  298,  168,  245,  247,  186,
      169,  247,  186,  297,  292,  289,  170,  171,  239,  239,
      239,  239,  248,  288,  531,  283,  192,  531,  531,  192,
      211,  211,  211,  211,  232,  246,  246,  246,  246,  212,
      224,  282,  212,  224,  212,  277,  276,  213,  228,  228,
      228,  228,  174,  214,  214,  214,  214,  174,  167,  215,
      230,  263,  215,  230,  231,  274,  273,  214,  214,  214,
      214,  174,  171,  178,  215,  322,  175,  216,  322,  176,
      262,  177,  175,  177,  225,  176,  226,  260,  178,  177,
      178,  172,  259,  258,  173,   87,  178,  220,  257,  243,

      220,  231,  243,  225,  223,  226,  278,  256,  220,  278,
      223,  221,  222,  224,  255,  254,  224,  531,  217,  264,
      218,  223,  253,  252,  267,  265,  268,  269,   87,  268,
      227,  354,  251,  227,  354,  175,  250,  270,  175,  228,
      228,  228,  228,  249,  228,  228,  228,  228,  167,  178,
      236,  168,  240,  236,  281,  169,  279,  271,  238,  272,
      237,  170,  171,  239,  239,  239,  239,  284,  235,  234,
      284,  531,  246,  246,  246,  246,  285,  285,  285,  285,
      243,  233,  247,  243,  275,  247,  208,  207,  206,  287,
      287,  287,  287,  205,  290,  293,  248,  290,  293,  295,

      204,  140,  295,  291,  291,  291,  291,  167,  175,  294,
      263,  176,  139,  296,  307,  177,  175,  307,  306,  176,
      174,  171,  178,  177,  267,  138,  268,  269,  305,  268,
      178,  267,  137,  203,  267,  306,  267,  270,  268,  269,
      305,  268,  531,  202,  270,  531,  531,  531,  303,  270,
      531,  531,  167,  201,  371,  168,  304,  371,  308,  169,
      309,  200,  128,  127,  278,  170,  171,  278,  531,  126,
      314,  531,  531,  317,  317,  317,  317,  284,  125,  199,
      284,  287,  287,  287,  287,  310,  323,  323,  323,  323,
      311,  284,  198,  197,  284,  531,  290,  196,  195,  290,

      285,  285,  285,  285,  194,  291,  291,  291,  291,  291,
      291,  291,  291,  293,  295,  382,  293,  295,  382,  330,
      328,  307,  330,  328,  307,  306,  117,  294,  296,  329,
      329,  329,  329,  331,  175,  175,  382,  176,  176,  382,
      172,  177,  177,  173,  396,  116,  115,  531,  178,  178,
      531,  531,  531,  174,  114,  531,  531,  167,  362,   72,
      168,  362,  113,  348,  169,  308,  348,  309,  112,  191,
      170,  171,  317,  317,  317,  317,  188,  354,  338,  322,
      354,  377,  322,  413,  187,  337,  413,  341,  352,  352,
      352,  352,  342,  185,  345,  323,  323,  323,  323,  284,

      355,  184,  284,  355,  329,  329,  329,  329,  323,  323,
      323,  323,  328,  330,  356,  328,  330,  357,  183,  182,
      357,  329,  329,  329,  329,  175,  175,  331,  176,  176,
      181,  358,  177,  177,  531,  180,   72,  531,  531,  178,
      178,  531,  101,  167,  531,  531,  168,   97,  348,  372,
      169,  348,  372,   96,   95,  355,  170,  171,  355,  373,
      374,  352,  352,  352,  352,  378,   92,  357,  378,  356,
      357,  144,  140,  139,  379,  379,  379,  379,  138,  362,
       72,  358,  362,  380,  366,  365,  380,  383,  367,  381,
      460,  381,  531,  460,  370,  531,  531,  531,  137,  167,

      531,  531,  168,  128,  127,  371,  169,  531,  371,  126,
      531,  531,  386,  171,  391,  391,  391,  391,  372,  125,
      117,  372,  378,  425,   72,  378,  425,  392,  392,  392,
      392,  379,  379,  379,  379,  379,  379,  379,  379,  380,
      413,  116,  380,  413,  459,  381,  115,  381,  395,  395,
      395,  395,   72,  114,  463,  407,  411,  463,  408,  411,
      455,  456,  177,  464,  464,  113,  397,  112,  398,  178,
      399,  411,  101,  400,  411,  401,  402,   97,   96,   95,
      391,  391,  391,  391,  395,  395,  395,  395,  412,   92,
      403,  412,  455,  456,  531,  404,  405,  406,  531,  217,

      412,  218,  457,  412,  230,  531,  531,  230,  231,  392,
      392,  392,  392,  415,  531,  416,  531,  417,  426,   72,
      418,  426,  419,  420,  531,  531,  531,  427,  427,  427,
      427,  428,   72,  512,  428,  531,  512,  421,  531,  531,
      429,  429,  422,  423,  424,   71,  430,   72,   71,  430,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,  428,   72,  531,  428,  529,  432,   72,  529,  432,
      429,  429,   71,   71,   71,  433,  433,  433,  433,  434,
       72,  531,  434,  436,   72,  531,  436,  531,  435,  435,
      435,  435,  437,  437,  437,  437,  438,   72,  531,  438,

      440,   72,  531,  440,  531,  439,  439,  439,  439,  441,
      441,  441,  441,  442,   72,  407,  442,  531,  407,  281,
      531,  531,  443,  443,  443,  443,  531,  407,  531,  444,
      408,  448,  531,  461,  449,  531,  461,  467,  531,  531,
      467,  444,  462,  462,  462,  462,  468,  468,  468,  468,
      531,  531,  531,  469,  531,  531,  469,  471,  531,  445,
      471,  446,  470,  470,  470,  470,  472,  472,  472,  472,
      531,  450,  531,  451,   56,  465,  531,   56,  465,   56,
       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
      462,  462,  462,  462,  481,  473,  484,  531,  473,  484,

      349,   56,   56,   56,  474,  474,  474,  474,  475,  531,
      487,  475,  477,  531,  531,  477,  531,  476,  476,  476,
      476,  478,  478,  478,  478,  425,   72,  531,  425,  426,
       72,  531,  426,  531,  479,  479,  479,  479,  427,  427,
      427,  427,   72,  531,  531,  531,  531,  531,  531,  531,
      427,  427,  427,  427,   71,  430,   72,   71,  430,   71,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
      531,  531,  531,  531,  531,  432,   72,  531,  432,  531,
       72,   71,   71,   71,  433,  433,  433,  433,  433,  433,
      433,  433,  434,   72,  531,  434,  531,   72,  531,  531,

      531,  435,  435,  435,  435,  435,  435,  435,  435,  436,
       72,  531,  436,  482,   72,  531,  531,  531,  437,  437,
      437,  437,  437,  437,  437,  437,  438,   72,  531,  438,
      531,   72,  531,  531,  531,  439,  439,  439,  439,  439,
      439,  439,  439,  440,   72,  531,  440,  515,   72,  531,
      531,  531,  441,  441,  441,  441,  441,  441,  441,  441,
      442,   72,  531,  442,  531,   72,  531,  531,  531,  443,
      443,  443,  443,  443,  443,  443,  443,  175,  531,  531,
      176,   88,  531,  484,  449,  319,  485,   88,  319,  227,
      486,  444,  227,  531,  531,  531,  531,  487,  488,  488,

      488,  488,  175,  531,  175,  176,   88,  176,   88,  449,
      531,  449,  531,  531,  531,  531,  444,  460,  444,  531,
      460,  461,  531,  531,  461,  531,  498,  498,  498,  498,
      462,  462,  462,  462,  468,  468,  468,  468,  531,  463,
      495,  531,  463,  531,  496,  489,  531,  490,  464,  464,
       56,  465,  531,   56,  465,   56,   56,   56,   56,   56,
       56,   56,   56,   56,   56,   56,  470,  470,  470,  470,
      531,  467,  531,  531,  467,  531,  531,   56,   56,   56,
      468,  468,  468,  468,  469,  531,  531,  469,  471,  531,
      531,  471,  531,  470,  470,  470,  470,  472,  472,  472,

      472,  472,  472,  472,  472,  473,  531,  531,  473,  474,
      474,  474,  474,  531,  474,  474,  474,  474,  475,  531,
      531,  475,  476,  476,  476,  476,  499,  476,  476,  476,
      476,  477,  531,  531,  477,  478,  478,  478,  478,   72,
      478,  478,  478,  478,  531,  531,  531,  479,  479,  479,
      479,  531,  531,  531,  531,  531,  484,  531,  319,  485,
      501,  319,  484,  486,  319,  485,  501,  319,  502,  486,
      487,  502,  349,  531,  531,  531,  487,  503,  503,  503,
      503,  505,  531,  319,  505,  506,  319,  498,  498,  498,
      498,  500,  175,  531,  531,  175,  531,  531,  531,  531,

      531,  488,  488,  488,  488,  175,  444,  175,  176,   88,
      176,   88,  449,  513,  449,  531,  513,  531,  531,  444,
      531,  444,  175,  531,  531,  176,  531,  531,  502,  177,
      531,  502,  349,  496,  531,  531,  178,  503,  503,  503,
      503,  531,  531,  531,  531,  507,  319,  508,  319,  319,
      349,  319,  505,  531,  319,  505,  506,  319,  175,  531,
      531,  176,   88,  516,  484,  449,  512,  484,  349,  512,
      455,  531,  444,  503,  503,  503,  503,  175,  487,  531,
      176,   88,  513,  531,  449,  513,  522,  523,  531,  175,
      531,  444,  176,   88,  175,  531,  449,  176,   88,  531,

      531,  449,  531,  444,  531,  531,  531,  531,  444,  517,
      529,  531,  531,  529,  522,  531,  531,  531,  531,  531,
      518,   10,   10,   10,   10,   10,   10,   10,   10,   10,
       56,   56,  531,   56,   56,   56,   56,   56,   56,   71,
       71,   71,   71,   71,   71,   71,   71,   71,   59,  531,
      531,   59,  531,  531,   59,   86,  531,  531,  531,   86,
       86,  531,   86,   86,  146,  146,  531,  531,  146,  146,
      531,  146,  146,  154,  531,  531,  154,  531,  531,  531,
      154,   87,   87,  531,  531,   87,   87,  531,   87,   87,
       88,   88,  531,  531,   88,   88,  531,   88,   88,  210,

      210,  531,  210,  210,  531,  210,  210,  210,  219,  219,
      531,  531,  219,  219,  531,  219,  219,  229,  229,  531,
      531,  229,  229,  531,  229,  229,  241,  241,  531,  531,
      241,  241,  531,  241,  241,  266,  266,  531,  266,  266,
      266,  266,  266,  266,  268,  268,  531,  268,  268,  531,
      268,  268,  268,  280,  280,  531,  531,  280,  280,  531,
      280,  280,  286,  286,  531,  286,  286,  531,  286,  286,
      286,  319,  319,  531,  319,  319,  531,  319,  319,  319,
      376,  376,  531,  531,  376,  376,  531,  376,  376,  394,
      394,  531,  394,  394,  531,  394,  394,  394,  431,  431,

      431,  431,  431,  431,  431,  431,  431,  447,  447,  531,
      531,  447,  447,  531,  447,  447,  454,  454,  531,  531,
      454,  454,  454,  454,  454,  458,  458,  531,  531,  458,
      458,  531,  458,  458,  466,  466,  531,  466,  466,  466,
      466,  466,  466,  480,  480,  531,  531,  480,  480,  531,
      480,  480,  483,  483,  531,  483,  483,  483,  483,  483,
      483,  493,  493,  531,  493,  493,  531,  493,  493,  493,
      497,  497,  531,  497,  497,  531,  497,  497,  497,  504,
      504,  531,  504,  504,  504,  504,  504,  504,  521,  521,
      531,  531,  521,  521,  521,  521,  521,  525,  525,  531,

      525,  525,  531,  525,  525,  525,    9,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531
    } ;

static yyconst flex_int16_t yy_chk[2261] =
    {   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,    2,    2,
        3,    3,   15,    3,   11,    3,  527,   11,   16,   11,
        6,   16,    8,    6,   18,    8,  525,   20,   19,   20,
       18,   18,   16,  524,   19,   19,   22,    3,   26,    3,
       73,    3,   26,  370,   22,   29,   29,  370,   29,    3,

       19,   26,    3,    6,   15,    8,    3,    3,    4,   37,
        6,    4,    8,   37,  282,  282,    6,    6,    8,    8,
       38,   76,   37,   38,   76,   38,   37,   45,   44,   43,
       44,   45,   43,   73,   52,    4,   52,    4,   46,    4,
       45,   46,   63,   46,   63,   45,   51,    4,   74,   51,
        4,   74,   74,   38,    4,    4,    5,    5,  261,    5,
       38,    5,   43,  523,   53,   65,   38,   38,   53,   43,
      130,   46,  130,   65,   61,   43,   43,   53,   46,   51,
       61,   61,   53,  145,   46,   46,   51,   59,   79,    5,
       59,   79,   51,   51,   54,   87,    5,   54,   87,   54,

      261,   59,    5,    5,    7,    7,   62,    7,   87,    7,
       69,  363,   62,   62,   69,   75,  520,   78,   75,   75,
       78,   77,   96,   69,   77,   96,   78,   78,   62,  145,
       77,   77,   77,   77,  510,   88,   80,    7,   88,   80,
      101,  308,   88,  101,    7,   80,   80,   80,   80,   88,
        7,    7,   14,   99,  302,   14,   99,   14,  363,   14,
       14,   14,   14,   14,   14,  509,  497,   14,   14,   14,
       14,   14,   14,   14,   14,   14,   14,   14,   14,  142,
      308,  142,   14,   86,   14,   14,   86,  209,  493,   14,
       86,  103,  103,   14,  103,  302,   86,   86,   14,  492,

      339,   14,   17,   99,   17,   81,   17,  491,   81,   17,
       82,   17,   17,   82,   81,   81,   81,   81,  340,   82,
       82,   82,   82,  209,  110,  110,   17,  110,  456,  453,
      452,   17,   17,   17,   28,   83,  339,   28,   83,   28,
       84,  431,  429,   84,   83,   83,   83,   83,  410,   84,
       84,   84,   84,  153,  340,  146,  153,   85,  146,  146,
       85,   28,  409,   28,  394,   28,   85,   85,   85,   85,
      389,  309,  111,   28,  119,  111,   28,  111,  119,  364,
       28,   28,   36,   89,  388,   36,   89,  119,  387,  131,
       89,  119,  167,  131,  385,  167,   89,   89,  120,  111,

      384,  120,  131,  120,  375,  167,  167,  131,  369,   36,
      309,   36,  171,   36,  132,  171,  171,  132,  364,  132,
      168,   36,  143,  168,   36,  171,  143,  168,   36,   36,
       89,  120,  368,  168,  168,  143,  353,  347,  120,  148,
      143,  346,  148,  175,  120,  120,  175,  132,  148,  148,
      148,  148,  335,  149,  132,  178,  149,  175,  178,  178,
      132,  132,  149,  149,  149,  149,  150,  150,  150,  150,
      151,  183,  155,  151,  183,  155,  334,  333,  325,  151,
      151,  155,  155,  155,  155,  156,  156,  156,  156,  157,
      321,  320,  157,  158,  158,  158,  158,  319,  157,  157,

      157,  157,  159,  316,  315,  159,  160,  160,  160,  160,
      313,  159,  159,  159,  159,  161,  312,  301,  161,  162,
      162,  162,  162,  300,  161,  161,  161,  161,  163,  299,
      298,  163,  164,  164,  164,  164,  292,  163,  163,  163,
      163,  165,  289,  288,  165,  166,  166,  166,  166,  286,
      165,  165,  165,  165,  169,  170,  174,  169,  170,  174,
      279,  277,  170,  169,  169,  169,  169,  169,  172,  170,
      173,  172,  176,  173,  188,  176,  276,  188,  274,  176,
      273,  172,  177,  173,  189,  177,  176,  189,  189,  268,
      260,  177,  177,  177,  177,  190,  258,  255,  190,  170,

      174,  170,  174,  179,  191,  253,  179,  191,  194,  186,
      179,  194,  186,  252,  249,  245,  179,  179,  186,  186,
      186,  186,  194,  244,  229,  240,  192,  229,  229,  192,
      211,  211,  211,  211,  179,  192,  192,  192,  192,  212,
      224,  237,  212,  224,  213,  234,  233,  213,  212,  212,
      212,  212,  212,  213,  213,  213,  213,  213,  214,  215,
      230,  214,  215,  230,  230,  226,  225,  214,  214,  214,
      214,  214,  214,  215,  216,  283,  217,  216,  283,  217,
      210,  216,  218,  217,  224,  218,  224,  208,  216,  218,
      217,  219,  207,  206,  219,  219,  218,  220,  205,  318,

      220,  220,  318,  215,  219,  215,  235,  203,  221,  235,
      220,  221,  221,  223,  202,  201,  223,  223,  216,  217,
      216,  221,  199,  198,  222,  218,  222,  222,  222,  222,
      227,  326,  197,  227,  326,  228,  196,  222,  228,  227,
      227,  227,  227,  195,  228,  228,  228,  228,  232,  228,
      236,  232,  187,  236,  236,  232,  235,  223,  185,  223,
      184,  232,  232,  239,  239,  239,  239,  241,  182,  181,
      241,  241,  246,  246,  246,  246,  241,  241,  241,  241,
      243,  180,  247,  243,  232,  247,  144,  140,  139,  243,
      243,  243,  243,  138,  248,  250,  247,  248,  250,  251,

      137,  136,  251,  248,  248,  248,  248,  263,  264,  250,
      263,  264,  135,  251,  270,  264,  265,  270,  270,  265,
      263,  263,  264,  265,  266,  134,  266,  266,  266,  266,
      265,  267,  133,  128,  267,  267,  269,  266,  269,  269,
      269,  269,  271,  127,  267,  271,  271,  272,  264,  269,
      272,  272,  275,  126,  350,  275,  265,  350,  270,  275,
      270,  125,  124,  123,  278,  275,  275,  278,  280,  122,
      275,  280,  280,  278,  278,  278,  278,  284,  121,  117,
      284,  287,  287,  287,  287,  271,  284,  284,  284,  284,
      272,  285,  116,  115,  285,  285,  290,  114,  113,  290,

      285,  285,  285,  285,  112,  290,  290,  290,  290,  291,
      291,  291,  291,  293,  295,  361,  293,  295,  361,  297,
      296,  307,  297,  296,  307,  307,  109,  293,  295,  296,
      296,  296,  296,  297,  303,  304,  382,  303,  304,  382,
      305,  303,  304,  305,  382,  108,  107,  310,  303,  304,
      310,  310,  311,  305,  106,  311,  311,  314,  336,  336,
      314,  336,  105,  317,  314,  307,  317,  307,  104,  100,
      314,  314,  317,  317,  317,  317,   98,  354,  304,  322,
      354,  354,  322,  393,   97,  303,  393,  310,  322,  322,
      322,  322,  311,   95,  314,  323,  323,  323,  323,  324,

      327,   94,  324,  327,  329,  329,  329,  329,  324,  324,
      324,  324,  328,  330,  327,  328,  330,  332,   93,   92,
      332,  328,  328,  328,  328,  337,  338,  330,  337,  338,
       91,  332,  337,  338,  341,   90,   71,  341,  341,  337,
      338,  342,   70,  345,  342,  342,  345,   68,  348,  351,
      345,  348,  351,   67,   66,  355,  345,  345,  355,  351,
      351,  352,  352,  352,  352,  356,   64,  357,  356,  355,
      357,   58,   50,   49,  356,  356,  356,  356,   48,  362,
      362,  357,  362,  358,  342,  341,  358,  362,  345,  358,
      415,  358,  365,  415,  348,  365,  365,  366,   47,  367,

      366,  366,  367,   42,   41,  371,  367,  376,  371,   40,
      376,  376,  367,  367,  371,  371,  371,  371,  372,   39,
       35,  372,  378,  397,  397,  378,  397,  372,  372,  372,
      372,  378,  378,  378,  378,  379,  379,  379,  379,  380,
      413,   34,  380,  413,  413,  380,   33,  380,  381,  381,
      381,  381,  383,   32,  417,  386,  411,  417,  386,  411,
      411,  411,  386,  417,  417,   31,  383,   30,  383,  386,
      383,  391,   27,  383,  391,  383,  383,   25,   24,   23,
      391,  391,  391,  391,  395,  395,  395,  395,  412,   21,
      383,  412,  412,  412,    9,  383,  383,  383,    0,  386,

      392,  386,  411,  392,  444,    0,    0,  444,  444,  392,
      392,  392,  392,  396,    0,  396,    0,  396,  398,  398,
      396,  398,  396,  396,    0,    0,    0,  398,  398,  398,
      398,  399,  399,  494,  399,  458,  494,  396,  458,  458,
      399,  399,  396,  396,  396,  400,  400,  400,  400,  400,
      400,  400,  400,  400,  400,  400,  400,  400,  400,  400,
      400,  428,  428,    0,  428,  526,  401,  401,  526,  401,
      428,  428,  400,  400,  400,  401,  401,  401,  401,  402,
      402,    0,  402,  403,  403,    0,  403,    0,  402,  402,
      402,  402,  403,  403,  403,  403,  404,  404,    0,  404,

      405,  405,    0,  405,    0,  404,  404,  404,  404,  405,
      405,  405,  405,  406,  406,  407,  406,  480,  407,  407,
      480,  480,  406,  406,  406,  406,    0,  408,    0,  407,
      408,  408,    0,  416,  408,  515,  416,  419,  515,  515,
      419,  408,  416,  416,  416,  416,  419,  419,  419,  419,
        0,  445,    0,  420,  445,  445,  420,  421,    0,  407,
      421,  407,  420,  420,  420,  420,  421,  421,  421,  421,
        0,  408,    0,  408,  418,  418,    0,  418,  418,  418,
      418,  418,  418,  418,  418,  418,  418,  418,  418,  418,
      462,  462,  462,  462,  445,  422,  484,    0,  422,  484,

      484,  418,  418,  418,  422,  422,  422,  422,  423,    0,
      484,  423,  424,    0,    0,  424,    0,  423,  423,  423,
      423,  424,  424,  424,  424,  425,  425,    0,  425,  426,
      426,    0,  426,    0,  425,  425,  425,  425,  426,  426,
      426,  426,  427,  454,    0,    0,  454,  454,  454,    0,
      427,  427,  427,  427,  430,  430,  430,  430,  430,  430,
      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
      446,    0,    0,  446,  446,  432,  432,    0,  432,    0,
      433,  430,  430,  430,  432,  432,  432,  432,  433,  433,
      433,  433,  434,  434,    0,  434,  499,  435,    0,  499,

      499,  434,  434,  434,  434,  435,  435,  435,  435,  436,
      436,    0,  436,  446,  437,    0,    0,    0,  436,  436,
      436,  436,  437,  437,  437,  437,  438,  438,    0,  438,
      516,  439,    0,  516,  516,  438,  438,  438,  438,  439,
      439,  439,  439,  440,  440,    0,  440,  499,  441,    0,
        0,    0,  440,  440,  440,  440,  441,  441,  441,  441,
      442,  442,    0,  442,    0,  443,    0,    0,    0,  442,
      442,  442,  442,  443,  443,  443,  443,  447,    0,    0,
      447,  447,    0,  448,  447,  448,  448,  448,  448,  449,
      448,  447,  449,  449,    0,    0,    0,  448,  449,  449,

      449,  449,  450,    0,  451,  450,  450,  451,  451,  450,
      457,  451,    0,  457,  457,  457,  450,  460,  451,    0,
      460,  461,    0,    0,  461,    0,  460,  460,  460,  460,
      461,  461,  461,  461,  468,  468,  468,  468,    0,  463,
      457,    0,  463,    0,  457,  450,    0,  451,  463,  463,
      465,  465,    0,  465,  465,  465,  465,  465,  465,  465,
      465,  465,  465,  465,  465,  465,  470,  470,  470,  470,
        0,  467,    0,    0,  467,    0,    0,  465,  465,  465,
      467,  467,  467,  467,  469,    0,  481,  469,  471,  481,
      481,  471,    0,  469,  469,  469,  469,  471,  471,  471,

      471,  472,  472,  472,  472,  473,    0,    0,  473,  474,
      474,  474,  474,    0,  473,  473,  473,  473,  475,    0,
        0,  475,  476,  476,  476,  476,  481,  475,  475,  475,
      475,  477,    0,    0,  477,  478,  478,  478,  478,  479,
      477,  477,  477,  477,    0,    0,    0,  479,  479,  479,
      479,  482,    0,    0,  482,  482,  483,    0,  483,  483,
      483,  483,  485,  483,  485,  485,  485,  485,  486,  485,
      483,  486,  486,    0,    0,    0,  485,  486,  486,  486,
      486,  487,    0,  487,  487,  487,  487,  498,  498,  498,
      498,  482,  488,    0,  495,  488,  488,  495,  495,  495,

        0,  488,  488,  488,  488,  489,  488,  490,  489,  489,
      490,  490,  489,  496,  490,    0,  496,  496,  496,  489,
      500,  490,  501,  500,  500,  501,    0,    0,  502,  501,
        0,  502,  502,  495,    0,    0,  501,  502,  502,  502,
      502,    0,    0,    0,    0,  489,  504,  490,  504,  504,
      504,  504,  505,    0,  505,  505,  505,  505,  507,    0,
        0,  507,  507,  500,  503,  507,  512,  503,  503,  512,
      512,  512,  507,  503,  503,  503,  503,  508,  503,    0,
      508,  508,  513,    0,  508,  513,  513,  513,    0,  517,
        0,  508,  517,  517,  518,    0,  517,  518,  518,    0,

        0,  518,  521,  517,    0,  521,  521,  521,  518,  507,
      529,    0,    0,  529,  529,  529,    0,    0,    0,    0,
      508,  532,  532,  532,  532,  532,  532,  532,  532,  532,
      533,  533,    0,  533,  533,  533,  533,  533,  533,  534,
      534,  534,  534,  534,  534,  534,  534,  534,  535,    0,
        0,  535,    0,    0,  535,  536,    0,    0,    0,  536,
      536,    0,  536,  536,  537,  537,    0,    0,  537,  537,
        0,  537,  537,  538,    0,    0,  538,    0,    0,    0,
      538,  539,  539,    0,    0,  539,  539,    0,  539,  539,
      540,  540,    0,    0,  540,  540,    0,  540,  540,  541,

      541,    0,  541,  541,    0,  541,  541,  541,  542,  542,
        0,    0,  542,  542,    0,  542,  542,  543,  543,    0,
        0,  543,  543,    0,  543,  543,  544,  544,    0,    0,
      544,  544,    0,  544,  544,  545,  545,    0,  545,  545,
      545,  545,  545,  545,  546,  546,    0,  546,  546,    0,
      546,  546,  546,  547,  547,    0,    0,  547,  547,    0,
      547,  547,  548,  548,    0,  548,  548,    0,  548,  548,
      548,  549,  549,    0,  549,  549,    0,  549,  549,  549,
      550,  550,    0,    0,  550,  550,    0,  550,  550,  551,
      551,    0,  551,  551,    0,  551,  551,  551,  552,  552,

      552,  552,  552,  552,  552,  552,  552,  553,  553,    0,
        0,  553,  553,    0,  553,  553,  554,  554,    0,    0,
      554,  554,  554,  554,  554,  555,  555,    0,    0,  555,
      555,    0,  555,  555,  556,  556,    0,  556,  556,  556,
      556,  556,  556,  557,  557,    0,    0,  557,  557,    0,
      557,  557,  558,  558,    0,  558,  558,  558,  558,  558,
      558,  559,  559,    0,  559,  559,    0,  559,  559,  559,
      560,  560,    0,  560,  560,    0,  560,  560,  560,  561,
      561,    0,  561,  561,  561,  561,  561,  561,  562,  562,
        0,    0,  562,  562,  562,  562,  562,  563,  563,    0,

      563,  563,    0,  563,  563,  563,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531,
      531,  531,  531,  531,  531,  531,  531,  531,  531,  531
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int yy_flex_debug;
int yy_flex_debug = 0;

/* 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"
#line 2 "./cfg.l"
/*
 * Cfg file reader, Greg Lee, 8/93.
 * Adapted from Adagio for KMidi 12/99.
 *	$Id: cfg.l,v 1.8 2000/08/08 17:32:37 faure Exp $
 */
#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 "readmidi.h"
#include "output.h"
#include "controls.h"
#include "tables.h"

#include "sbk.h"
#include "sflayer.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 );

extern int set_play_mode(char *cp);
static int prescanning;
static char doing_drums = 0;
static char doing_sf = 0;
static int patchno = -1;
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_GUS;

#define MAX_SF_COUNT 4096
static struct cfg_type a_sf[MAX_SF_COUNT];
static int sf_count = 0;


#define MAX_INCLUDE_DEPTH 40
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
static int include_stack_ptr = 0;
static char *this_fname[MAX_INCLUDE_DEPTH] = { NULL };
static int this_line[MAX_INCLUDE_DEPTH] = { 0 };

static void new_toneset(int n, int highest);
static void new_patch(const char *vname, int num);
static int sf2tab(char *sffname);
static void interpret_sf(void);


#line 1192 "cfg.c"

#define INITIAL 0
#define P 1
#define K 2
#define S 3

/* Special case for "unistd.h", since it is non-ANSI. We include it way
 * down here because we want the user's section 1 to have been scanned first.
 * The user has a chance to override it with an option.
 */
#include <unistd.h>

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

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

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

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

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * );
#endif

#ifndef YY_NO_INPUT

#ifdef __cplusplus
static int yyinput (void );
#else
static int input (void );
#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_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		size_t 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 \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\

#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

/* end tables serialization structures and prototypes */

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1

extern int yylex (void);

#define YY_DECL int yylex (void)
#endif /* !YY_DECL */

/* 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_LVALUE->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

/** The main scanner function which does all the work.
 */
YY_DECL
{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;
    
#line 82 "./cfg.l"


#line 1348 "cfg.c"

	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 ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				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 >= 532 )
					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] != 2207 );

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_RULE_SETUP
#line 84 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 2;
	cfg_condition = atoi(yytext+i);
}
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 90 "./cfg.l"
{
	cfg_condition = 0;
}
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 93 "./cfg.l"
{
	int sf_oldbank, sf_newbank = banknum;
	int i = 0, j;
	unsigned namelen;
	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++) ;
	namelen = (unsigned)(j - i + 1);
	sfname = strncpy( (char *)malloc(namelen), yytext+i, (unsigned)(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);
	}
	init_soundfont(sfname, sf_oldbank, sf_newbank, rcf_count);
}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 118 "./cfg.l"
{
	int i = 0, j;
	unsigned namelen;
	while (isspace(yytext[i])) i++;
	i += 9;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == '"') {
		i++;
		for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
	}
	else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
	namelen = (unsigned)(j - i + 1);

	if (prescanning && cfg_condition >= 0 && cfg_condition < 30 &&
		rcf_count==1 && !cfg_names[cfg_condition]) {
	    cfg_names[cfg_condition] = strncpy( (char *)malloc(namelen), yytext+i, (unsigned)(j-i) );
	    cfg_names[cfg_condition][j-i] = '\0';
	}

        if (!prescanning && (cfg_condition < 0 || cfg_condition == cfg_select)) {
		sfname = strncpy( (char *)malloc(namelen), yytext+i, (unsigned)(j-i) );
		sfname[j-i] = '\0';
		sf_count = 0;
		if (sf2tab(sfname) && sf_count) interpret_sf();
	}
	cfg_condition = -1;
}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 145 "./cfg.l"
{
	int i = 0, j;
	unsigned namelen;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == 'd') i += 3;
	else i += 9;
	while (isspace(yytext[i])) i++;

	if (yytext[i] == '"') {
		i++;
		for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
	}
	else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
	namelen = (unsigned)(j - i + 1);

	if (!prescanning) {
		s_dirname = strncpy( (char *)malloc(namelen), yytext+i, namelen-1 );
		s_dirname[j-i] = '\0';
		add_to_pathlist(s_dirname, rcf_count);
		free(s_dirname);
	}
}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 167 "./cfg.l"
{
	char *fname;
	int i = 0, j;
	unsigned namelen;
	FILE *save_yyin;

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

	if (yytext[i] == '"') {
		i++;
		for (j = i; j < yyleng && yytext[j] != '"'; j++) ;
	}
	else for (j = i; j < yyleng && !isspace(yytext[j]); j++) ;
	namelen = (unsigned)(j - i + 1);

	 if (prescanning && cfg_condition >= 0 && cfg_condition < 30 &&
		rcf_count==1 && !cfg_names[cfg_condition])
	  {
	    cfg_names[cfg_condition] = (char *)safe_malloc(namelen);
	    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(namelen), yytext+i );
	if (this_fname[include_stack_ptr]) free(this_fname[include_stack_ptr]);
	this_fname[include_stack_ptr] = strdup(fname);

	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):
#line 228 "./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 7:
YY_RULE_SETUP
#line 241 "./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, MAXPROG);
	font_type=FONT_SF;
    if (bank && !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++;
	if (yytext[i] == '#') i += 2;
	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 8:
YY_RULE_SETUP
#line 269 "./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, MAXPROG);
	font_type=FONT_SF;
}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 279 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	int is_sfx = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	if (yytext[i-1] == 'x') is_sfx = 1;
	current_drumset = atoi(yytext+i);
	if (is_sfx) current_drumset += SFXBANK;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset, is_sfx? SFXBANK+MAXPROG : MAXPROG);
	font_type=FONT_GUS;
    if (bank && !bank->name) {
	while (isspace(yytext[i])) i++;
	while (isdigit(yytext[i])) i++;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == '#') i += 2;
	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 10:
YY_RULE_SETUP
#line 307 "./cfg.l"
{
	char *bank_name = NULL;
	int i = 0;
	int is_sfx = 0;
	while (isspace(yytext[i])) i++;
	i += 7;
	if (yytext[i-1] == 'x') is_sfx = 1;
	current_drumset = atoi(yytext+i);
	if (is_sfx) current_drumset += SFXBANK;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_drumset, is_sfx? SFXBANK+MAXPROG : MAXPROG);
	font_type=FONT_GUS;
    if (bank && !bank->name) switch (current_drumset) {
	case SFXDRUM1:
	case SFXDRUM2:
	    bank_name = "rhythm sfx";
	    break;
	case TECHNO_KS:
	    bank_name = "techno k/s";
	    break;
	case TECHNO_HI:
	    bank_name = "techno hi";
	    break;
	case TECHNO_LO:
	    bank_name = "techno lo";
	    break;
	case SAKURA:
	    bank_name = "sakura";
	    break;
	case SMALL_LATIN:
	    bank_name = "latin";
	    break;
	default:
	    break;
    }
        if (bank_name && bank)
	    bank->name = strcpy( (char *)malloc(strlen(bank_name)+1), bank_name );
}
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 346 "./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, MAXPROG);
	font_type=FONT_SF;
}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 356 "./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, MAXPROG);
	font_type=FONT_GUS;
}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 366 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 5;
	current_toneset = atoi(yytext+i) + MU100BANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset, MU100BANK+MAXPROG);
	font_type=FONT_GUS;
}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 376 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	i += 2;
	current_toneset = atoi(yytext+i) + VLBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset, VLBANK+7);
	font_type=FONT_GUS;
}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 386 "./cfg.l"
{
	int i = 0;
	while (isspace(yytext[i])) i++;
	if (yytext[i] == 's') i += 3;
	else i += 6;
	current_toneset = atoi(yytext+i) + SFXBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset, SFXBANK+MAXVAR);
	font_type=FONT_GUS;
}
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 397 "./cfg.l"
{
	current_toneset = SFXBANK;
	doing_drums = 0;
	doing_sf = 0;
	new_toneset(current_toneset, SFXBANK+1);
	font_type=FONT_GUS;
}
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 404 "./cfg.l"
{
	current_drumset = SFXDRUM1;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_toneset, SFXDRUM1+1);
	font_type=FONT_GUS;
	if (bank) bank->name = "drumsfx1";
}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 412 "./cfg.l"
{
	current_drumset = SFXDRUM2;
	doing_drums = 1;
	doing_sf = 0;
	new_toneset(current_toneset, SFXDRUM2+1);
	font_type=FONT_GUS;
	if (bank) bank->name = "drumsfx2";
}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 421 "./cfg.l"
{
	doing_drums = 0;
}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 424 "./cfg.l"
{
	doing_drums = 1;
	current_drumset = current_toneset;
}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 429 "./cfg.l"
{
	const char *gm_name = NULL;
	char *vc_name = NULL;
	patchno = atoi(yytext);
	tone_bank = 0;
	if (patchno >= 0) {
		int 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, 0);

		while (isspace(yytext[i])) i++;
		if (!cfg_flag && yytext[i] == '=') i++;
		patchname = yytext + i;
		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 22:
YY_RULE_SETUP
#line 472 "./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++;
		patchname = yytext + i;
		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 23:
YY_RULE_SETUP
#line 514 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_VOICES) voices_ceiling = j;
	} }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 524 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_AMPLIFICATION) amplification = j;
	} }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 534 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j > 1 && j < MAX_CONTROL_RATIO) control_ratio = j;
	} }
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 544 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			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 27:
YY_RULE_SETUP
#line 555 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		max_patch_memory = j * 1000000;
	} }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 565 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 3)
	    	  switch (j) {
		    case 0: current_interpolation = INTERPOLATION_LINEAR;
			    break;
		    case 1: current_interpolation = INTERPOLATION_CSPLINE;
			    break;
		    case 2: current_interpolation = INTERPOLATION_LAGRANGE;
			    break;
		    default:
		    case 3: current_interpolation = INTERPOLATION_CSPLINE | INTERPOLATION_BUTTERWORTH;
			    break;
	    	  }
	} }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 586 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_expression_curve = j;
	} }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 596 "./cfg.l"
{ if (prescanning) {
		int i, j;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		j = atoi(yytext+i+2);
		if (j >= 0 && j <= 2) opt_volume_curve = j;
	} }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 606 "./cfg.l"
{ if (prescanning) {
		int i;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		i+=2;
		while(isspace(yytext[i])) i++;
		set_play_mode(yytext+i);
	} }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 617 "./cfg.l"
{ if (prescanning) {
		int i;
		i=0; while(isspace(yytext[i])) i++;
		if (yytext[i] == '#') {
			i += 7;
			while(isspace(yytext[i])) i++;
		}
		i+=2;
		fast_load = atoi(yytext+i);
	} }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 628 "./cfg.l"
;
	YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
#line 629 "./cfg.l"
this_line[include_stack_ptr]++;
	YY_BREAK
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
#line 631 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') if (yytext[i++]=='\n') this_line[include_stack_ptr]++;
	if (bank) bank->tone[patchno].amp = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 36:
/* rule 36 can match eol */
YY_RULE_SETUP
#line 637 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') if (yytext[i++]=='\n') this_line[include_stack_ptr]++;
	if (bank) bank->tone[patchno].note = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 37:
/* rule 37 can match eol */
YY_RULE_SETUP
#line 643 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') if (yytext[i++]=='\n') this_line[include_stack_ptr]++;
	if (bank) bank->tone[patchno].cutoff = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 38:
/* rule 38 can match eol */
YY_RULE_SETUP
#line 649 "./cfg.l"
{
	int i = 0;
	while (yytext[i] != '=') if (yytext[i++]=='\n') this_line[include_stack_ptr]++;
	if (bank) bank->tone[patchno].tuning = atoi(yytext+i+1);
	BEGIN(P);
}
	YY_BREAK
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
#line 655 "./cfg.l"
BEGIN(K);
	YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
#line 656 "./cfg.l"
BEGIN(S);
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 658 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_loop=0;
	BEGIN(P);
}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 662 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_tail=0;
	BEGIN(P);
}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 666 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_envelope=0;
	BEGIN(P);
}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 670 "./cfg.l"
{
		  if (bank) bank->tone[patchno].sustain=0;
	BEGIN(P);
}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 674 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_loop=1;
	BEGIN(P);
}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 678 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_tail=1;
	BEGIN(P);
}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 682 "./cfg.l"
{
		  if (bank) bank->tone[patchno].strip_envelope=1;
	BEGIN(P);
}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 686 "./cfg.l"
{
		  if (bank) bank->tone[patchno].sustain=1;
	BEGIN(P);
}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 690 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags &= ~SOLO_MASK;
}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 694 "./cfg.l"
{
	set_patchno(yytext);
	if (patchno < 256) gm_voice[patchno].flags |= SOLO_MASK;
}
	YY_BREAK
case 51:
/* rule 51 can match eol */
YY_RULE_SETUP
#line 699 "./cfg.l"
{
	patchno = -1;
	this_line[include_stack_ptr]++;
	BEGIN(0);
}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 704 "./cfg.l"
;
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 706 "./cfg.l"
ECHO;
	YY_BREAK
#line 2268 "cfg.c"

	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_LVALUE->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_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
			YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->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 (void)
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->yy_n_chars = (yy_n_chars) = 0;

	else
		{
			size_t num_to_read =
			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */

			/* 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. */
					yyrealloc((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_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	(yy_n_chars) += number_to_move;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;

	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->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 (void)
{
	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 >= 532 )
				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 );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	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 >= 532 )
			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 == 531);

	return yy_is_jam ? 0 : yy_current_state;
}

#ifndef YY_NO_INPUT
#ifdef __cplusplus
    static int yyinput (void)
#else
    static int input  (void)
#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_LVALUE->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 );

					/*FALLTHROUGH*/

				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_LVALUE->yy_at_bol = (c == '\n');

	return c;
}
#endif	/* ifndef YY_NO_INPUT */

/** Immediately switch to a different input stream.
 * @param input_file A readable stream.
 * 
 * @note This function does not reset the start condition to @c INITIAL .
 */
    void yyrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer(yyin,YY_BUF_SIZE );
	}

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

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypop_buffer_state();
	 *		yypush_buffer_state(new_buffer);
     */
	yyensure_buffer_stack ();
	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_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	YY_CURRENT_BUFFER_LVALUE = 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;
}

static void yy_load_buffer_state  (void)
{
    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
	(yy_hold_char) = *(yy_c_buf_p);
}

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * 
 * @return the allocated buffer state.
 */
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc(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 *) yyalloc(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;
}

/** Destroy the buffer.
 * @param b a buffer created with yy_create_buffer()
 * 
 */
    void yy_delete_buffer (YY_BUFFER_STATE  b )
{
    
	if ( ! b )
		return;

	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;

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

	yyfree((void *) b  );
}

#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
    
/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a yyrestart() or at EOF.
 */
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	yy_flush_buffer(b );

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

    /* If b is the current buffer, then yy_init_buffer was _probably_
     * called from yyrestart() or through yy_get_next_buffer.
     * In that case, we don't want to reset the lineno or column.
     */
    if (b != YY_CURRENT_BUFFER){
        b->yy_bs_lineno = 1;
        b->yy_bs_column = 0;
    }

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

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * 
 */
    void yy_flush_buffer (YY_BUFFER_STATE  b )
{
    	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( );
}

/** Pushes the new state onto the stack. The new state becomes
 *  the current state. This function will allocate the stack
 *  if necessary.
 *  @param new_buffer The new state.
 *  
 */
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
    	if (new_buffer == NULL)
		return;

	yyensure_buffer_stack();

	/* This block is copied from yy_switch_to_buffer. */
	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*(yy_c_buf_p) = (yy_hold_char);
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	/* Only push if top exists. Otherwise, replace top. */
	if (YY_CURRENT_BUFFER)
		(yy_buffer_stack_top)++;
	YY_CURRENT_BUFFER_LVALUE = new_buffer;

	/* copied from yy_switch_to_buffer. */
	yy_load_buffer_state( );
	(yy_did_buffer_switch_on_eof) = 1;
}

/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  
 */
void yypop_buffer_state (void)
{
    	if (!YY_CURRENT_BUFFER)
		return;

	yy_delete_buffer(YY_CURRENT_BUFFER );
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if ((yy_buffer_stack_top) > 0)
		--(yy_buffer_stack_top);

	if (YY_CURRENT_BUFFER) {
		yy_load_buffer_state( );
		(yy_did_buffer_switch_on_eof) = 1;
	}
}

/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
static void yyensure_buffer_stack (void)
{
	int num_to_alloc;
    
	if (!(yy_buffer_stack)) {

		/* First allocation is just for 2 elements, since we don't know if this
		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
		 * immediate realloc on the next call.
         */
		num_to_alloc = 1;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		
		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
				
		(yy_buffer_stack_max) = num_to_alloc;
		(yy_buffer_stack_top) = 0;
		return;
	}

	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){

		/* Increase the buffer to prepare for a possible push. */
		int grow_size = 8 /* arbitrary grow size */;

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);

		/* zero only the new slots.*/
		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
		(yy_buffer_stack_max) = num_to_alloc;
	}
}

/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * 
 * @return the newly allocated buffer state object. 
 */
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
{
	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) yyalloc(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;
}

/** Setup the input buffer state to scan a string. The next call to yylex() will
 * scan from a @e copy of @a str.
 * @param str a NUL-terminated string to scan
 * 
 * @return the newly allocated buffer state object.
 * @note If you want to scan bytes that may contain NUL values, then use
 *       yy_scan_bytes() instead.
 */
YY_BUFFER_STATE yy_scan_string (yyconst char * str )
{
    
	return yy_scan_bytes(str,strlen(str) );
}

/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
 * scan from a @e copy of @a bytes.
 * @param bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE yy_scan_bytes  (yyconst char * bytes, int  len )
{
	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 *) yyalloc(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;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

static void yy_fatal_error (yyconst char* msg )
{
    	(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. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		yytext[yyleng] = (yy_hold_char); \
		(yy_c_buf_p) = yytext + yyless_macro_arg; \
		(yy_hold_char) = *(yy_c_buf_p); \
		*(yy_c_buf_p) = '\0'; \
		yyleng = yyless_macro_arg; \
		} \
	while ( 0 )

/* Accessor  methods (get/set functions) to struct members. */

/** Get the current line number.
 * 
 */
int yyget_lineno  (void)
{
        
    return yylineno;
}

/** Get the input stream.
 * 
 */
FILE *yyget_in  (void)
{
        return yyin;
}

/** Get the output stream.
 * 
 */
FILE *yyget_out  (void)
{
        return yyout;
}

/** Get the length of the current token.
 * 
 */
int yyget_leng  (void)
{
        return yyleng;
}

/** Get the current token.
 * 
 */

char *yyget_text  (void)
{
        return yytext;
}

/** Set the current line number.
 * @param line_number
 * 
 */
void yyset_lineno (int  line_number )
{
    
    yylineno = line_number;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param in_str A readable stream.
 * 
 * @see yy_switch_to_buffer
 */
void yyset_in (FILE *  in_str )
{
        yyin = in_str ;
}

void yyset_out (FILE *  out_str )
{
        yyout = out_str ;
}

int yyget_debug  (void)
{
        return yy_flex_debug;
}

void yyset_debug (int  bdebug )
{
        yy_flex_debug = bdebug ;
}

/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		yy_delete_buffer(YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		yypop_buffer_state();
	}

	/* Destroy the stack itself. */
	yyfree((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;

    return 0;
}

/*
 * Internal utility routines.
 */

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

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s )
{
	register int n;
    	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif

void *yyalloc (yy_size_t  size )
{
	return (void *) malloc( size );
}

void *yyrealloc  (void * ptr, yy_size_t  size )
{
	/* 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 );
}

void yyfree (void * ptr )
{
	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#undef YY_NEW_FILE
#undef YY_FLUSH_BUFFER
#undef yy_set_bol
#undef yy_new_buffer
#undef yy_set_interactive
#undef yytext_ptr
#undef YY_DO_BEFORE_ACTION

#ifdef YY_DECL_IS_OURS
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
#line 706 "./cfg.l"



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

	if (!highest) highest = MAXBANK;
	if (n < 0 || n >= MAXBANK || n >= highest) {
		bank = NULL;
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Bank index %d out of range (max %d) in file %s line %d",
			 n, highest, this_fname[include_stack_ptr], this_line[include_stack_ptr]);
		return;
	}
	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) return;
	if (num < 0 || num > 127) {
		ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
		 "Patch index %d out of range in file %s line %d",
			 num, this_fname[include_stack_ptr], this_line[include_stack_ptr]);
		return;
	}
	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].cutoff=
	    bank->tone[num].sustain=
	    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 read_config_file(const char *name, int prescan)
{
	int retvalue = 0;
	prescanning = prescan;
	include_stack_ptr = 0;
	rcf_count = 1;

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

	yyin = open_file(name, 1, OF_VERBOSE, rcf_count);
	if (this_fname[include_stack_ptr]) free(this_fname[include_stack_ptr]);
	this_fname[include_stack_ptr] = strdup(name);

	if (!yyin) return -1;
	current_toneset = current_drumset = 0;
	doing_drums = doing_sf = 0;
	BEGIN(0);
	if (!(retvalue = yylex())) {
	   if (prescan) got_a_configuration = 1;
	   else got_a_configuration = 2;
	}
	close_file(yyin);
	return retvalue;
}

static SFInfo sfinfo;

static char *getname(char *p);
static void print_sbk(SFInfo *sf);

static int check_sbk(SFInfo *sf);

static int sf2tab(char *sffname)
{
	FILE *fp;

	if ((fp = open_file(sffname, 1, OF_VERBOSE, 0)) == NULL) {
		return 0;
	}

	load_sbk(fp, &sfinfo);
	fclose(fp);

	if (!check_sbk(&sfinfo)) return 0;

	print_sbk(&sfinfo);
	if (!sf_count) return 0;

	a_sf[sf_count].font_code = FONT_SBK;
	a_sf[sf_count].num = 0;
	a_sf[sf_count].name = strdup( sffname );
	sf_count++;

	free_sbk(&sfinfo);
	return 1;
}


static char *getname(char *p)
{
	int i;
	static char buf[21];
	strncpy(buf, p, 20);
	buf[20] = 0;
	for (i = 19; i > 4 && buf[i]==' '; i--) {
	  buf[i] = 0;
	}
	for (i = 0; buf[i]; i++) {
	  if (buf[i] == ' ') buf[i] = '_';
	  if (buf[i] == '#') buf[i] = '@';
	}
	i = strlen(buf);
	if (i > 4 && buf[i-3] == '(' && buf[i-2] == 'L' && buf[i-1] == ')')
		buf[i-3] = '\0';
	return buf;
}

static int check_sbk(SFInfo *sf) {
	if (sf->version != 2) return 0;
	return 1;
}


static void print_sbk(SFInfo *sf)
{
    int i, b_nk, preset, lastpatch;
    int lastbank = -1;
    tpresethdr *ip;
    tinsthdr *tp;

    sf_count = 0;

    for (b_nk = 0; b_nk <= 128; b_nk++) {
      for (preset = 0; preset <= 127; preset++) {
      lastpatch = -1;
	for (i = 0, ip = sf->presethdr; i < sf->nrpresets-1; i++) {
	    int b, g, inst, sm_idx;
	    if (ip[i].bank != b_nk) continue;
	    if (ip[i].preset != preset) continue;
	    inst = -1;
	    for (b = ip[i].bagNdx; b < ip[i+1].bagNdx; b++) {
		for (g = sf->presetbag[b]; g < sf->presetbag[b+1]; g++)
		   if (sf->presetgen[g].oper == SF_instrument) {
			inst = sf->presetgen[g].amount;
			break;
		   }
	    }
	    if (inst < 0) continue;
	    tp = sf->insthdr;
	    if (b_nk != 128) {
		int realwaves = 0;
		if (b_nk != lastbank) {
			a_sf[sf_count].font_code = FONT_TONESET;
			a_sf[sf_count].num = b_nk;
			a_sf[sf_count].name = NULL;
			if (sf_count < MAX_SF_COUNT-2)
			sf_count++;
			lastbank = b_nk;
		}
		for (b = tp[inst].bagNdx; b < tp[inst+1].bagNdx; b++) {
		    sm_idx = -1;
		    for (g = sf->instbag[b]; g < sf->instbag[b+1]; g++) {
			if (sf->instgen[g].oper == SF_sampleId) sm_idx = sf->instgen[g].amount;
		    }
		    if (sm_idx >= 0 && sf->sampleinfo[sm_idx].sampletype < 0x8000) realwaves++;
		}
		if (realwaves && ip[i].preset != lastpatch) {
			a_sf[sf_count].font_code = FONT_PRESET;
			a_sf[sf_count].num = ip[i].preset;
			a_sf[sf_count].name = strdup( getname(ip[i].name) );
			if (sf_count < MAX_SF_COUNT-2)
			sf_count++;
		    lastpatch = ip[i].preset;
		}
	    }
	    else {
		int keynote, c, dpreset;
			a_sf[sf_count].font_code = FONT_DRUMSET;
			a_sf[sf_count].num = ip[i].preset;
			a_sf[sf_count].name = strdup( getname(ip[i].name) );
			if (sf_count < MAX_SF_COUNT-2)
			sf_count++;

		for (dpreset = 0; dpreset < 128; dpreset++)
	        for (c = ip[i].bagNdx; c < ip[i+1].bagNdx; c++) {
		  inst = -1;
		  for (g = sf->presetbag[c]; g < sf->presetbag[c+1]; g++)
		   if (sf->presetgen[g].oper == SF_instrument) {
			inst = sf->presetgen[g].amount;
			break;
		   }
		  if (inst >= 0) for (b = tp[inst].bagNdx; b < tp[inst+1].bagNdx; b++) {
		    int hikeynote = -1;
		    sm_idx = keynote = -1;
		    for (g = sf->instbag[b]; g < sf->instbag[b+1]; g++) {
			if (sf->instgen[g].oper == SF_sampleId) sm_idx = sf->instgen[g].amount;
			else if (sf->instgen[g].oper == SF_keyRange) {
			    keynote = sf->instgen[g].amount & 0xff;
			    hikeynote = (sf->instgen[g].amount >> 8) & 0xff;
			}
		    }
		    if (sm_idx < 0) continue;
		    if (sf->sampleinfo[sm_idx].sampletype >= 0x8000) continue;
		    /*if (keynote != dpreset) continue;*/
		    if (dpreset < keynote) continue;
		    if (dpreset > hikeynote) continue;
		    if (sm_idx >= 0 && keynote >= 0 && dpreset != lastpatch) {
			a_sf[sf_count].font_code = FONT_PRESET;
			a_sf[sf_count].num = dpreset;
			a_sf[sf_count].name = strdup( getname( sf->samplenames[sm_idx].name ) );
			if (sf_count < MAX_SF_COUNT-2)
			sf_count++;
			lastpatch = dpreset;
		    }
		  }
	        }

	    }
	}
      }
    }
}


static void
interpret_sf(void)
{
	int i = 0;

	while (1) {
		int action, which;
		const char *sf_name;
		//char *vc_name = NULL;

		action = a_sf[i].font_code;
		which = a_sf[i].num;
		sf_name = a_sf[i].name;

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

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

}


