#line 2 "imcc/imclexer.c"
/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /cvs/public/parrot/imcc/imclexer.c,v 1.77 2003/10/27 14:51:14 leo Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>


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


#ifdef __cplusplus

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

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

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

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

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

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

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif


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

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

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

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

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

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

/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin )

#define YY_END_OF_BUFFER_CHAR 0

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

typedef struct yy_buffer_state *YY_BUFFER_STATE;

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

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

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

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

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

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

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


struct yy_buffer_state
	{
	FILE *yy_input_file;

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

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

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

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

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

	/* Whether we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

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

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

static YY_BUFFER_STATE yy_current_buffer = 0;

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


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

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


int yyleng;

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

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

void yyrestart YY_PROTO(( FILE *input_file ));

void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

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

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

#define yy_new_buffer yy_create_buffer

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

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

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)

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

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

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

#define YY_NUM_RULES 111
#define YY_END_OF_BUFFER 112
static yyconst short int yy_accept[688] =
    {   0,
        0,    0,    0,    0,    0,    0,   16,   16,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  112,  100,
       99,    8,   99,  100,  100,    9,  100,  100,  100,  100,
      100,   85,  100,   90,   90,   73,  100,   75,   88,   88,
       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,  100,  100,    9,  100,   14,  100,   88,  100,
       14,  110,  107,  102,  107,  110,  110,  110,  110,  110,
       90,   90,  108,  108,  108,  106,  106,  110,   14,   16,
       17,   16,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,  111,  111,  111,  111,  111,    6,    6,  111,

      111,  111,    2,    2,    2,    2,    2,    2,    2,    2,
        2,  111,   90,   90,  111,    7,  111,  111,   10,  111,
      111,  111,  111,  111,   90,   90,  111,  111,  111,   99,
        8,   78,    0,   93,    0,    0,    0,    0,    0,   70,
        0,   94,   79,   90,   87,   87,   87,   87,   87,   87,
       87,   87,   87,   87,   87,   87,   87,   89,    0,    0,
       67,   74,   77,   76,   68,   84,   88,   86,   13,   88,
       88,   88,   88,   88,   88,   88,   88,   48,   88,   88,
       88,   88,   88,   88,   88,   88,   88,   71,   72,    0,
       87,   87,   87,   87,   87,  107,  102,  107,    0,    0,

      109,  109,  109,  109,  108,    0,   13,  108,  106,  106,
       16,   17,   16,   16,   16,   16,   16,   16,   16,   16,
       16,   16,   13,   16,   16,   16,    0,    6,   13,    0,
        2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
        2,    3,    0,    0,    7,    0,    0,   10,    0,    0,
        0,   93,    0,    0,    0,   94,   90,    0,   89,    0,
        0,   13,    0,    0,   93,   95,   96,   98,   97,   87,
       87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
       87,   87,   87,   87,   87,   87,   87,   87,   89,    0,
       92,   91,   69,   83,   13,   88,   88,   88,   52,   88,

       46,   88,   88,   88,   51,   50,   54,   88,   88,   88,
       88,   88,   88,   88,    0,   87,   87,   87,   87,    0,
      103,  105,  109,    0,  109,  109,  109,   13,  108,   16,
       16,   16,   16,   16,   16,   13,   16,   16,   16,    0,
       13,    0,    2,    2,    2,    2,    2,    2,    2,    2,
       93,    0,   89,    0,   92,   91,   13,    0,    0,   19,
       87,   87,   22,   87,   87,   87,   87,   87,   87,   87,
       87,   87,   87,   87,   87,   87,   21,   18,    0,   89,
       60,   64,   88,   88,   88,   88,   47,   88,   88,   88,
       88,   88,   88,   88,   88,   88,   88,    0,   87,   87,

       87,   87,  105,    0,  109,  109,  109,  108,  108,   16,
       16,   16,   16,   16,   16,   16,    0,    0,    0,    2,
        2,    2,    2,    2,    2,    0,    0,   89,    0,    0,
        0,   87,   87,   87,   87,   87,   87,   87,   87,   87,
       87,   87,   87,   87,   87,   87,   87,   87,   62,   88,
       53,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,   88,    0,   87,   87,   87,   12,  101,  109,
      109,  108,  108,   16,   16,   16,   16,   15,   16,    0,
        0,    0,    2,    2,    2,    2,    0,    0,    0,    0,
       36,   43,   87,   87,   40,   87,   87,   87,   42,   80,

       87,   87,   87,   45,   87,   87,   87,   87,   87,   87,
       88,   61,   88,   88,   57,   58,   88,   88,   88,   88,
       88,   88,   63,   49,    0,   11,   87,  109,  109,  108,
      108,   16,   16,   16,   16,    0,    0,    0,    2,    2,
        2,    2,    0,    0,    0,    0,   87,   87,   87,   87,
       87,   41,   87,   87,   87,   87,   87,   87,   34,   35,
       59,   88,   56,   88,   88,   88,   65,   88,   88,    0,
       87,  109,  104,  108,  108,   16,   16,   16,   16,    0,
        0,    0,    2,    2,    2,    2,    0,    0,    0,    0,
       87,   87,   87,   87,   82,   87,   87,   87,   87,   24,

       27,   88,   88,   88,   88,    0,    5,    0,   87,   82,
       16,   16,    5,   16,   82,    2,    2,    2,    2,   82,
        0,    5,    0,   37,   87,   87,   87,   87,   26,   87,
       25,   87,   88,   88,   88,   88,    4,    1,   81,    4,
        1,    4,    1,   87,   87,   87,   38,   23,   87,   87,
       55,   88,   32,   66,   87,   87,   87,   87,   87,   87,
       88,   87,   20,   44,   87,   87,   87,   87,   88,   39,
       87,   87,   87,   87,   88,   87,   87,   87,   31,   33,
       87,   87,   29,   87,   30,   28,    0
    } ;

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

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

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

static yyconst int yy_meta[56] =
    {   0,
        1,    1,    2,    1,    1,    1,    3,    1,    4,    1,
        1,    1,    1,    1,    1,    5,    5,    5,    6,    1,
        1,    1,    7,    7,    8,    8,    8,    8,    8,    1,
        8,    7,    7,    7,    7,    7,    7,    8,    8,    8,
        8,    8,    8,    8,    8,    8,    8,    8,    8,    8,
        8,    8,    8,    1,    1
    } ;

static yyconst short int yy_base[713] =
    {   0,
        0,   48,   64,   50,  119,   73,  172,  217,  258,  299,
      340,  381,   75,   50,  189,  237,  426,  471, 1747, 1748,
       57, 1748,   85, 1725,   65, 1748,   88, 1735, 1733, 1731,
      164, 1748,  487,  196,  200,   85, 1721,  156,  177,  240,
      217,  251,  242,  253,  258,  279,  281,  285,  284,  272,
      300,  270, 1687, 1685, 1698,  503, 1717,  297,  324,  336,
     1748, 1748,  359, 1748,  380,   73,    0, 1726,  186,  350,
      386,  396, 1717,  399,  191,  418,  422, 1694, 1748,    0,
     1748, 1731,  201, 1722,  357, 1692,  431,  441,  418, 1695,
     1689, 1695, 1748,  304, 1717,  444, 1687,  452,  475,  478,

     1690, 1684,    0,  338,  485, 1684,  536,  490,  493, 1687,
     1681,  552,  545,  497,  562, 1748,  568,  219, 1748,  298,
      572,  580,  577,  477,  583,  602,  605,  554,  600,  375,
     1748, 1748,  433, 1748,  582,  597,  608,  611,  614, 1748,
     1710, 1748, 1748,  621,    0, 1674,  206, 1676,  365, 1677,
     1674, 1672,   28,  234,  248, 1679,   59,  626,  415,    0,
     1748, 1748, 1748, 1748, 1692, 1694,  331, 1693,  636,  507,
      637,  638,  639,  640,  642,  651,  655,  335,  658,  660,
      662,  671,  674,  675,  678,  682,  679, 1748, 1748, 1671,
      408, 1666, 1677, 1674, 1663,  705, 1748,  714, 1687,    0,

     1686,   54,  352,  165, 1685, 1684,  713,  592,  731,  735,
        0, 1748,  603,    0,  659, 1691,    0,  726, 1658,  729,
      449,  750,  696, 1652, 1659, 1649, 1654,  733,  706, 1648,
        0,  693,    0,  739, 1652,  745,  455,  772,  742, 1646,
     1653, 1748,  768,  774, 1748,  789,  473, 1748,  796,  807,
      809,  798,  814,  816,  819,  821,  825,  828,  830,  846,
      869,  852,  832,  848,  773,  841,  858,  861,  865,    0,
     1654, 1659, 1647, 1654, 1652, 1655, 1642, 1651, 1650, 1649,
     1634, 1639, 1640, 1633, 1644,  813, 1644, 1634,  873,  882,
      848,    0, 1748, 1748,  875,  898,  899,  902,  901,  903,

      904,  905,  906,  907,  910,  919,  922,  923,  927,  938,
      940,  941,  939,  944, 1632, 1634, 1630, 1638, 1629, 1651,
     1650, 1649, 1648, 1647,  303,  558,  819, 1646,  933,  954,
     1630,  949,  917,  955,    0,    0,  631, 1620, 1614, 1627,
     1748,  927, 1626,  971,  980,  974,    0,    0,  940, 1616,
      996,  998, 1001, 1011, 1005,    0, 1007, 1009, 1027,    0,
     1611, 1610,  488, 1615, 1607, 1621, 1612, 1620, 1605, 1611,
     1613, 1617, 1615, 1615, 1596, 1595,    0,    0, 1017, 1022,
      997, 1032, 1033, 1034, 1035, 1036, 1038, 1040, 1039, 1047,
     1052, 1053, 1054, 1055, 1066, 1070, 1071, 1607, 1594, 1594,

     1609, 1636, 1619, 1618, 1057,  555,  333,  528,  943, 1595,
     1084, 1087, 1595, 1594, 1597, 1090, 1591, 1591, 1590, 1588,
     1091, 1094, 1588, 1587, 1590, 1111, 1113, 1116, 1118, 1120,
     1123, 1578, 1576, 1582, 1590, 1586, 1572, 1587, 1569, 1576,
     1572, 1571, 1567, 1579, 1570, 1102, 1570, 1564, 1128, 1131,
     1132, 1134, 1135, 1137, 1136, 1152, 1153, 1154, 1155, 1167,
     1159, 1168, 1172, 1604, 1605, 1559, 1559, 1748, 1586,  796,
      566,  644, 1017, 1555, 1562, 1559, 1596, 1748, 1597, 1550,
     1557, 1554, 1547, 1554, 1551, 1588, 1162, 1181, 1185, 1189,
        0,    0, 1560, 1549,    0, 1554, 1548, 1553,    0,    0,

     1552, 1541, 1553,    0, 1548, 1551, 1539, 1532, 1532, 1536,
     1186, 1188, 1190, 1194, 1195, 1201, 1206, 1207, 1208, 1214,
     1215, 1220, 1221, 1222, 1229, 1748, 1546,  501, 1257, 1046,
     1106, 1542, 1540, 1539, 1236, 1539, 1537, 1536, 1536, 1519,
     1515, 1247, 1232, 1245, 1254, 1266, 1465, 1467, 1452, 1453,
     1443,    0, 1446, 1420, 1415, 1377, 1382, 1382,    0,    0,
     1259, 1266, 1268, 1270, 1277, 1279, 1282, 1288, 1290, 1287,
     1371, 1281, 1269, 1213, 1261, 1377, 1407, 1406, 1303, 1374,
     1402, 1401, 1369, 1399, 1398, 1307, 1310, 1323, 1326, 1331,
     1353, 1352, 1367, 1353,    0, 1361, 1353, 1349, 1321, 1308,

        0, 1297, 1323, 1332, 1331,  290, 1328, 1303, 1254, 1275,
        0,  765, 1267, 1236, 1748,    0,  987, 1233, 1205, 1334,
     1349, 1354, 1357,    0, 1145, 1150, 1127, 1121,    0, 1105,
        0,  347, 1346, 1354, 1357, 1360, 1748, 1748,    0,    0,
        0, 1341, 1367, 1107, 1082, 1040,    0, 1047, 1031,  983,
     1365, 1366, 1368, 1369,  986,  917,  879, 1045,  848,  831,
     1371,  790,    0,    0,  761,  724,  703,  686, 1372,    0,
      654,  663,  619,  599, 1374,  489,  404,  292,    0, 1377,
      217,  202,    0,  152,    0,    0, 1748, 1419, 1427, 1435,
     1443, 1451, 1459, 1461, 1466, 1468, 1473, 1477, 1485, 1493,

     1501, 1509, 1517, 1525, 1533, 1541, 1545, 1549, 1552, 1554,
     1558, 1562
    } ;

static yyconst short int yy_def[713] =
    {   0,
      687,    1,    1,    3,  687,    5,  688,  688,  689,  689,
      690,  690,   10,   10,   10,   10,  691,  691,  687,  687,
      687,  687,  687,  687,  692,  687,  687,  687,  693,  687,
      687,  687,  694,  687,  687,  687,  687,  687,  695,  695,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  687,  687,  687,  694,  687,  694,  695,  694,
      687,  687,  687,  687,  687,  692,  696,  693,  687,  697,
      687,  687,  698,  698,  698,  687,  687,  687,  687,  699,
      687,  699,  700,  701,  699,  699,  699,  699,  699,  699,
      699,  699,  687,  692,  693,  687,  687,  687,  687,  687,

      687,  687,  702,  703,  702,  702,  702,  702,  702,  702,
      702,  692,  687,  687,  687,  687,  687,  704,  687,  704,
      705,  706,  704,  704,  704,  704,  704,  704,  704,  687,
      687,  687,  692,  687,  692,  687,  687,  687,  687,  687,
      693,  687,  687,  687,  707,  707,  707,  707,  707,  707,
      707,  707,  707,  707,  707,  707,  707,  687,  687,  708,
      687,  687,  687,  687,  687,  687,  695,  687,  695,  695,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  695,  695,  695,  695,  695,  687,  687,  687,
      707,  707,  707,  707,  707,  687,  687,  687,  709,  710,

      711,  711,  711,  711,  698,  687,  698,  698,  687,  687,
      699,  687,  700,  699,  700,  701,  699,  699,  699,  699,
      699,  699,  699,  699,  699,  699,  687,  687,  687,  687,
      702,  703,  702,  702,  702,  702,  702,  702,  702,  702,
      702,  687,  692,  687,  687,  687,  704,  687,  704,  705,
      705,  704,  705,  706,  706,  704,  704,  704,  704,  704,
      704,  704,  704,  704,  692,  687,  687,  687,  687,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  687,  687,
      687,  708,  687,  687,  695,  695,  695,  695,  695,  695,

      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  695,  695,  687,  707,  707,  707,  707,  709,
      687,  712,  711,  687,  711,  711,  711,  698,  698,  700,
      699,  699,  699,  699,  222,  699,  699,  699,  699,  687,
      687,  687,  702,  702,  702,  702,  238,  702,  702,  702,
      705,  704,  704,  704,  704,  261,  704,  704,  704,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  687,  687,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  695,  695,  695,  695,  695,  687,  707,  707,

      707,  707,  712,  687,  711,  711,  711,  698,  698,  699,
      699,  699,  699,  699,  699,  699,  687,  687,  687,  702,
      702,  702,  702,  702,  702,  704,  704,  704,  704,  704,
      704,  707,  707,  707,  707,  707,  707,  707,  707,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  695,  695,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  695,  687,  707,  707,  707,  687,  711,  711,
      711,  698,  698,  699,  699,  699,  699,  687,  699,  687,
      687,  687,  702,  702,  702,  702,  704,  704,  704,  704,
      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,

      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  695,
      695,  695,  695,  695,  687,  687,  707,  711,  711,  698,
      698,  699,  699,  699,  699,  687,  687,  687,  702,  702,
      702,  702,  704,  704,  704,  704,  707,  707,  707,  707,
      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,
      695,  695,  695,  695,  695,  695,  695,  695,  695,  687,
      707,  711,  687,  698,  698,  699,  699,  699,  699,  687,
      687,  687,  702,  702,  702,  702,  704,  704,  704,  704,
      707,  707,  707,  707,  707,  707,  707,  707,  707,  707,

      707,  695,  695,  695,  695,  687,  687,  687,  707,  711,
      699,  699,  699,  699,  687,  702,  702,  702,  702,  704,
      704,  704,  704,  707,  707,  707,  707,  707,  707,  707,
      707,  707,  695,  695,  695,  695,  687,  687,  707,  699,
      699,  704,  704,  707,  707,  707,  707,  707,  707,  707,
      695,  695,  695,  695,  707,  707,  707,  707,  707,  707,
      695,  707,  707,  707,  707,  707,  707,  707,  695,  707,
      707,  707,  707,  707,  695,  707,  707,  707,  707,  695,
      707,  707,  707,  707,  707,  707,    0,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,

      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687
    } ;

static yyconst short int yy_nxt[1804] =
    {   0,
       20,   21,   22,   23,   21,   24,   25,   26,   27,   28,
       29,   30,   31,   32,   33,   34,   35,   35,   20,   36,
       37,   38,   39,   39,   39,   40,   40,   40,   40,   20,
       39,   41,   39,   42,   43,   44,   45,   46,   39,   47,
       39,   39,   48,   39,   49,   50,   51,   39,   52,   39,
       39,   39,   39,   53,   54,   55,  112,   55,  130,  280,
      130,  130,   56,  281,   60,  113,  114,  114,   57,   20,
       61,  134,  324,   20,   76,   20,   77,   76,   58,  134,
       78,  112,   93,   20,   20,   20,  130,  131,  130,  130,
      113,  114,  114,   79,  135,   39,  325,   39,   39,   39,

       39,   39,  135,   39,  161,  162,   39,  287,   39,   39,
       59,  288,   39,  136,  137,  138,  139,   20,   20,   62,
       63,   64,   65,   63,   62,   66,   62,   67,   62,   68,
       62,   69,   62,   70,   71,   72,   72,   62,   62,   62,
       62,   73,   73,   73,   74,   74,   74,   74,   62,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   75,   73,   73,   73,   73,
       73,   73,   62,   62,   81,   82,  164,  165,   83,  144,
      144,  144,   84,  324,   85,  166,   86,   87,   88,   88,
      115,  116,  117,  115,  686,  168,   93,   89,   89,   89,

       89,  144,  144,  144,  113,  114,  114,  214,  327,  206,
      158,  144,  144,  144,  158,  144,  144,  144,   90,   81,
       82,  248,  249,   83,   91,  166,  208,   84,  159,   85,
      215,   86,   87,   88,   88,  168,  685,   92,  115,  116,
      117,  115,   89,   89,   89,   89,  272,  160,  166,  273,
      166,  170,  113,  114,  114,  169,  169,  169,  168,  166,
      168,  166,  684,   90,   94,  282,  166,  283,   95,  168,
       96,  168,   97,   98,   99,   99,  168,  173,  166,  284,
      166,  285,  171,  100,  100,  100,  100,  166,  168,  166,
      168,  172,  166,  166,  606,  174,  637,  168,  175,  168,

      248,  249,  168,  168,  101,   94,  102,  183,  166,   95,
      134,   96,  187,   97,   98,   99,   99,  178,  168,  176,
      180,  324,  177,  179,  100,  100,  100,  100,  181,  182,
      192,  184,  166,  135,  683,  185,  151,  405,  193,  166,
      231,  194,  168,  166,  141,  101,   94,  186,  233,  168,
      104,  324,  105,  168,  106,  107,  108,  108,  200,  185,
      196,  197,  198,  196,  471,  109,  109,  109,  109,  192,
      324,  195,  218,  218,  218,  151,  130,  193,  130,  130,
      194,  196,  197,  198,  196,  202,  110,   94,  111,  203,
      204,  104,  649,  105,  326,  106,  107,  108,  108,  650,

      158,  144,  144,  144,  275,  276,  109,  109,  109,  109,
      158,  144,  144,  144,  207,  207,  207,  206,  159,  209,
      197,  210,  209,  209,  197,  210,  209,  110,  119,  120,
      291,  291,  121,  223,  223,  223,  122,  160,  123,  134,
      124,  125,  126,  126,  682,  220,  218,  218,  218,  316,
      274,  127,  127,  127,  127,  220,  218,  218,  218,  144,
      144,  144,  135,  221,  334,  334,  158,  228,  228,  228,
      346,  346,  128,  119,  120,  248,  249,  121,  129,  248,
      249,  122,  222,  123,  159,  124,  125,  126,  126,  158,
      228,  228,  228,  229,  229,  229,  127,  127,  127,  127,

      234,  234,  234,  160,  236,  234,  234,  234,  239,  239,
      239,  158,  144,  144,  144,  166,  258,  128,  146,  324,
      147,  434,  148,  149,  150,  168,  151,  152,  153,  154,
      435,  155,  156,  157,  146,  572,  147,  681,  191,  149,
      150,  296,  151,  152,  153,  154,  206,  155,  156,  157,
      236,  234,  234,  234,  242,  243,  248,  249,  134,  158,
      144,  144,  144,  244,  245,  246,  244,  472,  237,  244,
      245,  246,  244,  324,  248,  251,  324,  159,  252,  248,
      249,  135,  248,  255,  324,  248,  249,  238,  265,  263,
      256,  406,  257,  257,  257,  470,  160,  259,  257,  257,

      257,  253,  248,  249,  248,  249,  529,  248,  249,  214,
      206,  135,  266,  266,  266,  260,  259,  257,  257,  257,
      262,  262,  262,  267,  267,  267,  268,  268,  268,  269,
      269,  269,  215,  679,  261,  158,  144,  144,  144,  329,
      264,  289,  289,  289,  166,  166,  166,  166,  166,  290,
      166,  295,  295,  295,  168,  168,  168,  168,  168,  166,
      168,  290,  206,  166,  678,  330,  166,  413,  166,  168,
      166,  414,  299,  168,  301,  300,  168,  297,  168,  166,
      168,  298,  166,  166,  530,  302,  166,  166,  215,  168,
      166,  305,  168,  168,  303,  231,  168,  168,  677,  141,

      168,  676,  304,  233,  308,  306,  196,  197,  198,  196,
      307,  336,  336,  336,  309,  196,  197,  198,  196,  314,
      310,  341,  341,  341,  311,  312,  674,  313,  328,  328,
      328,  206,  209,  197,  210,  209,  209,  197,  210,  209,
      220,  218,  218,  218,  332,  332,  332,  158,  228,  228,
      228,  673,  333,  236,  234,  234,  234,  348,  348,  348,
      344,  344,  344,  672,  333,  335,  335,  335,  345,  612,
      242,  640,  335,  335,  134,  244,  245,  246,  244,  134,
      345,  335,  335,  335,  335,  335,  335,  347,  347,  347,
      244,  245,  246,  244,  347,  347,  671,  135,  248,  249,

      248,  249,  135,  347,  347,  347,  347,  347,  347,  248,
      251,  248,  251,  252,  324,  252,  248,  251,  248,  255,
      351,  248,  255,  248,  249,  670,  256,  248,  249,  256,
      248,  249,  248,  249,  248,  249,  253,  324,  253,  259,
      257,  257,  257,  253,  528,  353,  353,  353,  248,  249,
      248,  249,  407,  354,  248,  249,  266,  266,  266,  375,
      376,  355,  355,  291,  291,  354,  668,  357,  357,  357,
      352,  248,  249,  267,  267,  267,  268,  268,  268,  358,
      269,  269,  269,  166,  356,  356,  356,  359,  289,  289,
      289,  356,  356,  168,  379,  667,  290,  380,  380,  380,

      356,  356,  356,  356,  356,  356,  166,  166,  290,  166,
      166,  166,  166,  166,  166,  166,  168,  168,  166,  168,
      168,  168,  168,  168,  168,  168,  664,  166,  168,  411,
      166,  166,  412,  412,  412,  166,  385,  168,  386,  382,
      168,  168,  384,  381,  383,  168,  166,  166,  166,  166,
      387,  206,  166,  390,  663,  388,  168,  168,  168,  168,
      214,  206,  168,  418,  332,  332,  332,  419,  389,  408,
      334,  334,  333,  409,  391,  393,  423,  394,  396,  397,
      424,  395,  473,  215,  333,  392,  344,  344,  344,  346,
      346,  617,  421,  637,  345,  422,  422,  422,  248,  251,

      248,  249,  252,  248,  249,  166,  345,  248,  249,  248,
      249,  248,  249,  248,  249,  168,  353,  353,  353,  662,
      355,  355,  660,  427,  354,  253,  428,  428,  428,  248,
      249,  426,  380,  380,  380,  206,  354,  380,  380,  380,
      166,  166,  166,  166,  166,  429,  166,  166,  166,  430,
      168,  168,  168,  168,  168,  166,  168,  168,  168,  531,
      166,  166,  166,  166,  206,  168,  659,  452,  449,  431,
      168,  168,  168,  168,  166,  324,  450,  658,  166,  166,
      453,  574,  451,  454,  168,  459,  657,  455,  168,  168,
      665,  456,  478,  479,  460,  457,  458,  666,  469,  412,

      412,  412,  412,  412,  412,  461,  422,  422,  422,  422,
      422,  422,  462,  248,  249,  248,  249,  463,  248,  249,
      248,  249,  248,  249,  206,  248,  249,  656,  428,  428,
      428,  428,  428,  428,  505,  506,  166,  507,  655,  166,
      166,  575,  166,  166,  166,  166,  168,  648,  508,  168,
      168,  487,  168,  168,  168,  168,  647,  488,  490,  489,
      166,  166,  166,  166,  248,  249,  511,  166,  516,  646,
      168,  168,  168,  168,  512,  166,  166,  168,  513,  514,
      166,  645,  515,  248,  249,  168,  168,  248,  249,  644,
      168,  248,  249,  546,  166,  520,  166,  517,  166,  519,

      518,  522,  166,  166,  168,  523,  168,  521,  168,  166,
      543,  638,  168,  168,  166,  166,  166,  606,  524,  168,
      561,  544,  166,  166,  168,  168,  168,  545,  166,  166,
      166,  206,  168,  168,  248,  249,  562,  618,  168,  168,
      168,  563,  641,  566,  570,  570,  570,  248,  249,  564,
      568,  579,  579,  579,  567,  569,  248,  249,  573,  565,
      573,  573,  586,  586,  586,  607,  587,  166,  248,  249,
      573,  613,  573,  573,  166,  324,  166,  168,  166,  206,
      588,  590,  590,  590,  168,  166,  168,  166,  168,  589,
      166,  608,  606,  324,  607,  168,  166,  168,  166,  324,

      168,  639,  570,  570,  570,  166,  168,  614,  168,  638,
      605,  619,  248,  249,  602,  168,  610,  603,  579,  579,
      579,  604,  586,  586,  586,  248,  249,  621,  248,  249,
      622,  166,  607,  248,  249,  623,  248,  249,  632,  166,
      166,  168,  633,  248,  249,  620,  590,  590,  590,  168,
      168,  248,  249,  621,  166,  642,  248,  249,  622,  248,
      249,  631,  166,  643,  168,  166,  634,  635,  166,  248,
      249,  636,  168,  166,  166,  168,  166,  166,  168,  166,
      166,  651,  166,  168,  168,  166,  168,  168,  630,  168,
      168,  653,  168,  629,  628,  168,  627,  626,  625,  624,

      654,  652,  618,  617,  616,  607,  606,  675,  680,  615,
      613,  612,  611,  609,  601,  669,  600,  599,  661,   80,
       80,   80,   80,   80,   80,   80,   80,   93,   93,   93,
       93,   93,   93,   93,   93,  103,  103,  103,  103,  103,
      103,  103,  103,  118,  118,  118,  118,  118,  118,  118,
      118,  133,  598,  133,  133,  133,  133,  133,  133,  141,
      597,  141,  141,  141,  141,  141,  141,  145,  145,  167,
      167,  167,  167,  167,  199,  199,  201,  596,  595,  201,
      201,  205,  205,  205,  205,  211,  594,  211,  211,  211,
      211,  211,  211,  213,  593,  213,  213,  213,  213,  213,

      213,  216,  592,  216,  216,  216,  216,  216,  216,  231,
      231,  591,  231,  231,  231,  231,  231,  232,  232,  232,
      232,  232,  232,  232,  232,  247,  247,  247,  247,  247,
      247,  247,  247,  250,  250,  250,  250,  250,  250,  250,
      250,  254,  254,  254,  254,  254,  254,  254,  254,  270,
      585,  270,  270,  292,  584,  292,  320,  320,  320,  320,
      322,  322,  323,  323,  323,  323,  403,  403,  403,  403,
      583,  582,  581,  580,  578,  577,  576,  571,  560,  559,
      558,  557,  556,  555,  554,  553,  552,  551,  550,  549,
      548,  547,  542,  541,  540,  539,  538,  537,  536,  478,

      535,  534,  533,  532,  324,  508,  527,  526,  525,  510,
      509,  504,  503,  502,  501,  500,  499,  498,  497,  496,
      495,  494,  493,  492,  491,  486,  485,  484,  483,  482,
      481,  480,  477,  476,  475,  474,  403,  404,  468,  467,
      466,  465,  464,  448,  447,  446,  445,  444,  443,  442,
      441,  440,  439,  438,  437,  436,  433,  432,  425,  420,
      417,  416,  415,  410,  206,  323,  324,  404,  320,  321,
      402,  401,  400,  399,  398,  378,  377,  374,  373,  372,
      371,  370,  369,  368,  367,  366,  365,  364,  363,  362,
      361,  360,  350,  349,  343,  342,  340,  339,  338,  337,

      331,  217,  205,  206,  324,  321,  319,  318,  280,  317,
      315,  167,  294,  293,  286,  279,  278,  277,  274,  271,
      142,  241,  240,  235,  190,  230,  227,  142,  226,  225,
      224,  219,  217,  212,  190,  206,  142,  163,  190,  189,
      188,  163,  143,  142,  140,  132,  687,   19,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,

      687,  687,  687
    } ;

static yyconst short int yy_chk[1804] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    2,   14,    4,   21,  153,
       21,   21,    2,  153,    4,   14,   14,   14,    2,    3,
        4,   25,  202,    3,    6,    3,    6,    6,    3,   66,
        6,   13,   13,    3,    3,    3,   23,   23,   23,   23,
       13,   13,   13,    6,   25,    3,  202,    3,    3,    3,

        3,    3,   66,    3,   36,   36,    3,  157,    3,    3,
        3,  157,    3,   27,   27,   27,   27,    3,    3,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    5,    7,    7,   38,   38,    7,   31,
       31,   31,    7,  204,    7,   39,    7,    7,    7,    7,
       15,   15,   15,   15,  684,   39,   15,    7,    7,    7,

        7,   69,   69,   69,   15,   15,   15,   83,  204,   75,
       34,   34,   34,   34,   35,   35,   35,   35,    7,    8,
        8,  118,  118,    8,    8,   41,   75,    8,   34,    8,
       83,    8,    8,    8,    8,   41,  682,    8,   16,   16,
       16,   16,    8,    8,    8,    8,  147,   34,   40,  147,
       43,   41,   16,   16,   16,   40,   40,   40,   40,   42,
       43,   44,  681,    8,    9,  154,   45,  154,    9,   42,
        9,   44,    9,    9,    9,    9,   45,   43,   52,  155,
       50,  155,   42,    9,    9,    9,    9,   46,   52,   47,
       50,   42,   49,   48,  606,   44,  606,   46,   45,   47,

      120,  120,   49,   48,    9,   10,   10,   50,   51,   10,
       94,   10,   52,   10,   10,   10,   10,   47,   51,   46,
       48,  325,   46,   47,   10,   10,   10,   10,   48,   49,
       58,   51,   59,   94,  678,   51,   58,  325,   58,  167,
      104,   58,   59,  178,  104,   10,   11,   51,  104,  167,
       11,  407,   11,  178,   11,   11,   11,   11,   70,   59,
       63,   63,   63,   63,  407,   11,   11,   11,   11,   60,
      203,   60,   85,   85,   85,   60,  130,   60,  130,  130,
       60,   65,   65,   65,   65,   70,   11,   12,   12,   70,
       70,   12,  632,   12,  203,   12,   12,   12,   12,  632,

       71,   71,   71,   71,  149,  149,   12,   12,   12,   12,
       72,   72,   72,   72,   74,   74,   74,   74,   71,   76,
       76,   76,   76,   77,   77,   77,   77,   12,   17,   17,
      159,  159,   17,   89,   89,   89,   17,   71,   17,  133,
       17,   17,   17,   17,  677,   87,   87,   87,   87,  191,
      191,   17,   17,   17,   17,   88,   88,   88,   88,   96,
       96,   96,  133,   87,  221,  221,   98,   98,   98,   98,
      237,  237,   17,   18,   18,  247,  247,   18,   18,  124,
      124,   18,   87,   18,   98,   18,   18,   18,   18,   99,
       99,   99,   99,  100,  100,  100,   18,   18,   18,   18,

      105,  105,  105,   98,  108,  108,  108,  108,  109,  109,
      109,  114,  114,  114,  114,  170,  124,   18,   33,  528,
       33,  363,   33,   33,   33,  170,   33,   33,   33,   33,
      363,   33,   33,   33,   56,  528,   56,  676,   56,   56,
       56,  170,   56,   56,   56,   56,  408,   56,   56,   56,
      107,  107,  107,  107,  112,  112,  128,  128,  112,  113,
      113,  113,  113,  115,  115,  115,  115,  408,  107,  117,
      117,  117,  117,  406,  121,  121,  326,  113,  121,  123,
      123,  112,  122,  122,  471,  125,  125,  107,  135,  128,
      122,  326,  123,  123,  123,  406,  113,  125,  125,  125,

      125,  121,  129,  129,  126,  126,  471,  127,  127,  213,
      208,  135,  136,  136,  136,  125,  126,  126,  126,  126,
      127,  127,  127,  137,  137,  137,  138,  138,  138,  139,
      139,  139,  213,  674,  125,  144,  144,  144,  144,  208,
      129,  158,  158,  158,  169,  171,  172,  173,  174,  158,
      175,  169,  169,  169,  169,  171,  172,  173,  174,  176,
      175,  158,  472,  177,  673,  215,  179,  337,  180,  176,
      181,  337,  173,  177,  174,  173,  179,  171,  180,  182,
      181,  172,  183,  184,  472,  175,  185,  187,  215,  182,
      186,  179,  183,  184,  176,  232,  185,  187,  672,  232,

      186,  671,  177,  232,  181,  179,  196,  196,  196,  196,
      180,  223,  223,  223,  182,  198,  198,  198,  198,  187,
      183,  229,  229,  229,  184,  185,  668,  186,  207,  207,
      207,  207,  209,  209,  209,  209,  210,  210,  210,  210,
      218,  218,  218,  218,  220,  220,  220,  228,  228,  228,
      228,  667,  220,  234,  234,  234,  234,  239,  239,  239,
      236,  236,  236,  666,  220,  222,  222,  222,  236,  612,
      243,  612,  222,  222,  243,  244,  244,  244,  244,  265,
      236,  222,  222,  222,  222,  222,  222,  238,  238,  238,
      246,  246,  246,  246,  238,  238,  665,  243,  249,  249,

      252,  252,  265,  238,  238,  238,  238,  238,  238,  250,
      250,  251,  251,  250,  470,  251,  253,  253,  254,  254,
      253,  255,  255,  256,  256,  662,  254,  257,  257,  255,
      258,  258,  259,  259,  263,  263,  250,  327,  251,  257,
      257,  257,  257,  253,  470,  259,  259,  259,  260,  260,
      264,  264,  327,  259,  262,  262,  266,  266,  266,  286,
      286,  260,  260,  291,  291,  259,  660,  262,  262,  262,
      258,  261,  261,  267,  267,  267,  268,  268,  268,  263,
      269,  269,  269,  295,  261,  261,  261,  264,  289,  289,
      289,  261,  261,  295,  290,  659,  289,  290,  290,  290,

      261,  261,  261,  261,  261,  261,  296,  297,  289,  299,
      298,  300,  301,  302,  303,  304,  296,  297,  305,  299,
      298,  300,  301,  302,  303,  304,  657,  306,  305,  333,
      307,  308,  333,  333,  333,  309,  302,  306,  303,  297,
      307,  308,  300,  296,  298,  309,  310,  313,  311,  312,
      304,  329,  314,  308,  656,  307,  310,  313,  311,  312,
      330,  409,  314,  342,  332,  332,  332,  342,  307,  329,
      334,  334,  332,  329,  309,  311,  349,  312,  313,  314,
      349,  312,  409,  330,  332,  310,  344,  344,  344,  346,
      346,  617,  345,  617,  344,  345,  345,  345,  351,  351,

      352,  352,  351,  353,  353,  381,  344,  355,  355,  357,
      357,  358,  358,  354,  354,  381,  353,  353,  353,  655,
      355,  355,  650,  354,  353,  351,  354,  354,  354,  359,
      359,  352,  379,  379,  379,  473,  353,  380,  380,  380,
      382,  383,  384,  385,  386,  358,  387,  389,  388,  358,
      382,  383,  384,  385,  386,  390,  387,  389,  388,  473,
      391,  392,  393,  394,  530,  390,  649,  386,  383,  359,
      391,  392,  393,  394,  395,  405,  384,  648,  396,  397,
      388,  530,  385,  388,  395,  393,  646,  389,  396,  397,
      658,  390,  416,  416,  394,  391,  392,  658,  405,  411,

      411,  411,  412,  412,  412,  395,  421,  421,  421,  422,
      422,  422,  396,  426,  426,  427,  427,  397,  428,  428,
      429,  429,  430,  430,  531,  431,  431,  645,  427,  427,
      427,  428,  428,  428,  446,  446,  449,  446,  644,  450,
      451,  531,  452,  453,  455,  454,  449,  630,  446,  450,
      451,  426,  452,  453,  455,  454,  628,  429,  431,  430,
      456,  457,  458,  459,  487,  487,  450,  461,  455,  627,
      456,  457,  458,  459,  452,  460,  462,  461,  453,  454,
      463,  626,  454,  488,  488,  460,  462,  489,  489,  625,
      463,  490,  490,  490,  511,  459,  512,  456,  513,  458,

      457,  461,  514,  515,  511,  462,  512,  460,  513,  516,
      487,  619,  514,  515,  517,  518,  519,  574,  463,  516,
      511,  488,  520,  521,  517,  518,  519,  489,  522,  523,
      524,  574,  520,  521,  543,  543,  513,  618,  522,  523,
      524,  514,  614,  519,  525,  525,  525,  544,  544,  517,
      521,  535,  535,  535,  520,  522,  545,  545,  529,  518,
      529,  529,  542,  542,  542,  575,  543,  561,  546,  546,
      573,  613,  573,  573,  562,  529,  563,  561,  564,  575,
      544,  546,  546,  546,  562,  565,  563,  566,  564,  545,
      567,  570,  568,  610,  569,  565,  568,  566,  569,  572,

      567,  609,  570,  570,  570,  602,  568,  579,  569,  608,
      566,  586,  587,  587,  562,  602,  572,  564,  579,  579,
      579,  565,  586,  586,  586,  588,  588,  588,  589,  589,
      589,  603,  607,  590,  590,  590,  620,  620,  600,  605,
      604,  603,  602,  642,  642,  587,  590,  590,  590,  605,
      604,  621,  621,  621,  633,  621,  622,  622,  622,  623,
      623,  599,  634,  623,  633,  635,  603,  604,  636,  643,
      643,  605,  634,  651,  652,  635,  653,  654,  636,  661,
      669,  633,  675,  651,  652,  680,  653,  654,  598,  661,
      669,  635,  675,  597,  596,  680,  594,  593,  592,  591,

      636,  634,  585,  584,  583,  582,  581,  669,  675,  580,
      578,  577,  576,  571,  558,  661,  557,  556,  652,  688,
      688,  688,  688,  688,  688,  688,  688,  689,  689,  689,
      689,  689,  689,  689,  689,  690,  690,  690,  690,  690,
      690,  690,  690,  691,  691,  691,  691,  691,  691,  691,
      691,  692,  555,  692,  692,  692,  692,  692,  692,  693,
      554,  693,  693,  693,  693,  693,  693,  694,  694,  695,
      695,  695,  695,  695,  696,  696,  697,  553,  551,  697,
      697,  698,  698,  698,  698,  699,  550,  699,  699,  699,
      699,  699,  699,  700,  549,  700,  700,  700,  700,  700,

      700,  701,  548,  701,  701,  701,  701,  701,  701,  702,
      702,  547,  702,  702,  702,  702,  702,  703,  703,  703,
      703,  703,  703,  703,  703,  704,  704,  704,  704,  704,
      704,  704,  704,  705,  705,  705,  705,  705,  705,  705,
      705,  706,  706,  706,  706,  706,  706,  706,  706,  707,
      541,  707,  707,  708,  540,  708,  709,  709,  709,  709,
      710,  710,  711,  711,  711,  711,  712,  712,  712,  712,
      539,  538,  537,  536,  534,  533,  532,  527,  510,  509,
      508,  507,  506,  505,  503,  502,  501,  498,  497,  496,
      494,  493,  486,  485,  484,  483,  482,  481,  480,  479,

      477,  476,  475,  474,  469,  467,  466,  465,  464,  448,
      447,  445,  444,  443,  442,  441,  440,  439,  438,  437,
      436,  435,  434,  433,  432,  425,  424,  423,  420,  419,
      418,  417,  415,  414,  413,  410,  404,  403,  402,  401,
      400,  399,  398,  376,  375,  374,  373,  372,  371,  370,
      369,  368,  367,  366,  365,  364,  362,  361,  350,  343,
      340,  339,  338,  331,  328,  324,  323,  322,  321,  320,
      319,  318,  317,  316,  315,  288,  287,  285,  284,  283,
      282,  281,  280,  279,  278,  277,  276,  275,  274,  273,
      272,  271,  241,  240,  235,  230,  227,  226,  225,  224,

      219,  216,  206,  205,  201,  199,  195,  194,  193,  192,
      190,  168,  166,  165,  156,  152,  151,  150,  148,  146,
      141,  111,  110,  106,  102,  101,   97,   95,   92,   91,
       90,   86,   84,   82,   78,   73,   68,   57,   55,   54,
       53,   37,   30,   29,   28,   24,   19,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,
      687,  687,  687,  687,  687,  687,  687,  687,  687,  687,

      687,  687,  687
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "imcc/imcc.l"
#define INITIAL 0
#line 2 "imcc/imcc.l"
/*
 * imcc.l
 *
 * Intermediate Code Compiler for Parrot
 *
 * Copyright (C) 2002 Melvin Smith
 *
 * The tokenizer.
 */


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "imc.h"
#include "parser.h"

#define MAX_PARAM 16

struct params_t {
    char *name[MAX_PARAM];
    int num_param;
};

struct macro_t {
    char *name;
    struct params_t params;
    char *expansion;
    int line;
};

/* XXX: boe: rework this hack to use a hash */
struct macro_t macros[256];
int num_macros = 0;

char temp_buffer[4096];

struct macro_frame_t {
    struct macro_frame_t *next;
    YY_BUFFER_STATE buffer;
    struct params_t *params;
    struct params_t expansion;
    int label;
    char *file;
    int line;
    int pasm_file;      /* pasm_file mode of previous frame */
    int is_macro;
};

struct macro_frame_t *frames = NULL;

/* static function declariations */
static struct macro_frame_t *new_frame (void);
static void scan_string (struct macro_frame_t *frame, const char *expansion);
static void scan_file (struct macro_frame_t *frame, FILE *);
static void destroy_frame (struct macro_frame_t *frame);
static int yylex_skip (YYSTYPE *valp, void *interp, const char *skip);

static int read_macro (YYSTYPE *valp, void *interp);
static int expand_macro (YYSTYPE *valp, void *interp, const char *name);
static void include_file (char *file_name);
static int in_pod;
static int prev_state;

#define YY_DECL int yylex(YYSTYPE *valp, struct Parrot_Interp *interp)

#define YYCHOP() (yytext[--yyleng] = '\0')
#define DUP_AND_RET(valp, token)             \
  do {                                       \
      if (valp) (valp)->s = str_dup(yytext); \
      return token;                          \
  } while (0)

#define YY_NEVER_INTERACTIVE 1
#define YY_STACK_USED 1
#define emit 1

#define macro 2

#define pod 3

#define cmt1 4

#define cmt2 5

#define cmt3 6

#define cmt4 7

#define cmt5 8

#line 1087 "imcc/imclexer.c"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#line 107 "imcc/imcc.l"

        /* for emacs "*/
        if (expect_pasm == 1 && !in_pod) {
            expect_pasm = 2;
            BEGIN(emit);
        }
        if (pasm_file && YYSTATE == INITIAL && !in_pod) {
            if (0)
                yy_top_state(); /* silent warning */
            if (pasm_file == 1) {
                BEGIN(emit);
                return EMIT;
	    }
            return 0;
        }

#line 1258 "imcc/imclexer.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 )
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();
		}

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

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

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

		yy_current_state = yy_start;
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yy_last_accepting_state = yy_current_state;
				yy_last_accepting_cpos = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 688 )
					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] != 1748 );

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 123 "imcc/imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt2);
                       valp->t = atoi(yytext+6);
                       return LINECOMMENT;
               }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 127 "imcc/imcc.l"
{ BEGIN(cmt3);
                      valp->s = str_dup(yytext);
                      return FILECOMMENT;
               }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 131 "imcc/imcc.l"
{ BEGIN(prev_state) ; line++; }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 133 "imcc/imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt2); }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 134 "imcc/imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt1); }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 135 "imcc/imcc.l"
{
                       valp->t = atoi(yytext);
                       BEGIN(cmt4);
                       return LINECOMMENT;
               }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 140 "imcc/imcc.l"
{ BEGIN(prev_state) ; line++; }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 142 "imcc/imcc.l"
{
        if (expect_pasm == 2)
	  BEGIN(INITIAL);
        expect_pasm = 0;
        line++;
        return '\n';
    }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 150 "imcc/imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt5); }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 151 "imcc/imcc.l"
{
        if (expect_pasm == 2)
	  BEGIN(INITIAL);
        else
          BEGIN(prev_state);
        expect_pasm = 0;
        line++;
        return '\n';
    }
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 162 "imcc/imcc.l"
{
	BEGIN(emit);
	return(EMIT);
    }
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 167 "imcc/imcc.l"
{
	BEGIN(INITIAL);
	return EOM;
    }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 172 "imcc/imcc.l"
{
	valp->s = str_dup(yytext);
	return REG;
	}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 177 "imcc/imcc.l"
{ in_pod = 1; yy_push_state(pod); }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 178 "imcc/imcc.l"
{ in_pod = 0; yy_pop_state(); ++line; }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 179 "imcc/imcc.l"
{ /*ignore*/ }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 180 "imcc/imcc.l"
{ ++line; }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 182 "imcc/imcc.l"
return(LOCAL);
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 183 "imcc/imcc.l"
return(ARG);
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 184 "imcc/imcc.l"
return(FLATTEN_ARG);
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 185 "imcc/imcc.l"
return(SUB);
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 186 "imcc/imcc.l"
return(ESUB);
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 187 "imcc/imcc.l"
return(PCC_BEGIN);
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 188 "imcc/imcc.l"
return(PCC_END);
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 189 "imcc/imcc.l"
return(PCC_CALL);
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 190 "imcc/imcc.l"
return(NCI_CALL);
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 191 "imcc/imcc.l"
return(PCC_SUB);
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 192 "imcc/imcc.l"
return(PCC_BEGIN_RETURN);
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 193 "imcc/imcc.l"
return(PCC_END_RETURN);
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 194 "imcc/imcc.l"
return(PCC_BEGIN_YIELD);
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 195 "imcc/imcc.l"
return(PCC_END_YIELD);
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 196 "imcc/imcc.l"
return PROTOTYPED;
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 197 "imcc/imcc.l"
return NON_PROTOTYPED;
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 199 "imcc/imcc.l"
return(RESULT);
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 200 "imcc/imcc.l"
return(RETURN);
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 201 "imcc/imcc.l"
return(CLASS);
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 202 "imcc/imcc.l"
return(ENDCLASS);
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 203 "imcc/imcc.l"
return(NAMESPACE);
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 204 "imcc/imcc.l"
return(ENDNAMESPACE);
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 205 "imcc/imcc.l"
return(FIELD);
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 206 "imcc/imcc.l"
return(METHOD);
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 207 "imcc/imcc.l"
return(LOCAL);
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 208 "imcc/imcc.l"
return(CONST);
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 209 "imcc/imcc.l"
return(GLOBAL_CONST);
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 210 "imcc/imcc.l"
return(PARAM);
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 211 "imcc/imcc.l"
return(END);
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 212 "imcc/imcc.l"
return(GOTO);
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 213 "imcc/imcc.l"
return(IF);
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 214 "imcc/imcc.l"
return(UNLESS);
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 215 "imcc/imcc.l"
return(INTV);
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 216 "imcc/imcc.l"
return(INC);
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 217 "imcc/imcc.l"
return(DEC);
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 218 "imcc/imcc.l"
return(FLOATV);
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 219 "imcc/imcc.l"
return(NEW);
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 220 "imcc/imcc.l"
return(NEWCLOSURE);
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 221 "imcc/imcc.l"
return(NEWCONT);
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 222 "imcc/imcc.l"
return(NEWCOR);
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 223 "imcc/imcc.l"
return(NEWSUB);
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 224 "imcc/imcc.l"
return(DEFINED);
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 225 "imcc/imcc.l"
return(ADDR);
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 226 "imcc/imcc.l"
return(GLOBAL);
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 227 "imcc/imcc.l"
return(CLONE);
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 228 "imcc/imcc.l"
return(STRINGV);
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 229 "imcc/imcc.l"
return(CALL);
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 230 "imcc/imcc.l"
return(SAVEALL);
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 231 "imcc/imcc.l"
return(RESTOREALL);
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 232 "imcc/imcc.l"
return(SHIFT_LEFT);
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 233 "imcc/imcc.l"
return(SHIFT_RIGHT);
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 234 "imcc/imcc.l"
return(SHIFT_RIGHT_U);
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 235 "imcc/imcc.l"
return(LOG_AND);
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 236 "imcc/imcc.l"
return(LOG_OR);
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 237 "imcc/imcc.l"
return(LOG_XOR);
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 238 "imcc/imcc.l"
return(RELOP_LT);
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 239 "imcc/imcc.l"
return(RELOP_LTE);
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 240 "imcc/imcc.l"
return(RELOP_GT);
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 241 "imcc/imcc.l"
return(RELOP_GTE);
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 242 "imcc/imcc.l"
return(RELOP_EQ);
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 243 "imcc/imcc.l"
return(RELOP_NE);
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 244 "imcc/imcc.l"
return(POW);
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 246 "imcc/imcc.l"
{
        return read_macro(valp, interp);
    }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 250 "imcc/imcc.l"
{
        int c;
	char *name;
	struct macro_t *m;

	BEGIN(macro);
	c = yylex_skip(valp, interp, " ");
	if (c != IDENTIFIER)
	    fataly(EX_SOFTWARE, sourcefile, line,
		   "Constant names must be identifiers");

	name = str_dup(valp->s);

	c = yylex_skip(valp, interp, " ");
        if (c != INTC && c != FLOATC && c != STRINGC && c != REG)
        fataly(EX_SOFTWARE, sourcefile, line,
        "Constant '%s' value must be a number, "
            "stringliteral or register", name);

	m = macros + num_macros++;
	m->name = name;
	m->expansion = str_dup (valp->s);
	m->params.num_param = 0;

	BEGIN (emit);
	return MACRO;
    }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 278 "imcc/imcc.l"
{
        int c;

	c = yylex(valp, interp);
	if (c != STRINGC) return c;

	YYCHOP();
	include_file(str_dup(yytext + 1));
    }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 288 "imcc/imcc.l"
{
        char *label;

	if (valp) {
	    YYCHOP();
            YYCHOP();

	    label = mem_sys_allocate(yyleng+10);
	    sprintf(label, "%s%d", yytext, frames->label);

	    valp->s = label;
	}

        return LABEL;
    }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 304 "imcc/imcc.l"
{
        char *label;

	if (valp) {
	    YYCHOP();

	    label = mem_sys_allocate(yyleng+10);
	    sprintf(label, "%s%d", yytext, frames->label);

	    valp->s = label;
	}

	return IDENTIFIER;
    }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 319 "imcc/imcc.l"
return(COMMA);
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 321 "imcc/imcc.l"
{
	YYCHOP();  /* trim last ':' */
	DUP_AND_RET(valp,LABEL);
    }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 326 "imcc/imcc.l"
{
        int type = pmc_type(interp, string_from_cstring(interp, yytext+1, 0));

        if (type > 0) {
            char *buf = malloc(16);
	    sprintf(buf, "%d", type);
	    valp->s = buf;
	    return INTC;
	}
	if (!expand_macro(valp, interp, yytext+1))
            fataly(1, sourcefile, line, "unknown macro '%s'", yytext);
    }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 339 "imcc/imcc.l"
{
	if (!is_def) {
		SymReg *r = find_sym(yytext);
		if (r && (r->type & (VTIDENTIFIER|VT_CONSTP))) {
		    valp->sr = r;
		    return VAR;
		}
	}
        valp->s = str_dup(yytext);
        return(!is_def && is_op(interp, valp->s) ? PARROT_OP : IDENTIFIER);
    }
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 351 "imcc/imcc.l"
DUP_AND_RET(valp, FLOATC);
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 352 "imcc/imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 353 "imcc/imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 354 "imcc/imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 356 "imcc/imcc.l"
{
	valp->s = str_dup(yytext);
        return(STRINGC); /* XXX delete quotes, -> emit, pbc */
    }
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 361 "imcc/imcc.l"
{
        valp->s = str_dup(yytext); /* XXX delete quotes, -> emit, pbc */
        return(STRINGC);
    }
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 366 "imcc/imcc.l"
DUP_AND_RET(valp, IREG);
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 367 "imcc/imcc.l"
DUP_AND_RET(valp, NREG);
	YY_BREAK
case 97:
YY_RULE_SETUP
#line 368 "imcc/imcc.l"
DUP_AND_RET(valp, SREG);
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 369 "imcc/imcc.l"
DUP_AND_RET(valp, PREG);
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 371 "imcc/imcc.l"
/* skip */;
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 373 "imcc/imcc.l"
{
        return yytext[0];
    }
	YY_BREAK
case YY_STATE_EOF(emit):
#line 377 "imcc/imcc.l"
{
        BEGIN (INITIAL);
        if (pasm_file) {
            pasm_file = 2;
            return EOM;
        }
        return 0;
    }
	YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 386 "imcc/imcc.l"
yyterminate();
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 388 "imcc/imcc.l"
DUP_AND_RET(valp, ENDM);
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 390 "imcc/imcc.l"
{
        line++;
        DUP_AND_RET(valp, '\n');
    }
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 395 "imcc/imcc.l"
return LABEL;
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 396 "imcc/imcc.l"
{
        char *label;
	char *name = macros[num_macros].name;

	if (yylex(valp, interp) != LABEL)
	    fataly(EX_SOFTWARE, sourcefile, line, "LABEL expected");

	if (valp) {
	    YYCHOP();

	    label = mem_sys_allocate(strlen(name) + yyleng + 15);
	    sprintf(label, "local__%s__%s__$:", name, yytext+1);

	    valp->s = label;
	}

	return LABEL;
    }
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 415 "imcc/imcc.l"
{
        char *label;
	char *name = macros[num_macros].name;

	if (valp) {
	    label = mem_sys_allocate(strlen(name) + yyleng + 15);
	    sprintf(label, "local__%s__%s__$", name, yytext+2);

	    valp->s = label;
	}

	return IDENTIFIER;
    }
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 429 "imcc/imcc.l"
/* skip leading ws */;
	YY_BREAK
case 107:
YY_RULE_SETUP
#line 430 "imcc/imcc.l"
DUP_AND_RET(valp, ' ');
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 431 "imcc/imcc.l"
DUP_AND_RET(valp, IDENTIFIER);
	YY_BREAK
case 109:
YY_RULE_SETUP
#line 432 "imcc/imcc.l"
DUP_AND_RET(valp, MACRO);
	YY_BREAK
case 110:
YY_RULE_SETUP
#line 433 "imcc/imcc.l"
DUP_AND_RET(valp, yytext[0]);
	YY_BREAK
case YY_STATE_EOF(macro):
#line 434 "imcc/imcc.l"
yyterminate();
	YY_BREAK
case 111:
YY_RULE_SETUP
#line 436 "imcc/imcc.l"
ECHO;
	YY_BREAK
#line 2076 "imcc/imclexer.c"
case YY_STATE_EOF(pod):
case YY_STATE_EOF(cmt1):
case YY_STATE_EOF(cmt2):
case YY_STATE_EOF(cmt3):
case YY_STATE_EOF(cmt4):
case YY_STATE_EOF(cmt5):
	yyterminate();

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

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

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

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

			yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state();

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = yytext_ptr + YY_MORE_ADJ;

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

			else
				{
				yy_cp = yy_c_buf_p;
				goto yy_find_action;
				}
			}

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

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

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

			case EOB_ACT_CONTINUE_SCAN:
				yy_c_buf_p =
					yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state();

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

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

				yy_current_state = yy_get_previous_state();

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

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


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

static int yy_get_next_buffer()
	{
	register char *dest = yy_current_buffer->yy_ch_buf;
	register char *source = yytext_ptr;
	register int number_to_move, i;
	int ret_val;

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

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

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

	/* Try to read more data. */

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

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

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

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

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

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

			int yy_c_buf_p_offset =
				(int) (yy_c_buf_p - b->yy_ch_buf);

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

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

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

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

			yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

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

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

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

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

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

	yytext_ptr = &yy_current_buffer->yy_ch_buf[0];

	return ret_val;
	}


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

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

	yy_current_state = yy_start;
	yy_current_state += YY_AT_BOL();

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

	return yy_current_state;
	}


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

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	register int yy_is_jam;
	register char *yy_cp = yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yy_last_accepting_state = yy_current_state;
		yy_last_accepting_cpos = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 688 )
			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 == 687);

	return yy_is_jam ? 0 : yy_current_state;
	}


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

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

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

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

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

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

	*--yy_cp = (char) c;


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


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

	*yy_c_buf_p = yy_hold_char;

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

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

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

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

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap() )
						return EOF;

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

				case EOB_ACT_CONTINUE_SCAN:
					yy_c_buf_p = yytext_ptr + offset;
					break;
				}
			}
		}

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

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

	return c;
	}


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

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


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

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

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

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


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


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

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

	b->yy_buf_size = size;

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

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( ! b )
		return;

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

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

	yy_flex_free( (void *) b );
	}


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

#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif


	{
	yy_flush_buffer( b );

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

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


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

	{
	if ( ! b )
		return;

	b->yy_n_chars = 0;

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

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

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

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


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

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

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

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

	yy_switch_to_buffer( b );

	return b;
	}
#endif


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

	return yy_scan_bytes( yy_str, len );
	}
#endif


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

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

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

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

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

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

	return b;
	}
#endif


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

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

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

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

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

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}
#endif


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

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}
#endif


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

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

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



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

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


/* Internal utility routines. */

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

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

	return n;
	}
#endif


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

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

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}

#if YY_MAIN
int main()
	{
	yylex();
	return 0;
	}
#endif
#line 436 "imcc/imcc.l"


#ifdef yywrap
#undef yywrap
#endif

int yywrap() {
    /* Add code here to open next source file and start scanning
       yywrap returns 0 if scanning is to continue
    */
    yy_delete_buffer(YY_CURRENT_BUFFER);

    /* pop old frame */
    if (frames) {
	struct macro_frame_t *tmp;
	tmp = frames;
        pasm_file = frames->pasm_file;
        if (YYSTATE == INITIAL || YYSTATE == emit)
            BEGIN(pasm_file ? emit : INITIAL);
	frames = frames->next;
	destroy_frame(tmp);
	return 0;
    }

    return 1;
}

static struct macro_frame_t *
new_frame (void)
{
    static int label = 0;
    struct macro_frame_t *tmp;

    tmp = mem_sys_allocate_zeroed(sizeof(struct macro_frame_t));
    tmp->label = ++label;
    tmp->line = line;
    tmp->file = sourcefile;
    tmp->pasm_file = pasm_file;

    return tmp;
}

static void
scan_string (struct macro_frame_t *frame, const char *expansion)
{
    frame->buffer = YY_CURRENT_BUFFER;
    frame->next = frames;
    frames = frame;

    yy_scan_string(expansion);
}

static void
destroy_frame (struct macro_frame_t *frame)
{
    YY_BUFFER_STATE buffer;
    int i;

    buffer = frame->buffer;

    for (i = 0; i < frame->expansion.num_param; i++) {
	free(frame->expansion.name[i]);
    }

    line = frame->line;
    sourcefile = frame->file; /* FIXME, if file was allocated free it */

    mem_sys_free(frame);

    yy_switch_to_buffer(buffer);
}

static int
yylex_skip (YYSTYPE *valp, void *interp, const char *skip)
{
    int c;
    const char *p;

    do {
        c = yylex(valp, interp);
        p = skip;
	while (*p && c != *p) p++;
    } while (*p != '\0');
    if (c)
        DUP_AND_RET(valp, c);
    else
        return c;
}

static int
read_params (YYSTYPE *valp, void *interp, struct params_t *params,
	     const char *macro_name, int need_id)
{
    int c;
    YYSTYPE val;
    char *current = str_dup("");
    int len = 0;

    params->num_param = 0;
    c = yylex_skip(&val, interp, " \n");

    while(c != ')') {
	if (c <= 0)
	    fataly(EX_SOFTWARE, sourcefile, line,
		   "End of file reached while reading arguments in '%s'",
                   macro_name);
	else if (c == ',') {
            if (params->num_param == MAX_PARAM)
                fataly(EX_SOFTWARE, sourcefile, line,
                       "More then %d params in '%s'",
                       MAX_PARAM, macro_name);
	    params->name[params->num_param++] = current;
	    current = str_dup("");
	    len = 0;
	    c = yylex_skip(&val, interp, " \n");
	}
	else if (need_id && (*current || c != IDENTIFIER) && c != ' ') {
	    fataly(EX_SOFTWARE, sourcefile, line,
		   "Parameter definition in '%s' must be IDENTIFIER",
                   macro_name);
	}
	else {
	    if (!need_id || c != ' ') {
		len += strlen(val.s);
		current = realloc(current, len + 1);
		strcat(current,val.s);
	    }
	    free(val.s);
	    c = yylex(&val,interp);
	}
    }
    params->name[params->num_param++] = current;

    if (valp) *valp = val;
    else free(val.s);

    return c;
}

static int
read_macro (YYSTYPE *valp, void *interp)
{
    int c;
    struct macro_t *m = macros + num_macros;
    int start_cond;

    temp_buffer[0]='\0';

    start_cond = YY_START;
    BEGIN(macro);

    c = yylex_skip(valp, interp, " ");
    if (c != IDENTIFIER)
	fataly(EX_SOFTWARE, sourcefile, line,
            "Macro names must be identifiers");

    m->name = valp->s;
    m->line = line;

    /* white space is allowed between macro and opening paren) */
    c = yylex_skip(valp, interp, " ");

    if (c == '(') {
	free(valp->s);

	c = read_params(NULL, interp, &m->params, m->name, 1);

	c = yylex(valp, interp);
    }

    while (c != ENDM) {
	if (c <= 0)
	    fataly (EX_SOFTWARE, sourcefile, line,
		    "File ended before macro '%s' was complete", m->name);

	strcat(temp_buffer, valp->s);
	free(valp->s);

        c = yylex(valp, interp);
    }
    free(valp->s);

    BEGIN(start_cond);

    macros[num_macros].expansion = str_dup(temp_buffer);

    num_macros++;
    return MACRO;
}

static char *
find_macro_param (const char *name)
{
    struct macro_frame_t *f;
    int i;

    for (f = frames; f; f = f->next) {
	if (f->params) {
	    for (i = 0; i < f->params->num_param; i++) {
		if (strcmp(f->params->name[i], name) == 0) {
		    return f->expansion.name[i];
		}
	    }
	}
    }

    return NULL;
}

static struct macro_t *
find_macro (const char* name)
{
    int i;

    for (i = 0; i < num_macros; i++) {
	if (strcmp(name, macros[i].name) == 0) return macros + i;
    }

    return NULL;
}

static int
expand_macro (YYSTYPE *valp, void *interp, const char *name)
{
    int c;
    struct macro_frame_t *frame;
    struct macro_t *m;
    const char *expansion;
    int start_cond;
    union {
        const void * __c_ptr;
        void * __ptr;
    } __ptr_u;
#define const_cast(b) (__ptr_u.__c_ptr = (b), __ptr_u.__ptr)

    UNUSED(valp);
    frame = new_frame();

    expansion = find_macro_param(name);
    if (expansion) {
	scan_string(frame, expansion);
	return 1;
    }

    m = find_macro(name);
    frame->params = &m->params;
    if (m) {
        /* remember macro name for error reporting
         */
        sourcefile = const_cast(name);
        frame->is_macro = 1;
	/* whitespace can be savely ignored */
	do {
	    c = input();
	} while (c == ' ' || c == '\t');

	if (c != '(') {
	    unput(c);
	    if (m->params.num_param != 0)
		fataly (EX_SOFTWARE, sourcefile, line,
			"Macro '%s' needs %d arguments",
                        m->name, m->params.num_param);
	    scan_string(frame, m->expansion);
	    return 1;
	}

	start_cond = YY_START;
	BEGIN(macro);

	read_params (NULL, interp, &frame->expansion, m->name, 0);

	BEGIN(start_cond);

	if (frame->expansion.num_param == 0 && m->params.num_param == 1) {
	    frame->expansion.name[0] = str_dup("");
	    frame->expansion.num_param = 1;
	}

	if (frame->expansion.num_param != m->params.num_param) {
	    fataly(EX_SOFTWARE, sourcefile, line,
		   "Macro '%s' requires %d arguments, but %d given",
		   m->name, m->params.num_param, frame->expansion.num_param);
	}

	line = m->line;
	scan_string(frame, m->expansion);
	return 1;
    }

    return 0;
}

static void
include_file (char *file_name)
{
    struct macro_frame_t *frame;
    FILE *file;
    char *ext;

    frame = new_frame();

    file = fopen(file_name, "r");
    if (!file) {
        /* TODO make include patch configurable */
        const char * incl_path =  "runtime/parrot/include";
        char *s = malloc(strlen(incl_path) + strlen(file_name) + 2);
        strcpy(s, incl_path);
        strcat(s, "/");
        strcat(s, file_name);
#ifdef WIN32
        {
            char *p;
            while ( (p = strchr(s, '/')) )
                *p = '\\';
        }
#endif
        file = fopen(s, "r");
        /* free(s); FIXME leak */
        if (!file)
            fataly(EX_SOFTWARE, sourcefile, line, strerror(errno));
        sourcefile = s;
    }
    else {
        sourcefile = file_name;
    }

    ext = strrchr(file_name, '.');
    if (ext) {
        if (strcmp (ext, ".pasm") == 0) {
            pasm_file = 1;
            BEGIN(emit);
        }
        else if (strcmp (ext, ".imc") == 0) {
            pasm_file = 0;
            BEGIN(INITIAL);
        }
    }

    scan_file (frame, file);
}

static void
scan_file (struct macro_frame_t *frame, FILE *file)
{
    frame->buffer = YY_CURRENT_BUFFER;
    frame->next = frames;
    frames = frame;

    /* XXX: Switch the filename */
    line = 1;

    yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE));
}

void
compile_file(Interp *interp, FILE *file)
{
    YY_BUFFER_STATE buffer;

    buffer = YY_CURRENT_BUFFER;
    yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE));

    emit_open(1, interp);
    yyparse((void *) interp);
    emit_close(interp);

    yy_switch_to_buffer(buffer);
}

void
print_inc(const char *file, int lin)
{
    struct macro_frame_t *f;

    if (frames && frames->is_macro)
        fprintf(stderr, "\nin macro '.%s' line %d\n", file, lin);
    else
        fprintf(stderr, "\nin file '%s' line %d\n", file, lin);
    for (f = frames; f; f = f->next) {
        if (f->file && strcmp(f->file, sourcefile))
            f->next ?
            fprintf(stderr, "\tincluded from '%s' line %d\n",
                f->file, f->line) :
            fprintf(stderr, "\tincluded from '%s' sub '%s' line %d\n",
                f->file, function, f->line);
    }
}

/*
 * Local variables:
 * c-indentation-style: bsd
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
 *
 * vim: expandtab shiftwidth=4:
 */
