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

/* Scanner skeleton version:
 * $Header: /cvs/public/parrot/languages/imcc/imclexer.c,v 1.54 2003/09/04 16:15:36 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 103
#define YY_END_OF_BUFFER 104
static yyconst short int yy_accept[637] =
    {   0,
        0,    0,    0,    0,    0,    0,   16,   16,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,  104,   92,
       91,    8,   91,   92,   92,    9,   92,   92,   92,   92,
       92,   77,   92,   82,   82,   65,   92,   67,   80,   80,
       80,   80,   80,   80,   80,   80,   80,   80,   80,   80,
       80,   80,   92,   92,    9,   92,   14,   92,   80,   92,
      102,   99,   94,   99,  102,  102,  102,  102,  102,   82,
       82,  100,  100,  100,   98,   98,  102,   16,   17,   16,
       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
      103,  103,  103,  103,  103,    6,    6,  103,  103,  103,

        2,    2,    2,    2,    2,    2,    2,    2,    2,  103,
       82,   82,  103,    7,  103,  103,   10,  103,  103,  103,
      103,  103,   82,   82,  103,  103,  103,   91,    8,   70,
        0,   85,    0,    0,    0,    0,    0,   62,    0,   86,
       71,   82,   79,   79,   79,   79,   79,   79,   79,   79,
       79,   79,   79,   79,   81,    0,    0,   59,   66,   69,
       68,   60,   76,   80,   78,   13,   80,   80,   80,   80,
       80,   80,   80,   80,   44,   80,   80,   80,   80,   80,
       80,   80,   80,   80,   63,   64,    0,   79,   79,   79,
       99,   94,   99,    0,    0,  101,  101,  101,  101,  100,

       13,  100,   98,   98,   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,   85,    0,    0,    0,   86,
       82,    0,   81,    0,    0,   13,    0,    0,   85,   87,
       88,   90,   89,   79,   79,   79,   79,   79,   79,   79,
       79,   79,   79,   79,   79,   79,   79,   79,   81,    0,
       84,   83,   61,   75,   13,   80,   80,   80,   48,   80,
       42,   80,   80,   80,   47,   46,   50,   80,   80,   80,

       80,   80,   80,   80,    0,   79,   79,   79,    0,   95,
       97,  101,  101,  101,  101,   13,  100,   16,   16,   16,
       16,   16,   16,   13,   16,   16,   16,    0,   13,    0,
        2,    2,    2,    2,    2,    2,    2,    2,   85,    0,
       81,    0,   84,   83,   13,    0,    0,   19,   79,   79,
       21,   79,   79,   79,   79,   79,   79,   79,   79,   79,
       20,   18,    0,   81,   52,   56,   80,   80,   80,   80,
       43,   80,   80,   80,   80,   80,   80,   80,   80,    0,
       79,   79,   79,   97,  101,  101,  101,  100,  100,   16,
       16,   16,   16,   16,   16,   16,    0,    0,    0,    2,

        2,    2,    2,    2,    2,    0,    0,   81,    0,    0,
        0,   79,   79,   79,   79,   79,   79,   79,   79,   79,
       79,   79,   79,   79,   54,   80,   49,   80,   80,   80,
       80,   80,   80,   80,   80,   80,    0,   79,   79,   12,
       93,  101,  101,  100,  100,   16,   16,   16,   16,   15,
       16,    0,    0,    0,    2,    2,    2,    2,    0,    0,
        0,    0,   34,   39,   79,   79,   79,   79,   38,   72,
       79,   41,   79,   79,   79,   79,   79,   79,   80,   53,
       80,   80,   80,   80,   80,   80,   55,   45,    0,   11,
       79,  101,  101,  100,  100,   16,   16,   16,   16,    0,

        0,    0,    2,    2,    2,    2,    0,    0,    0,    0,
       79,   79,   79,   79,   79,   79,   79,   79,   79,   32,
       33,   51,   80,   80,   80,   57,   80,   80,    0,   79,
      101,   96,  100,  100,   16,   16,   16,   16,    0,    0,
        0,    2,    2,    2,    2,    0,    0,    0,    0,   79,
       79,   79,   74,   79,   79,   79,   23,   25,   80,   80,
       80,    0,    5,    0,   79,   74,   16,   16,    5,   16,
       74,    2,    2,    2,    2,   74,    0,    5,    0,   35,
       79,   79,   79,   79,   24,   79,   80,   80,   80,    4,
        1,   73,    4,    1,    4,    1,   79,   79,   36,   22,

       79,   79,   80,   30,   58,   79,   79,   79,   79,   79,
       80,   79,   40,   79,   79,   79,   79,   80,   37,   79,
       79,   79,   79,   80,   79,   79,   79,   29,   31,   79,
       79,   27,   79,   28,   26,    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,    1,    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,   25,   39,   25,   25,   40,   41,   42,
       43,   44,   25,   45,   46,   47,   48,   49,   50,   51,
       52,   25,    1,   53,    1,   54,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    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[55] =
    {   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,    1,    1
    } ;

static yyconst short int yy_base[662] =
    {   0,
        0,   47,   63,   48,  117,   56,  169,  213,  253,  293,
      333,  373,   63,   70,  186,  233,  417,  461, 1623, 1624,
       87, 1624,  110, 1601,   52, 1624,  179, 1611, 1609, 1607,
       49, 1624,  476,  194,  237,   73, 1597,   82,   87,  256,
      213,  258,  267,  204,  174,  274,  276,  269,  278,  306,
      322,  315, 1564, 1562, 1575,  491, 1593,  140,  307,  222,
     1624,  325, 1624,  333,  170,    0, 1602,  347,  336,  378,
      388,    0,  350, 1576,  405,  410, 1571,    0, 1624, 1607,
      171, 1598,  400, 1569,  422,  432,  409, 1571, 1566, 1571,
     1624,  277, 1593,  435, 1564,  442,  465,  468, 1566, 1561,

        0,  367,  478, 1561,  523,  482,  485, 1563, 1558,  539,
      532,  536,  555, 1624,  559,  215, 1624,  240,  563,  502,
      568,  541,  572,  591,  594,  349,  352,  287, 1624, 1624,
      424, 1624,  504,  561,  583,  586,  597, 1624, 1586, 1624,
     1624,  601,    0, 1551,  427, 1553, 1554, 1551, 1549, 1559,
     1558,   42, 1553,  325,  604,  316,    0, 1624, 1624, 1624,
     1624, 1566, 1568,  238, 1624,  615,  616,  452,  617,  618,
      629,  620,  634,  635,  378,  637,  638,  649,  640,  653,
      656,  657,  661,  660, 1624, 1624, 1547,  341, 1542, 1541,
      690, 1624,  705, 1564,    0,    0, 1540, 1539, 1537,    0,

      669, 1532,  709,  713,    0, 1624,  561,    0,  566, 1567,
        0,  704, 1535,  707,  406,  728,  680, 1529, 1536, 1526,
     1531,  711,  685, 1525,    0,  727,    0,  724, 1529,  731,
      425,  752,  719, 1523, 1530, 1624,  747,  754, 1624,  769,
      578, 1624,  638,  775,  787,  670,  789,  795,  797,  686,
      806,  799,  809,  812,  843,  832,  827,  834,  774,  826,
      835,  838,  846,    0, 1530, 1535, 1524, 1530, 1521, 1529,
     1528, 1527, 1519, 1514, 1524,  686, 1524, 1515,  865,  852,
      823,    0, 1624, 1624,  447,  875,  876,  877,  500,  878,
      788,  879,  881,  883,  884,  890,  896,  899,  903,  904,

      912,  915,  918,  920, 1513, 1515, 1511, 1511, 1532, 1624,
        0,    0, 1515, 1515, 1514,    0,  641,  788, 1513,  925,
      946,  841,    0,    0,  743, 1504, 1498, 1510, 1624,  774,
     1509,  929,  953,  855,    0,    0,  867, 1500,  969,  964,
      971,  987,  976,    0,  929,  974,  978,    0, 1495, 1494,
      191, 1506, 1498, 1505, 1491, 1499, 1502, 1502, 1484, 1483,
        0,    0,  967,  992,  916,  919,  977,  993,  997, 1006,
      935, 1008, 1010, 1012, 1009, 1015, 1017, 1021, 1013, 1494,
     1482, 1482, 1524,    0, 1485, 1485, 1492, 1484, 1483, 1481,
     1029, 1032, 1481, 1480, 1482, 1039, 1477, 1477, 1476, 1474,

     1044, 1048, 1474, 1473, 1475, 1054, 1064, 1067, 1069, 1071,
     1073, 1464, 1462, 1468, 1475, 1474, 1457, 1464, 1460, 1456,
     1460, 1053, 1460, 1454, 1014, 1060, 1069, 1081, 1082, 1083,
     1084, 1086, 1088, 1095, 1097, 1103, 1493, 1494, 1449, 1624,
        0, 1447, 1454, 1453, 1450, 1443, 1450, 1447, 1483, 1624,
     1484, 1438, 1445, 1442, 1435, 1442, 1439, 1475, 1114, 1116,
     1121, 1128,    0,    0, 1447, 1437, 1437, 1441,    0,    0,
     1431,    0, 1438, 1441, 1430, 1423, 1423, 1425, 1104, 1125,
     1127, 1129, 1131, 1132, 1133, 1138, 1134, 1136, 1142, 1624,
     1431, 1419, 1171, 1414, 1375, 1367, 1358, 1350, 1148, 1347,

     1342, 1341, 1325, 1316, 1281, 1161, 1179, 1181, 1183, 1185,
     1269, 1278, 1278, 1275, 1278, 1270, 1267, 1271, 1272,    0,
        0, 1152, 1171, 1185, 1188, 1186, 1187, 1203, 1193, 1262,
     1267, 1211, 1297, 1296, 1263, 1291, 1290, 1216, 1253, 1279,
     1263, 1221, 1225, 1218, 1219, 1222, 1235, 1238, 1243, 1147,
     1145, 1125,    0, 1120, 1076, 1071, 1067,    0, 1235, 1236,
     1243,  289, 1046, 1032,  990,    0,    0,  519,  992,  953,
     1624,    0,  827,  953,  933, 1196, 1246, 1260, 1224,    0,
      892,  868,  870,  849,    0,  147, 1247, 1258, 1260, 1624,
     1624,    0,    0,    0, 1267, 1270,  788,  720,    0,  722,

      631,  622, 1266, 1267, 1271,  616,  598,  949,  583,  556,
     1272,  519,    0,  492,  465,  443,  422, 1273,    0,  389,
      362,  326,  312, 1278,  254,  222,  133,    0, 1279,   65,
       55,    0,   15,    0,    0, 1624, 1318, 1326, 1334, 1342,
     1350, 1358, 1360, 1365, 1367, 1372, 1376, 1384, 1392, 1400,
     1408, 1416, 1424, 1432, 1440, 1444, 1448, 1451, 1453, 1457,
     1461
    } ;

static yyconst short int yy_def[662] =
    {   0,
      636,    1,    1,    3,  636,    5,  637,  637,  638,  638,
      639,  639,   10,   10,   10,   10,  640,  640,  636,  636,
      636,  636,  636,  636,  641,  636,  636,  636,  642,  636,
      636,  636,  643,  636,  636,  636,  636,  636,  644,  644,
      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
      644,  644,  636,  636,  636,  643,  636,  643,  644,  643,
      636,  636,  636,  636,  641,  645,  642,  636,  646,  636,
      636,  647,  647,  647,  636,  636,  636,  648,  636,  648,
      649,  650,  648,  648,  648,  648,  648,  648,  648,  648,
      636,  641,  642,  636,  636,  636,  636,  636,  636,  636,

      651,  652,  651,  651,  651,  651,  651,  651,  651,  641,
      636,  636,  636,  636,  636,  653,  636,  653,  654,  655,
      653,  653,  653,  653,  653,  653,  653,  636,  636,  636,
      641,  636,  641,  636,  636,  636,  636,  636,  642,  636,
      636,  636,  656,  656,  656,  656,  656,  656,  656,  656,
      656,  656,  656,  656,  636,  636,  657,  636,  636,  636,
      636,  636,  636,  644,  636,  644,  644,  644,  644,  644,
      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,
      644,  644,  644,  644,  636,  636,  636,  656,  656,  656,
      636,  636,  636,  658,  659,  660,  660,  660,  660,  647,

      647,  647,  636,  636,  648,  636,  649,  648,  649,  650,
      648,  648,  648,  648,  648,  648,  648,  648,  648,  648,
      636,  636,  636,  636,  651,  652,  651,  651,  651,  651,
      651,  651,  651,  651,  651,  636,  641,  636,  636,  636,
      653,  636,  653,  654,  654,  653,  654,  655,  655,  653,
      653,  653,  653,  653,  653,  653,  653,  653,  641,  636,
      636,  636,  636,  656,  656,  656,  656,  656,  656,  656,
      656,  656,  656,  656,  656,  656,  656,  656,  636,  636,
      636,  657,  636,  636,  644,  644,  644,  644,  644,  644,
      644,  644,  644,  644,  644,  644,  644,  644,  644,  644,

      644,  644,  644,  644,  636,  656,  656,  656,  658,  636,
      661,  660,  660,  660,  660,  647,  647,  649,  648,  648,
      648,  648,  216,  648,  648,  648,  648,  636,  636,  636,
      651,  651,  651,  651,  232,  651,  651,  651,  654,  653,
      653,  653,  653,  255,  653,  653,  653,  656,  656,  656,
      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
      656,  656,  636,  636,  644,  644,  644,  644,  644,  644,
      644,  644,  644,  644,  644,  644,  644,  644,  644,  636,
      656,  656,  656,  661,  660,  660,  660,  647,  647,  648,
      648,  648,  648,  648,  648,  648,  636,  636,  636,  651,

      651,  651,  651,  651,  651,  653,  653,  653,  653,  653,
      653,  656,  656,  656,  656,  656,  656,  656,  656,  656,
      656,  656,  656,  656,  644,  644,  644,  644,  644,  644,
      644,  644,  644,  644,  644,  644,  636,  656,  656,  636,
      660,  660,  660,  647,  647,  648,  648,  648,  648,  636,
      648,  636,  636,  636,  651,  651,  651,  651,  653,  653,
      653,  653,  656,  656,  656,  656,  656,  656,  656,  656,
      656,  656,  656,  656,  656,  656,  656,  656,  644,  644,
      644,  644,  644,  644,  644,  644,  644,  644,  636,  636,
      656,  660,  660,  647,  647,  648,  648,  648,  648,  636,

      636,  636,  651,  651,  651,  651,  653,  653,  653,  653,
      656,  656,  656,  656,  656,  656,  656,  656,  656,  656,
      656,  644,  644,  644,  644,  644,  644,  644,  636,  656,
      660,  636,  647,  647,  648,  648,  648,  648,  636,  636,
      636,  651,  651,  651,  651,  653,  653,  653,  653,  656,
      656,  656,  656,  656,  656,  656,  656,  656,  644,  644,
      644,  636,  636,  636,  656,  660,  648,  648,  648,  648,
      636,  651,  651,  651,  651,  653,  653,  653,  653,  656,
      656,  656,  656,  656,  656,  656,  644,  644,  644,  636,
      636,  656,  648,  648,  653,  653,  656,  656,  656,  656,

      656,  656,  644,  644,  644,  656,  656,  656,  656,  656,
      644,  656,  656,  656,  656,  656,  656,  644,  656,  656,
      656,  656,  656,  644,  656,  656,  656,  656,  644,  656,
      656,  656,  656,  656,  656,    0,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636
    } ;

static yyconst short int yy_nxt[1679] =
    {   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,   47,   39,
       39,   48,   39,   49,   50,   51,   39,   52,   39,   39,
       39,   39,   53,   54,   55,   55,  635,   75,  132,   76,
       75,   56,   60,   77,  142,  142,  142,   57,   20,  110,
       91,   20,   20,  274,   20,  275,  110,   58,  111,  112,
      112,  133,   20,   20,   20,  111,  112,  112,  128,  634,
      128,  128,  158,  159,   39,  163,   39,   39,   39,   39,

       39,   39,  161,  162,   39,  165,   39,   39,   59,  633,
       39,  128,  129,  128,  128,   20,   20,   61,   62,   63,
       64,   62,   61,   65,   61,   66,   61,   67,   61,   68,
       61,   69,   70,   71,   71,   61,   61,   61,   61,   72,
       72,   72,   73,   73,   73,   73,   61,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   74,   72,   72,   72,   72,   72,   72,   61,
       61,   79,   80,  189,  632,   81,  132,  208,  148,   82,
      150,   83,  163,   84,   85,   86,   86,  113,  114,  115,
      113,  601,  165,   91,   87,   87,   87,   87,  602,  133,

      209,  111,  112,  112,  134,  135,  136,  137,  155,  142,
      142,  142,  163,  172,   88,   79,   80,  242,  243,   81,
       89,  163,  165,   82,  414,   83,  156,   84,   85,   86,
       86,  165,  415,   90,  113,  114,  115,  113,   87,   87,
       87,   87,  242,  243,  157,  171,  163,  167,  111,  112,
      112,  155,  142,  142,  142,  189,  165,  190,   88,   92,
      148,  631,  150,   93,  163,   94,  163,   95,   96,   97,
       97,  166,  166,  166,  165,  163,  165,  163,   98,   98,
       98,   98,  163,  132,  163,  165,  163,  165,  128,  168,
      128,  128,  165,  562,  165,  590,  165,  169,   99,   92,

      100,  630,  170,   93,  177,   94,  133,   95,   96,   97,
       97,  178,  175,  173,  163,  163,  174,  176,   98,   98,
       98,   98,  179,  163,  165,  165,  191,  192,  193,  191,
      163,  281,  281,  165,  191,  192,  193,  191,   99,   92,
      165,  180,  182,  102,  195,  103,  628,  104,  105,  106,
      106,  242,  243,  181,  242,  243,  184,  182,  107,  107,
      107,  107,  142,  142,  142,  201,  201,  201,  183,  225,
      627,  197,  277,  139,  198,  199,  278,  227,  108,   92,
      109,  306,  268,  102,  257,  103,  163,  104,  105,  106,
      106,  258,  155,  142,  142,  142,  165,  626,  107,  107,

      107,  107,  155,  142,  142,  142,  203,  192,  204,  203,
      156,  203,  192,  204,  203,  212,  212,  212,  108,  117,
      118,  322,  322,  119,  217,  217,  217,  120,  157,  121,
      132,  122,  123,  124,  124,  625,  214,  212,  212,  212,
      334,  334,  125,  125,  125,  125,  214,  212,  212,  212,
      142,  142,  142,  133,  215,  163,  155,  222,  222,  222,
      163,  623,  126,  117,  118,  165,  266,  119,  127,  267,
      165,  120,  216,  121,  156,  122,  123,  124,  124,  155,
      222,  222,  222,  223,  223,  223,  125,  125,  125,  125,
      622,  287,  157,  228,  228,  228,  230,  228,  228,  228,

      233,  233,  233,  621,  242,  249,  126,  144,  163,  145,
      259,  146,  250,  147,  148,  149,  150,  151,  165,  152,
      153,  154,  144,  568,  145,  593,  188,  620,  147,  148,
      149,  150,  151,  133,  152,  153,  154,  230,  228,  228,
      228,  236,  237,  242,  243,  132,  155,  142,  142,  142,
      155,  142,  142,  142,  619,  231,  238,  239,  240,  238,
      238,  239,  240,  238,  156,  242,  245,  208,  133,  246,
      242,  243,  318,  232,  242,  243,  260,  260,  260,  252,
      242,  243,  157,  251,  251,  251,  253,  251,  251,  251,
      209,  617,  247,  242,  243,  209,  242,  243,  261,  261,

      261,  262,  262,  262,  254,  253,  251,  251,  251,  256,
      256,  256,  263,  263,  263,  155,  142,  142,  142,  279,
      279,  279,  255,  163,  163,  163,  163,  280,  163,  616,
      285,  285,  285,  165,  165,  165,  165,  163,  165,  280,
      242,  243,  163,  163,  613,  163,  163,  165,  163,  612,
      286,  289,  165,  165,  290,  165,  165,  163,  165,  288,
      610,  163,  292,  291,  163,  163,  609,  165,  163,  163,
      295,  165,  242,  243,  165,  165,  293,  388,  165,  165,
      389,  294,  299,  296,  316,  316,  316,  297,  242,  243,
      298,  191,  192,  193,  191,  324,  324,  324,  300,  304,

      329,  329,  329,  302,  301,  303,  191,  192,  193,  191,
      203,  192,  204,  203,  203,  192,  204,  203,  214,  212,
      212,  212,  320,  320,  320,  155,  222,  222,  222,  225,
      321,  359,  360,  139,  336,  336,  336,  227,  230,  228,
      228,  228,  321,  323,  323,  323,  332,  332,  332,  236,
      323,  323,  608,  132,  333,  238,  239,  240,  238,  323,
      323,  323,  323,  323,  323,  607,  333,  335,  335,  335,
      238,  239,  240,  238,  335,  335,  133,  242,  245,  393,
      132,  246,  394,  335,  335,  335,  335,  335,  335,  242,
      245,  242,  245,  246,  208,  339,  163,  242,  249,  242,

      249,  242,  243,  133,  247,  250,  165,  250,  242,  243,
      398,  242,  243,  399,  242,  243,  247,  209,  247,  606,
      253,  251,  251,  251,  341,  341,  341,  343,  343,  242,
      243,  573,  342,  590,  242,  243,  242,  243,  281,  281,
      340,  260,  260,  260,  342,  242,  243,  345,  345,  345,
      261,  261,  261,  262,  262,  262,  322,  322,  344,  344,
      344,  263,  263,  263,  363,  344,  344,  364,  364,  364,
      334,  334,  347,  346,  344,  344,  344,  344,  344,  344,
      279,  279,  279,  163,  163,  163,  163,  163,  280,  163,
      600,  163,  163,  165,  165,  165,  165,  165,  163,  165,

      280,  165,  165,  403,  163,  599,  404,  163,  165,  598,
      369,  163,  163,  370,  165,  366,  368,  165,  367,  365,
      163,  165,  165,  163,  163,  371,  163,  163,  163,  372,
      165,  242,  243,  165,  165,  597,  165,  165,  165,  591,
      320,  320,  320,  163,  332,  332,  332,  375,  321,  373,
      374,  376,  333,  165,  377,  379,  378,  574,  391,  594,
      321,  392,  392,  392,  333,  401,  242,  243,  402,  402,
      402,  242,  245,  242,  243,  246,  242,  243,  242,  243,
      242,  243,  364,  364,  364,  163,  341,  341,  341,  242,
      243,  343,  343,  614,  342,  165,  569,  406,  247,  407,

      615,  163,  408,  408,  408,  163,  342,  364,  364,  364,
      409,  165,  425,  410,  163,  165,  163,  163,  163,  411,
      163,  163,  163,  163,  165,  163,  165,  165,  165,  163,
      165,  165,  165,  165,  426,  165,  592,  428,  591,  165,
      432,  450,  451,  427,  392,  392,  392,  392,  392,  392,
      563,  429,  430,  433,  431,  434,  242,  243,  436,  402,
      402,  402,  435,  402,  402,  402,  242,  243,  163,  242,
      243,  242,  243,  242,  243,  242,  243,  163,  165,  408,
      408,  408,  408,  408,  408,  473,  474,  165,  475,  163,
      163,  163,  163,  459,  163,  479,  163,  586,  476,  165,

      165,  165,  165,  163,  165,  163,  165,  460,  462,  461,
      585,  163,  163,  165,  584,  165,  242,  243,  242,  243,
      480,  165,  165,  242,  243,  484,  481,  485,  483,  482,
      242,  243,  510,  163,  487,  163,  486,  163,  522,  163,
      163,  163,  163,  165,  163,  165,  163,  165,  488,  165,
      165,  165,  165,  583,  165,  508,  165,  529,  529,  529,
      163,  507,  509,  538,  538,  538,  525,  582,  527,  523,
      165,  526,  532,  528,  532,  532,  545,  545,  545,  163,
      524,  242,  243,  242,  243,  242,  243,  242,  243,  165,
      581,  562,  580,  163,  163,  163,  163,  564,  242,  243,

      549,  549,  549,  165,  165,  165,  165,  563,  529,  529,
      529,  163,  532,  546,  532,  532,  547,  559,  548,  561,
      570,  165,  574,  575,  242,  243,  242,  243,  560,  573,
      596,  538,  538,  538,  545,  545,  545,  242,  243,  577,
      242,  243,  578,  163,  163,  242,  243,  579,  242,  243,
      577,  163,  595,  165,  165,  163,  572,  576,  549,  549,
      549,  165,  242,  243,  578,  165,  163,  563,  163,  242,
      243,  588,  242,  243,  163,  163,  165,  587,  165,  163,
      163,  163,  589,  562,  165,  165,  163,  163,  571,  165,
      165,  165,  604,  603,  569,  568,  165,  165,  567,  605,

      563,  562,  566,  565,  558,  557,  556,  555,  624,  554,
      553,  552,  629,  551,  550,  618,  544,  611,   78,   78,
       78,   78,   78,   78,   78,   78,   91,   91,   91,   91,
       91,   91,   91,   91,  101,  101,  101,  101,  101,  101,
      101,  101,  116,  116,  116,  116,  116,  116,  116,  116,
      131,  543,  131,  131,  131,  131,  131,  131,  139,  542,
      139,  139,  139,  139,  139,  139,  143,  143,  164,  164,
      164,  164,  164,  194,  194,  196,  541,  540,  196,  196,
      200,  539,  200,  200,  205,  537,  205,  205,  205,  205,
      205,  205,  207,  536,  207,  207,  207,  207,  207,  207,

      210,  535,  210,  210,  210,  210,  210,  210,  225,  225,
      534,  225,  225,  225,  225,  225,  226,  226,  226,  226,
      226,  226,  226,  226,  241,  241,  241,  241,  241,  241,
      241,  241,  244,  244,  244,  244,  244,  244,  244,  244,
      248,  248,  248,  248,  248,  248,  248,  248,  264,  533,
      264,  264,  282,  531,  282,  309,  309,  309,  309,  311,
      311,  312,  530,  312,  312,  384,  521,  384,  384,  520,
      519,  518,  517,  516,  515,  514,  513,  512,  511,  506,
      505,  504,  503,  502,  501,  500,  450,  499,  498,  497,
      496,  495,  494,  493,  492,  491,  490,  489,  478,  477,

      472,  471,  470,  469,  468,  467,  466,  465,  464,  463,
      458,  457,  456,  455,  454,  453,  452,  449,  448,  447,
      446,  445,  444,  443,  442,  441,  440,  439,  438,  437,
      424,  423,  422,  421,  420,  419,  418,  417,  416,  413,
      412,  405,  400,  397,  396,  395,  390,  387,  386,  385,
      310,  383,  382,  381,  380,  362,  361,  358,  357,  356,
      355,  354,  353,  352,  351,  350,  349,  348,  338,  337,
      331,  330,  328,  327,  326,  325,  319,  211,  317,  315,
      314,  313,  310,  308,  307,  305,  284,  283,  276,  273,
      272,  271,  270,  269,  268,  265,  140,  235,  234,  229,

      187,  224,  221,  140,  220,  219,  218,  213,  211,  206,
      187,  202,  140,  160,  187,  186,  185,  160,  141,  140,
      138,  130,  636,   19,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636
    } ;

static yyconst short int yy_chk[1679] =
    {   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,    2,    4,  633,    6,   25,    6,
        6,    2,    4,    6,   31,   31,   31,    2,    3,   13,
       13,    3,    3,  152,    3,  152,   14,    3,   13,   13,
       13,   25,    3,    3,    3,   14,   14,   14,   21,  631,
       21,   21,   36,   36,    3,   39,    3,    3,    3,    3,

        3,    3,   38,   38,    3,   39,    3,    3,    3,  630,
        3,   23,   23,   23,   23,    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,    7,    7,   58,  627,    7,   65,   81,   58,    7,
       58,    7,   45,    7,    7,    7,    7,   15,   15,   15,
       15,  586,   45,   15,    7,    7,    7,    7,  586,   65,

       81,   15,   15,   15,   27,   27,   27,   27,   34,   34,
       34,   34,   44,   45,    7,    8,    8,  116,  116,    8,
        8,   41,   44,    8,  351,    8,   34,    8,    8,    8,
        8,   41,  351,    8,   16,   16,   16,   16,    8,    8,
        8,    8,  118,  118,   34,   44,  164,   41,   16,   16,
       16,   35,   35,   35,   35,   60,  164,   60,    8,    9,
       60,  626,   60,    9,   40,    9,   42,    9,    9,    9,
        9,   40,   40,   40,   40,   43,   42,   48,    9,    9,
        9,    9,   46,   92,   47,   43,   49,   48,  128,   42,
      128,  128,   46,  562,   47,  562,   49,   42,    9,   10,

       10,  625,   43,   10,   48,   10,   92,   10,   10,   10,
       10,   48,   47,   46,   50,   59,   46,   47,   10,   10,
       10,   10,   49,   52,   50,   59,   62,   62,   62,   62,
       51,  156,  156,   52,   64,   64,   64,   64,   10,   11,
       51,   50,   59,   11,   69,   11,  623,   11,   11,   11,
       11,  126,  126,   51,  127,  127,   52,   51,   11,   11,
       11,   11,   68,   68,   68,   73,   73,   73,   51,  102,
      622,   69,  154,  102,   69,   69,  154,  102,   11,   12,
       12,  188,  188,   12,  126,   12,  175,   12,   12,   12,
       12,  127,   70,   70,   70,   70,  175,  621,   12,   12,

       12,   12,   71,   71,   71,   71,   75,   75,   75,   75,
       70,   76,   76,   76,   76,   83,   83,   83,   12,   17,
       17,  215,  215,   17,   87,   87,   87,   17,   70,   17,
      131,   17,   17,   17,   17,  620,   85,   85,   85,   85,
      231,  231,   17,   17,   17,   17,   86,   86,   86,   86,
       94,   94,   94,  131,   85,  285,   96,   96,   96,   96,
      168,  617,   17,   18,   18,  285,  145,   18,   18,  145,
      168,   18,   85,   18,   96,   18,   18,   18,   18,   97,
       97,   97,   97,   98,   98,   98,   18,   18,   18,   18,
      616,  168,   96,  103,  103,  103,  106,  106,  106,  106,

      107,  107,  107,  615,  120,  120,   18,   33,  289,   33,
      133,   33,  120,   33,   33,   33,   33,   33,  289,   33,
       33,   33,   56,  568,   56,  568,   56,  614,   56,   56,
       56,   56,   56,  133,   56,   56,   56,  105,  105,  105,
      105,  110,  110,  122,  122,  110,  111,  111,  111,  111,
      112,  112,  112,  112,  612,  105,  113,  113,  113,  113,
      115,  115,  115,  115,  111,  119,  119,  207,  110,  119,
      121,  121,  209,  105,  123,  123,  134,  134,  134,  122,
      241,  241,  111,  121,  121,  121,  123,  123,  123,  123,
      207,  610,  119,  124,  124,  209,  125,  125,  135,  135,

      135,  136,  136,  136,  123,  124,  124,  124,  124,  125,
      125,  125,  137,  137,  137,  142,  142,  142,  142,  155,
      155,  155,  123,  166,  167,  169,  170,  155,  172,  609,
      166,  166,  166,  166,  167,  169,  170,  171,  172,  155,
      243,  243,  173,  174,  607,  176,  177,  171,  179,  606,
      167,  170,  173,  174,  170,  176,  177,  178,  179,  169,
      602,  180,  172,  171,  181,  182,  601,  178,  184,  183,
      176,  180,  246,  246,  181,  182,  173,  317,  184,  183,
      317,  174,  179,  176,  201,  201,  201,  177,  250,  250,
      178,  191,  191,  191,  191,  217,  217,  217,  180,  184,

      223,  223,  223,  182,  181,  183,  193,  193,  193,  193,
      203,  203,  203,  203,  204,  204,  204,  204,  212,  212,
      212,  212,  214,  214,  214,  222,  222,  222,  222,  226,
      214,  276,  276,  226,  233,  233,  233,  226,  228,  228,
      228,  228,  214,  216,  216,  216,  230,  230,  230,  237,
      216,  216,  600,  237,  230,  238,  238,  238,  238,  216,
      216,  216,  216,  216,  216,  598,  230,  232,  232,  232,
      240,  240,  240,  240,  232,  232,  237,  244,  244,  325,
      259,  244,  325,  232,  232,  232,  232,  232,  232,  245,
      245,  247,  247,  245,  318,  247,  291,  248,  248,  249,

      249,  252,  252,  259,  244,  248,  291,  249,  251,  251,
      330,  253,  253,  330,  254,  254,  245,  318,  247,  597,
      251,  251,  251,  251,  253,  253,  253,  254,  254,  257,
      257,  573,  253,  573,  256,  256,  258,  258,  281,  281,
      252,  260,  260,  260,  253,  255,  255,  256,  256,  256,
      261,  261,  261,  262,  262,  262,  322,  322,  255,  255,
      255,  263,  263,  263,  280,  255,  255,  280,  280,  280,
      334,  334,  258,  257,  255,  255,  255,  255,  255,  255,
      279,  279,  279,  286,  287,  288,  290,  292,  279,  293,
      584,  294,  295,  286,  287,  288,  290,  292,  296,  293,

      279,  294,  295,  337,  297,  583,  337,  298,  296,  582,
      292,  299,  300,  293,  297,  287,  290,  298,  288,  286,
      301,  299,  300,  302,  365,  294,  303,  366,  304,  298,
      301,  345,  345,  302,  365,  581,  303,  366,  304,  575,
      320,  320,  320,  371,  332,  332,  332,  301,  320,  299,
      300,  302,  332,  371,  302,  304,  303,  574,  321,  570,
      320,  321,  321,  321,  332,  333,  340,  340,  333,  333,
      333,  339,  339,  341,  341,  339,  346,  346,  343,  343,
      347,  347,  363,  363,  363,  367,  341,  341,  341,  342,
      342,  343,  343,  608,  341,  367,  569,  340,  339,  342,

      608,  368,  342,  342,  342,  369,  341,  364,  364,  364,
      346,  368,  367,  346,  370,  369,  372,  375,  373,  347,
      374,  379,  425,  376,  370,  377,  372,  375,  373,  378,
      374,  379,  425,  376,  368,  377,  565,  370,  564,  378,
      375,  396,  396,  369,  391,  391,  391,  392,  392,  392,
      563,  372,  373,  376,  374,  377,  406,  406,  379,  401,
      401,  401,  378,  402,  402,  402,  407,  407,  426,  408,
      408,  409,  409,  410,  410,  411,  411,  427,  426,  407,
      407,  407,  408,  408,  408,  422,  422,  427,  422,  428,
      429,  430,  431,  406,  432,  426,  433,  557,  422,  428,

      429,  430,  431,  434,  432,  435,  433,  409,  411,  410,
      556,  436,  479,  434,  555,  435,  459,  459,  460,  460,
      428,  436,  479,  461,  461,  432,  429,  433,  431,  430,
      462,  462,  462,  480,  435,  481,  434,  482,  479,  483,
      484,  485,  487,  480,  488,  481,  486,  482,  436,  483,
      484,  485,  487,  554,  488,  460,  486,  489,  489,  489,
      522,  459,  461,  499,  499,  499,  483,  552,  485,  481,
      522,  484,  493,  486,  493,  493,  506,  506,  506,  523,
      482,  507,  507,  508,  508,  509,  509,  510,  510,  523,
      551,  527,  550,  524,  526,  527,  525,  529,  576,  576,

      510,  510,  510,  524,  526,  527,  525,  528,  529,  529,
      529,  528,  532,  507,  532,  532,  508,  523,  509,  525,
      538,  528,  544,  545,  546,  546,  579,  579,  524,  543,
      579,  538,  538,  538,  545,  545,  545,  547,  547,  547,
      548,  548,  548,  559,  560,  549,  549,  549,  577,  577,
      577,  561,  577,  559,  560,  587,  542,  546,  549,  549,
      549,  561,  578,  578,  578,  587,  588,  541,  589,  595,
      595,  560,  596,  596,  603,  604,  588,  559,  589,  605,
      611,  618,  561,  540,  603,  604,  624,  629,  539,  605,
      611,  618,  588,  587,  537,  536,  624,  629,  535,  589,

      534,  533,  531,  530,  519,  518,  517,  516,  618,  515,
      514,  513,  624,  512,  511,  611,  505,  603,  637,  637,
      637,  637,  637,  637,  637,  637,  638,  638,  638,  638,
      638,  638,  638,  638,  639,  639,  639,  639,  639,  639,
      639,  639,  640,  640,  640,  640,  640,  640,  640,  640,
      641,  504,  641,  641,  641,  641,  641,  641,  642,  503,
      642,  642,  642,  642,  642,  642,  643,  643,  644,  644,
      644,  644,  644,  645,  645,  646,  502,  501,  646,  646,
      647,  500,  647,  647,  648,  498,  648,  648,  648,  648,
      648,  648,  649,  497,  649,  649,  649,  649,  649,  649,

      650,  496,  650,  650,  650,  650,  650,  650,  651,  651,
      495,  651,  651,  651,  651,  651,  652,  652,  652,  652,
      652,  652,  652,  652,  653,  653,  653,  653,  653,  653,
      653,  653,  654,  654,  654,  654,  654,  654,  654,  654,
      655,  655,  655,  655,  655,  655,  655,  655,  656,  494,
      656,  656,  657,  492,  657,  658,  658,  658,  658,  659,
      659,  660,  491,  660,  660,  661,  478,  661,  661,  477,
      476,  475,  474,  473,  471,  468,  467,  466,  465,  458,
      457,  456,  455,  454,  453,  452,  451,  449,  448,  447,
      446,  445,  444,  443,  442,  439,  438,  437,  424,  423,

      421,  420,  419,  418,  417,  416,  415,  414,  413,  412,
      405,  404,  403,  400,  399,  398,  397,  395,  394,  393,
      390,  389,  388,  387,  386,  385,  383,  382,  381,  380,
      360,  359,  358,  357,  356,  355,  354,  353,  352,  350,
      349,  338,  331,  328,  327,  326,  319,  315,  314,  313,
      309,  308,  307,  306,  305,  278,  277,  275,  274,  273,
      272,  271,  270,  269,  268,  267,  266,  265,  235,  234,
      229,  224,  221,  220,  219,  218,  213,  210,  202,  199,
      198,  197,  194,  190,  189,  187,  163,  162,  153,  151,
      150,  149,  148,  147,  146,  144,  139,  109,  108,  104,

      100,   99,   95,   93,   90,   89,   88,   84,   82,   80,
       77,   74,   67,   57,   55,   54,   53,   37,   30,   29,
       28,   24,   19,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636,  636,  636,
      636,  636,  636,  636,  636,  636,  636,  636
    } ;

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.l"
#define INITIAL 0
#line 2 "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 */
};

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 emit 1

#define macro 2

#define pod 3

#define cmt1 4

#define cmt2 5

#define cmt3 6

#define cmt4 7

#define cmt5 8

#line 1038 "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 105 "imcc.l"

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

#line 1207 "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 >= 637 )
					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] != 1624 );

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 119 "imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt2);
                       valp->t = atoi(yytext+6);
                       return LINECOMMENT;
               }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 123 "imcc.l"
{ BEGIN(cmt3);
                      valp->s = str_dup(yytext);
                      return FILECOMMENT;
               }
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 127 "imcc.l"
{ BEGIN(prev_state) ; line++; }
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 129 "imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt2); }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 130 "imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt1); }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 131 "imcc.l"
{
                       valp->t = atoi(yytext);
                       BEGIN(cmt4);
                       return LINECOMMENT;
               }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 136 "imcc.l"
{ BEGIN(prev_state) ; line++; }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 138 "imcc.l"
{
        if (expect_pasm == 2)
	  BEGIN(INITIAL);
        expect_pasm = 0;
        line++;
        return '\n';
    }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 146 "imcc.l"
{ prev_state = YYSTATE; BEGIN(cmt5); }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 147 "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 158 "imcc.l"
{
	BEGIN(emit);
	return(EMIT);
    }
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 163 "imcc.l"
{
	BEGIN(INITIAL);
	return EOM;
    }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 168 "imcc.l"
{
	valp->s = str_dup(yytext);
	return REG;
	}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 173 "imcc.l"
{ in_pod = 1; BEGIN(pod); }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 174 "imcc.l"
{ in_pod = 0; BEGIN(INITIAL); }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 175 "imcc.l"
{ /*ignore*/ }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 176 "imcc.l"
{ ++line; }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 178 "imcc.l"
return(LOCAL);
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 179 "imcc.l"
return(ARG);
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 180 "imcc.l"
return(SUB);
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 181 "imcc.l"
return(ESUB);
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 182 "imcc.l"
return(PCC_BEGIN);
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 183 "imcc.l"
return(PCC_END);
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 184 "imcc.l"
return(PCC_CALL);
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 185 "imcc.l"
return(PCC_SUB);
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 186 "imcc.l"
return(PCC_BEGIN_RETURN);
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 187 "imcc.l"
return(PCC_END_RETURN);
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 188 "imcc.l"
return(PCC_BEGIN_YIELD);
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 189 "imcc.l"
return(PCC_END_YIELD);
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 190 "imcc.l"
return PROTOTYPED;
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 191 "imcc.l"
return NON_PROTOTYPED;
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 193 "imcc.l"
return(RESULT);
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 194 "imcc.l"
return(RETURN);
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 195 "imcc.l"
return(CLASS);
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 196 "imcc.l"
return(ENDCLASS);
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 197 "imcc.l"
return(NAMESPACE);
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 198 "imcc.l"
return(ENDNAMESPACE);
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 199 "imcc.l"
return(LOCAL);
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 200 "imcc.l"
return(CONST);
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 201 "imcc.l"
return(GLOBAL_CONST);
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 202 "imcc.l"
return(PARAM);
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 203 "imcc.l"
return(END);
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 204 "imcc.l"
return(GOTO);
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 205 "imcc.l"
return(IF);
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 206 "imcc.l"
return(UNLESS);
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 207 "imcc.l"
return(INTV);
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 208 "imcc.l"
return(INC);
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 209 "imcc.l"
return(DEC);
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 210 "imcc.l"
return(FLOATV);
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 211 "imcc.l"
return(NEW);
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 212 "imcc.l"
return(DEFINED);
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 213 "imcc.l"
return(ADDR);
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 214 "imcc.l"
return(GLOBAL);
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 215 "imcc.l"
return(CLONE);
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 216 "imcc.l"
return(STRINGV);
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 217 "imcc.l"
return(CALL);
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 218 "imcc.l"
return(SAVEALL);
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 219 "imcc.l"
return(RESTOREALL);
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 220 "imcc.l"
return(SHIFT_LEFT);
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 221 "imcc.l"
return(SHIFT_RIGHT);
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 222 "imcc.l"
return(SHIFT_RIGHT_U);
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 223 "imcc.l"
return(LOG_AND);
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 224 "imcc.l"
return(LOG_OR);
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 225 "imcc.l"
return(LOG_XOR);
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 226 "imcc.l"
return(RELOP_LT);
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 227 "imcc.l"
return(RELOP_LTE);
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 228 "imcc.l"
return(RELOP_GT);
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 229 "imcc.l"
return(RELOP_GTE);
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 230 "imcc.l"
return(RELOP_EQ);
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 231 "imcc.l"
return(RELOP_NE);
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 232 "imcc.l"
return(POW);
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 234 "imcc.l"
{
        return read_macro(valp, interp);
    }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 238 "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 74:
YY_RULE_SETUP
#line 266 "imcc.l"
{
        int c;

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

	YYCHOP();
	include_file(str_dup(yytext + 1));
    }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 276 "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 76:
YY_RULE_SETUP
#line 292 "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 77:
YY_RULE_SETUP
#line 307 "imcc.l"
return(COMMA);
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 309 "imcc.l"
{
	YYCHOP();  /* trim last ':' */
	DUP_AND_RET(valp,LABEL);
    }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 314 "imcc.l"
{
        int type = Parrot_get_pmc_num(interp, yytext+1);

        if (type) {
            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'\n", yytext);
    }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 327 "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 81:
YY_RULE_SETUP
#line 339 "imcc.l"
DUP_AND_RET(valp, FLOATC);
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 340 "imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 341 "imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 342 "imcc.l"
DUP_AND_RET(valp, INTC);
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 344 "imcc.l"
{
	valp->s = str_dup(yytext);
        return(STRINGC); /* XXX delete quotes, -> emit, pbc */
    }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 349 "imcc.l"
{
        valp->s = str_dup(yytext); /* XXX delete quotes, -> emit, pbc */
        return(STRINGC);
    }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 354 "imcc.l"
DUP_AND_RET(valp, IREG);
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 355 "imcc.l"
DUP_AND_RET(valp, NREG);
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 356 "imcc.l"
DUP_AND_RET(valp, SREG);
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 357 "imcc.l"
DUP_AND_RET(valp, PREG);
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 359 "imcc.l"
/* skip */;
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 361 "imcc.l"
{
        return yytext[0];
    }
	YY_BREAK
case YY_STATE_EOF(emit):
#line 365 "imcc.l"
{
        BEGIN (INITIAL);
        if (pasm_file) {
            pasm_file = 2;
            return EOM;
        }
        return 0;
    }
	YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 374 "imcc.l"
yyterminate();
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 376 "imcc.l"
DUP_AND_RET(valp, ENDM);
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 378 "imcc.l"
{
        line++;
        DUP_AND_RET(valp, '\n');
    }
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 383 "imcc.l"
return LABEL;
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 384 "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 97:
YY_RULE_SETUP
#line 403 "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 98:
YY_RULE_SETUP
#line 417 "imcc.l"
/* skip leading ws */;
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 418 "imcc.l"
DUP_AND_RET(valp, ' ');
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 419 "imcc.l"
DUP_AND_RET(valp, IDENTIFIER);
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 420 "imcc.l"
DUP_AND_RET(valp, MACRO);
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 421 "imcc.l"
DUP_AND_RET(valp, yytext[0]);
	YY_BREAK
case YY_STATE_EOF(macro):
#line 422 "imcc.l"
yyterminate();
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 424 "imcc.l"
ECHO;
	YY_BREAK
#line 1985 "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 >= 637 )
				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 >= 637 )
			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 == 636);

	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 424 "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');

    DUP_AND_RET(valp, 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 == ',') {
	    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;

    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) {
	/* 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 parameters",
                        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, frame->expansion.num_param, m->params.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();
    sourcefile = file_name;

    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");
        sourcefile = s;
        /* free(s); FIXME leak */
    }
    if (!file)
        fataly(EX_SOFTWARE, file_name, line, strerror(errno));
    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(void)
{
    struct macro_frame_t *f;

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