#line 2 "pirlexer.c"
#line 2 "pir.l"

/* ex: set ro ft=c:
 * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
 *
 * This file is generated automatically by the Parrot build process
 * from the file compilers/pirc/new/pir.l.
 *
 * Any changes made here will be lost!
 *
*/

/* HEADERIZER HFILE: none */
/* HEADERIZER STOP */

#ifndef __STDC_VERSION__
#  define __STDC_VERSION__ 0
#endif

#ifndef YY_NO_UNISTD_H
#  define YY_NO_UNISTD_H
#endif

/* prevent warnings on undefined #defines: */
#ifndef YY_MAIN
#  define YY_MAIN 0
#endif

#ifndef YY_ALWAYS_INTERACTIVE
#  define YY_ALWAYS_INTERACTIVE 0
#endif

#include <stdlib.h> /* for size_t */
typedef size_t yy_size_t;
#define YY_TYPEDEF_YY_SIZE_T




#line 42 "pirlexer.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

/* %not-for-header */

/* %if-c-only */
/* %if-not-reentrant */
/* %endif */
/* %endif */
/* %ok-for-header */

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

/* %if-c++-only */
/* %endif */

/* %if-c-only */
    
/* %endif */

/* %if-c-only */

/* %endif */

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

/* begin standard C headers. */
/* %if-c-only */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* %endif */

/* %if-tables-serialization */
/* %endif */
/* end standard C headers. */

/* %if-c-or-c++ */
/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 * if you want the limit (max/min) macros for int types. 
 */
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif

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

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

#endif /* ! FLEXINT_H */

/* %endif */

/* %if-c++-only */
/* %endif */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)

#define YY_USE_CONST

#endif	/* defined (__STDC__) */
#endif	/* ! __cplusplus */

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

/* %not-for-header */

/* Returned upon end-of-file. */
#define YY_NULL 0
/* %ok-for-header */

/* %not-for-header */

/* 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)
/* %ok-for-header */

/* %if-reentrant */

/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
#define YY_TYPEDEF_YY_SCANNER_T
typedef void* yyscan_t;
#endif

/* For convenience, these vars (plus the bison vars far below)
   are macros in the reentrant scanner. */
#define yyin yyg->yyin_r
#define yyout yyg->yyout_r
#define yyextra yyg->yyextra_r
#define yyleng yyg->yyleng_r
#define yytext yyg->yytext_r
#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
#define yy_flex_debug yyg->yy_flex_debug_r

/* %endif */

/* %if-not-reentrant */
/* %endif */

/* 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 yyg->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 ((yyg->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 yypirrestart(yyin ,yyscanner )

#define YY_END_OF_BUFFER_CHAR 0

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

/* The state buf must be large enough to hold one state per character in the main buffer.
 */
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

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

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

/* %if-not-reentrant */
/* %endif */

/* %if-c-only */
/* %if-not-reentrant */
/* %endif */
/* %endif */

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

    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
     *       access to the local variable yy_act. Since yyless() is a macro, it would break
     *       existing scanners that call yyless() from OUTSIDE yypirlex. 
     *       One obvious solution it to make yy_act a global. I tried that, and saw
     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
     *       normally declared as a register variable-- so it is not worth it.
     */
    #define  YY_LESS_LINENO(n) \
            do { \
                int yyl;\
                for ( yyl = n; yyl < yyleng; ++yyl )\
                    if ( yytext[yyl] == '\n' )\
                        --yylineno;\
            }while(0)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = yyg->yy_hold_char; \
		YY_RESTORE_YY_MORE_OFFSET \
		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
	{
/* %if-c-only */
	FILE *yy_input_file;
/* %endif */

/* %if-c++-only */
/* %endif */

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

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

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

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

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */
    
	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;

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

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */

/* %if-not-reentrant */
/* %endif */
/* %ok-for-header */

/* %endif */

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 *
 * Returns the top of the stack, or NULL.
 */
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
                          : NULL)

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

/* %if-c-only Standard (non-C++) definition */

/* %if-not-reentrant */
/* %not-for-header */

/* %ok-for-header */

/* %endif */

void yypirrestart (FILE *input_file ,yyscan_t yyscanner );
void yypir_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
YY_BUFFER_STATE yypir_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
void yypir_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void yypir_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
void yypirpush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
void yypirpop_buffer_state (yyscan_t yyscanner );

static void yypirensure_buffer_stack (yyscan_t yyscanner );
static void yypir_load_buffer_state (yyscan_t yyscanner );
static void yypir_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );

#define YY_FLUSH_BUFFER yypir_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)

YY_BUFFER_STATE yypir_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE yypir_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE yypir_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );

/* %endif */

void *yypiralloc (yy_size_t ,yyscan_t yyscanner );
void *yypirrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void yypirfree (void * ,yyscan_t yyscanner );

#define yy_new_buffer yypir_create_buffer

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

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

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */

#define yypirwrap(n) 1
#define YY_SKIP_YYWRAP

#define FLEX_DEBUG

typedef unsigned char YY_CHAR;

typedef int yy_state_type;

#define yytext_ptr yytext_r

/* %if-c-only Standard (non-C++) definition */

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

/* %endif */

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	yyg->yytext_ptr = yy_bp; \
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
	yyleng = (size_t) (yy_cp - yy_bp); \
	yyg->yy_hold_char = *yy_cp; \
	*yy_cp = '\0'; \
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
	yyg->yy_c_buf_p = yy_cp;

/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
#define YY_NUM_RULES 209
#define YY_END_OF_BUFFER 210
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static yyconst flex_int16_t yy_accept[825] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,  210,  129,    2,    4,    2,   25,
      129,  129,  129,   22,  129,  129,   28,   29,   23,   21,
       30,   27,  129,   24,  122,  122,  129,   35,   15,   34,
       16,  120,  120,   31,   32,  120,  120,  120,  120,  120,
      120,  129,   26,  209,  136,  141,  136,  138,  139,  140,
      137,  175,  173,  175,  175,  167,  165,  166,  165,  167,
      161,  161,  161,  161,  161,  170,  209,  209,  209,  154,
      146,  153,  146,  154,  154,  154,  148,  149,  154,  147,

      154,  150,  150,  144,  151,  152,  134,  133,  134,  134,
      134,  134,  134,  132,  132,  131,  129,  129,  120,  120,
      120,  120,  120,  120,  120,  120,  209,  209,  209,  209,
      150,  150,    1,  208,  206,  207,  206,  208,  208,  208,
      208,  176,  208,  201,  201,  208,  199,  199,  199,  199,
      199,  177,  178,    0,    4,    4,   12,    0,  110,    0,
        0,    3,    0,    0,    0,    0,    0,   40,   18,   43,
        0,  111,    0,   39,    0,  122,   36,   37,  126,  121,
       46,  126,  126,  142,  126,  126,  126,  126,  126,  126,
      126,  126,  126,  126,  126,  126,  126,  126,  126,   17,

       38,  121,    0,    0,    0,    0,  109,  109,  109,  109,
      109,  109,  109,  109,  109,  109,  109,  109,    9,   13,
       11,   10,   14,    8,    0,  120,  118,  119,  120,   47,
      120,  120,  120,  120,  120,   42,   19,   45,   20,  141,
      141,  137,  173,  173,    0,    0,    0,  166,  166,  162,
      161,  161,  161,  161,  161,  170,  170,    0,    0,  169,
      153,  153,    0,  150,    0,    0,    0,    0,  150,  150,
      143,  150,    0,    0,    0,    0,  144,    0,  132,    0,
        0,    0,    0,  132,  132,  132,    0,    0,    0,    0,
      131,    0,    0,    0,    0,    0,  126,  120,  128,  119,

      120,   47,  120,  120,  120,  120,  120,  207,  207,    0,
      205,    0,    0,    0,    0,  201,  200,  192,  192,  192,
      192,  192,  192,  200,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  199,  193,  197,  196,  195,  198,  127,
       33,    3,  117,  116,  114,  115,   41,    0,  142,  142,
      142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
      142,  142,  142,  142,  142,  142,  142,  142,  142,  142,
      142,  142,   44,  121,  124,    0,  121,  125,  123,  109,
      109,  109,  109,  109,  109,  109,  109,  109,  109,  109,
      109,  109,  109,  109,  109,  109,  109,  109,    7,    6,

        0,    0,    0,  120,   51,  120,   52,   53,  120,  120,
        0,    0,    0,  162,  157,  159,  158,  161,  145,    0,
      143,  150,  150,    0,  150,  150,  150,  132,    0,  132,
      132,    0,  132,  132,  132,    0,  164,  117,  116,  114,
      115,  163,  171,  120,   51,  120,   52,   53,  120,  120,
      194,    0,  192,  192,  192,  192,  192,  192,  192,  200,
      203,    0,  200,  204,  202,    0,    0,    0,    0,    0,
        0,    0,  121,   62,  142,  142,  142,  142,   58,  142,
      142,  142,  142,   64,  142,  142,  142,  142,  142,  142,
      142,  142,  142,  142,   81,  142,  142,  109,  109,  109,

      109,  109,  109,   94,  109,  109,  109,  109,  109,  109,
      109,  109,  109,  109,  109,  109,  109,  109,    5,    0,
      112,    0,    0,    0,   48,   50,  120,  120,    0,    0,
        0,  161,    0,  150,    0,  132,  172,  163,   48,   50,
      120,  120,    0,  200,  192,  186,  192,  192,  192,  192,
        0,    0,    0,    0,    0,    0,  142,  142,   75,  142,
      142,   86,   59,  142,  142,  142,   65,  142,  142,  142,
      142,  142,  142,  142,  142,  142,  142,  142,   87,  106,
      109,   88,  109,  109,   89,  109,   92,  109,  109,  109,
      109,  109,  109,  109,  109,  109,  109,  109,  109,    0,

      120,  120,  174,    0,    0,  161,  120,  120,  191,  190,
      192,  192,  192,  182,    0,  181,  180,  179,    0,  142,
      142,   57,  142,  142,  142,  142,  142,  142,  142,   67,
      135,  142,  142,  142,   71,  142,  142,  142,  142,  142,
       82,  109,  109,  109,  109,  109,   97,  105,  109,  109,
      109,   95,  109,  109,   98,  109,  109,    0,  113,    0,
       54,   49,  155,    0,  160,   54,   49,  188,  192,  192,
        0,    0,  142,  142,  142,  142,  142,  142,  142,  142,
      142,  142,  142,  142,  142,   80,  142,  142,  142,  142,
      109,  109,  109,  109,   93,  109,  109,  109,  109,  104,

      109,   96,    0,  192,  192,  192,    0,    0,  142,  142,
      142,  142,  142,  142,  142,  142,  142,  142,   66,  142,
      142,  142,  142,  142,   56,  142,  142,  142,  109,  109,
      109,  109,  100,  109,  109,  109,  109,    0,  192,  192,
      185,    0,    0,   55,  142,  142,  142,   76,  142,  142,
      142,  142,   63,  142,  142,  142,  142,  142,   70,  142,
      142,   85,  109,  109,  107,  109,  103,  102,   90,  109,
        0,    0,  192,  192,    0,  183,  142,  142,  142,  142,
       78,  142,  142,  142,  142,  142,   68,   69,  142,   84,
       91,  109,  108,  109,    0,    0,  192,  187,  184,   72,

      142,  142,   77,   79,  142,  142,  142,  142,   83,   99,
      101,    0,    0,  192,  142,   74,   60,   61,  130,  168,
      156,  189,   73,    0
    } ;

static yyconst flex_int32_t yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    4,    5,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    4,    1,    1,    1,    1,
        1,    2,    6,    7,    8,    9,   10,   11,   12,   13,
       14,   15,   16,   17,   18,   19,   20,   21,   22,   23,
       23,   23,   23,   23,   23,   24,   24,   25,   26,   27,
       28,   29,    1,   30,   31,   32,   31,   31,   33,   31,
       34,   35,   36,   34,   34,   37,   34,   38,   39,   40,
       34,   34,   41,   34,   34,   34,   42,   43,   34,   34,
       44,   45,   46,    1,   47,    1,   48,   49,   50,   51,

       52,   53,   54,   55,   56,   34,   57,   58,   59,   60,
       61,   62,   63,   64,   65,   66,   67,   68,   34,   69,
       70,   34,   71,   72,   73,   74,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

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

static yyconst flex_int32_t yy_meta[75] =
    {   0,
        1,    1,    2,    1,    1,    1,    3,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    4,    1,    1,
        5,    5,    5,    5,    6,    1,    1,    1,    1,    7,
        8,    8,    8,    9,    9,    9,    9,    9,    9,    9,
       10,   10,    9,    1,    1,    1,    9,    8,    8,    8,
        8,    8,    8,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
       11,    1,   11,    1
    } ;

static yyconst flex_int16_t yy_base[885] =
    {   0,
        0,    0,   74,    0,  146,  147,  166,    0,  240,    0,
      314,    0,  388,    0,    0,    0,  462,    0,  530,  543,
        0,    0,  567,    0, 2392, 2393, 2372,  151,  537, 2362,
      635,  152,  122, 2361,  530, 2376, 2393, 2393,  529,  624,
     2393,  632,  674,  519,  726,  640,  723, 2393,  622,  629,
      637,  520,  653, 2393, 2393,  728,  739,  736,  737,  654,
      738,  616,  723, 2393, 2393,  665, 2384, 2393, 2393, 2393,
        0, 2393,  682, 2383,  641, 2393, 2393,  765, 2382,    0,
        0, 2324, 2316, 2323, 2315,  799, 2377,    0, 2354, 2393,
     2393,  803, 2375,  765,  771, 2365, 2393, 2393,  794, 2393,

      798,  804,  811,    0, 2393, 2393, 2393, 2393,  779,  810,
     2364,  836,  817,  855,  847,    0,  845, 2366,  664,  887,
      866,  872,  888,  901,  903,  904,  786, 2362,  916,  920,
        0,  926, 2393, 2393, 2393,  859, 2370,  807,  916, 2360,
      944, 2393,  949,  993,  958,  927, 2346,  971,  976,  997,
     1006, 2393, 2393,  699,  890,  898, 2393,  822, 2393,    0,
      156, 1001,  948, 1016, 1025, 1029, 1034, 2393, 2393, 2393,
     2358, 2393, 2341, 2393, 1042, 1048, 2393, 2393, 2393, 1052,
     2393,    0, 2331,    0, 2307, 2314,  712, 2305, 2308,  722,
     2303,  793,  910,  926, 2314, 2309,  863, 2312, 2303, 2330,

     2393, 1056,  669, 1070, 1012,    0,    0, 2297, 2298,  659,
      862, 1035,  495, 1028, 2294,  946, 2294, 2287, 2393, 2393,
     2393, 2393, 2393,  959, 2327,  857, 2344, 1088, 1078, 1043,
     1080, 1089, 1099, 1097, 1098, 2393, 2393, 2393, 2393, 1116,
     1123,    0, 1127, 1131, 2290, 2288, 2300, 1135, 1140,    0,
        0, 2281, 2287, 2295, 2280, 1148, 1152, 2318, 2317, 2393,
     1157, 1161,  939, 2393,    0, 1146, 2329, 1150, 1156, 1160,
        0, 1164, 1002, 1178, 1169,    0,    0, 1037, 2393,    0,
     1182, 2328, 1196, 1202, 1206, 1210, 1038, 1224, 1188,    0,
        0, 2309, 1229, 1242, 1246, 1256,    0, 1219, 2313, 1266,

     1267, 1275, 1276, 1277, 1290, 1286, 1294, 1320, 1324, 1090,
     2393,    0, 1322, 2325, 1332, 1338, 1342,    0, 2280, 1075,
     2287, 2286, 2283, 1346, 1192, 1360, 1234,    0, 2272, 1201,
     2270, 2282, 2268, 2303, 2393, 1364, 1378, 1383, 1388, 2393,
     2393, 1269, 1393, 1397, 1401, 1405, 2393, 1414,    0, 2290,
     2266, 2271, 2266, 2263, 2271, 2263, 2254, 2258, 2250, 2248,
     2256,  993, 2265, 2248, 2254, 2256, 2247, 2244, 2243, 2259,
     2251, 2254, 2393, 1418, 1260, 1422, 1426, 1309,    0,    0,
     2244, 2256, 2244, 1253, 2233, 1091, 2245, 2234, 2241, 2239,
     2245, 2230, 2229, 2229, 2226, 2243, 2235, 2242, 2393, 2261,

     2281, 1113, 2262, 1316, 1197, 1333, 1285, 1355, 1434, 1435,
     2235, 2235, 2234,    0,    0,    0,    0, 2227, 1433, 1445,
        0, 1450, 1277, 1454, 1458, 1316,    0, 1470, 1482, 1486,
     1292, 1490, 1494, 1326,    0, 2252, 2256, 1499, 1503, 1513,
     1518,    0, 2393, 1471, 1526, 1527, 1528, 1529, 1537, 1543,
     1542, 1553,    0, 2222, 2210, 2218, 2227, 2217, 2225, 1557,
     1371, 1565, 1575, 1374,    0, 2213, 2214, 2216, 2223, 2214,
     2204, 1579, 1583,    0, 2207, 2211, 2208, 2200, 1148, 2212,
     2216, 2213, 2200,    0, 2208, 2208, 2210, 2193, 2201, 2203,
     2207, 2205, 2185, 2204,    0, 2192, 2191, 2188, 2181, 2194,

     2179, 2178, 2182,    0, 2191, 2184, 2180, 2184, 2172, 2185,
     2176, 1439, 2183, 2168, 2169, 2176, 2168, 2181, 2393, 1191,
     2393,    0, 2204, 2221, 1440, 1566, 1590, 1592, 2168, 2178,
     2161, 2164, 1590, 1597, 1601, 1605, 2393,    0, 1612, 1613,
     1614, 1615, 1625, 1630, 2171,    0, 2170, 2157, 2168, 2172,
     2158, 2165, 2150, 2164, 2154, 2147, 2146, 2151,    0, 2144,
     1591,    0,    0, 2145, 2160, 2157,    0, 2148, 2147, 2143,
     2156, 2137, 2151, 2141, 2135, 1608, 2148, 2146,    0,    0,
     2145,    0, 2147, 2144,    0, 2145,    0, 2131, 2135, 2139,
     2123, 2135, 2126, 2122, 2135, 2122, 2132, 2115, 2123, 1628,

     1640, 1641, 2393, 2122, 2118, 2124, 1645, 1646,    0,    0,
     2116, 2111, 2110, 2393, 2123, 2393, 2393, 2393, 2123, 2124,
     2124,    0, 2122, 2117, 2112, 2115, 2108, 2108, 2095,    0,
     2103, 2095, 2076, 2077,    0, 2060, 2052, 2063, 2054, 2061,
        0, 2042, 2027, 2023, 2011, 2014,    0,    0, 1998, 2003,
     1990,    0, 1978, 1964,    0, 1981, 1978, 1653, 2393,    0,
     1644, 1659, 2393, 1982,    0, 1661, 1663, 1977, 1961, 1951,
     1956, 1950, 1940, 1632, 1947, 1934, 1947, 1929, 1943, 1932,
     1942, 1225, 1938, 1931, 1914,    0, 1917, 1902, 1915, 1904,
     1913, 1900, 1868, 1862,    0, 1838, 1859, 1848, 1826,    0,

     1823,    0, 1811, 1808, 1799, 1793, 1793, 1777, 1783, 1776,
     1761, 1752, 1741, 1731, 1732, 1722, 1723, 1702,    0, 1685,
     1436, 1652, 1659, 1650,    0, 1640, 1647, 1646, 1637, 1649,
     1634, 1649,    0, 1641, 1634, 1628, 1625, 1522, 1626, 1635,
        0, 1617, 1606,    0, 1609, 1570, 1582,    0, 1552, 1543,
     1534, 1522,    0, 1512, 1511, 1500, 1491, 1479,    0, 1466,
     1477,    0, 1447, 1427,    0, 1434,    0,    0,    0, 1412,
     1413, 1384, 1373, 1379, 1322, 2393, 1314, 1261, 1259, 1181,
        0, 1172, 1111, 1100, 1089, 1053,    0,    0, 1039,    0,
        0, 1031,    0,  936,  909,  888,  855,    0, 2393,    0,

      825,  821,    0,  777,  734,  728,  719,  708,    0,    0,
        0,  694,  611,  497,  104,    0,    0,    0,    0, 2393,
     2393,    0,    0, 2393, 1711, 1722, 1733, 1744, 1755, 1766,
     1770, 1777, 1783, 1786, 1792, 1795, 1801, 1811, 1822, 1829,
     1835, 1845, 1856, 1863, 1866, 1873, 1883, 1894, 1901, 1907,
     1917, 1926, 1937, 1948, 1955, 1961, 1965, 1972, 1979, 1987,
     1993, 1999, 2005, 2011, 2017, 2023, 2027, 2037, 2048, 2055,
     2059, 2065, 2068, 2075, 2085, 2096, 2103, 2109, 2113, 2123,
     2131, 2138, 2144, 2154
    } ;

static yyconst flex_int16_t yy_def[885] =
    {   0,
      824,    1,  824,    3,  825,  825,  824,    7,  824,    9,
      824,   11,  824,   13,    1,    1,  824,   17,  826,  826,
      827,  827,  824,   23,  824,  824,  824,  824,  824,  824,
      828,  829,  824,  824,  824,  830,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  831,  824,  824,  824,
      824,  832,  832,  824,  824,  832,  832,  832,  832,  832,
      832,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      833,  824,  824,  824,  824,  824,  824,  824,  824,  834,
      835,  835,  835,  835,  835,  824,  824,  836,  837,  824,
      824,  824,  824,  838,  824,  839,  824,  824,  824,  824,

      840,  824,  824,  841,  824,  824,  824,  824,  842,  824,
      843,  824,  824,  824,  824,  844,  845,   43,  846,  846,
      846,  846,  846,  846,  846,  846,  838,  839,  824,  824,
      102,  824,  824,  824,  824,  824,  824,  847,  824,  848,
      824,  824,  849,  824,  824,  824,  850,  850,  850,  850,
      850,  824,  824,  851,  824,  824,  824,  852,  824,  852,
      853,  824,  853,  824,  824,  824,  824,  824,  824,  824,
      854,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  824,

      824,  824,  824,  824,  824,  856,  857,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  824,  824,
      824,  824,  824,  824,  858,  859,  860,  859,  859,  859,
      859,  859,  859,  859,  859,  824,  824,  824,  824,  824,
      824,  861,  824,  824,  824,  824,  824,  824,  824,  862,
      863,  863,  863,  863,  863,  824,  824,  864,  864,  824,
      824,  824,  838,  824,  838,  824,  839,  824,  824,  824,
      865,  824,  824,  824,  824,  866,  867,  868,  824,  868,
      824,  869,  824,  824,  824,  824,  824,  824,  824,  870,
      871,  872,  872,  872,  872,  872,  873,  874,  824,  874,

      874,  874,  874,  874,  874,  874,  874,  824,  824,  875,
      824,  875,  824,  876,  824,  824,  824,  877,  877,  877,
      877,  877,  877,  824,  824,  824,  824,  878,  824,  824,
      824,  824,  824,  879,  824,  879,  879,  879,  879,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  824,  824,  824,  824,  824,  824,  856,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  824,  824,

      860,  880,  881,  882,  882,  882,  882,  882,  882,  882,
      824,  824,  824,  862,  863,  863,  863,  863,  824,  824,
      865,  824,  824,  824,  824,  824,  866,  824,  824,  824,
      824,  824,  824,  824,  870,  872,  824,  872,  872,  872,
      872,  883,  824,  874,  874,  874,  874,  874,  874,  874,
      824,  824,  877,  877,  877,  877,  877,  877,  877,  824,
      824,  824,  824,  824,  878,  824,  824,  824,  824,  824,
      824,  824,  824,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  857,  857,  857,

      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  824,  880,
      824,  880,  881,  824,  882,  882,  882,  882,  824,  824,
      824,  863,  824,  824,  824,  824,  824,  883,  874,  874,
      874,  874,  824,  824,  877,  877,  877,  877,  877,  877,
      824,  824,  824,  824,  824,  824,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  857,  884,

      882,  882,  824,  824,  824,  863,  874,  874,  877,  877,
      877,  877,  877,  824,  824,  824,  824,  824,  824,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  857,  857,  857,  857,  857,  857,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  884,  824,  884,
      882,  882,  824,  824,  863,  874,  874,  877,  877,  877,
      824,  824,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      857,  857,  857,  857,  857,  857,  857,  857,  857,  857,

      857,  857,  824,  877,  877,  877,  824,  824,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  824,  877,  877,
      877,  824,  824,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      855,  855,  857,  857,  857,  857,  857,  857,  857,  857,
      824,  824,  877,  877,  824,  824,  855,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  855,  855,  855,  855,
      857,  857,  857,  857,  824,  824,  877,  877,  824,  855,

      855,  855,  855,  855,  855,  855,  855,  855,  855,  857,
      857,  824,  824,  877,  855,  855,  855,  855,  855,  824,
      824,  877,  855,    0,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824
    } ;

static yyconst flex_int16_t yy_nxt[2468] =
    {   0,
       26,   27,   28,   27,   29,   30,   31,   32,   33,   34,
       35,   36,   37,   38,   39,   40,   41,   42,   43,   44,
       45,   46,   46,   46,   47,   48,   49,   50,   51,   26,
       52,   52,   52,   52,   52,   53,   52,   53,   52,   53,
       53,   52,   52,   54,   26,   55,   52,   52,   52,   52,
       52,   52,   52,   56,   52,   57,   52,   52,   52,   58,
       52,   59,   52,   52,   60,   52,   61,   52,   52,   52,
       26,   62,   26,   63,   64,   65,   66,   65,   67,   64,
       64,   64,   64,   64,   64,   64,   68,   69,   64,   64,
       70,   64,   64,   64,   64,   64,   64,   64,   64,   64,

       64,   64,   64,   64,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   64,   64,   64,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   64,   64,   64,   64,   73,   73,
       74,   74,  155,  155,  162,  155,  163,  164,  162,  165,
      163,  166,  167,  823,   75,   75,   76,   77,   78,   77,
       79,   76,   76,   76,   80,   76,   76,   76,   76,   76,
       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
       76,   76,   76,   76,   76,   76,   81,   81,   81,   81,

       81,   81,   81,   81,   81,   81,   81,   81,   81,   76,
       76,   76,   81,   81,   81,   81,   81,   81,   81,   81,
       81,   82,   81,   81,   81,   83,   81,   84,   81,   81,
       85,   81,   81,   81,   81,   81,   76,   76,   76,   76,
       64,   64,   86,   64,   87,   64,   64,   64,   88,   64,
       64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
       64,   64,   64,   64,   64,   64,   64,   64,   64,   64,
       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
       89,   89,   89,   64,   64,   64,   89,   89,   89,   89,
       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,

       89,   89,   89,   89,   89,   89,   89,   89,   89,   89,
       64,   64,   64,   64,   90,   91,   92,   91,   93,   90,
       94,   90,   95,   90,   90,   96,   97,   98,   90,   99,
      100,   99,  101,   90,  102,  103,  103,  103,   90,   90,
       90,   90,   90,   90,  104,  104,  104,  104,  104,  104,
      104,  104,  104,  104,  104,  104,  104,   90,   90,   90,
      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
      104,  104,  104,  104,  104,  104,  104,  104,  104,  104,
      104,  104,  104,  104,  105,   90,  106,   90,  107,  108,
       64,  108,  108,  107,  109,  107,  110,  107,  107,  111,

      107,  107,  107,  112,  107,  112,  113,  107,  114,  115,
      115,  115,  107,  107,  107,  107,  107,  107,  116,  116,
      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
      116,  107,  107,  107,  116,  116,  116,  116,  116,  116,
      116,  116,  116,  116,  116,  116,  116,  116,  116,  116,
      116,  116,  116,  116,  116,  116,  116,  116,  107,  107,
      107,  107,   26,   27,   28,   27,   29,   30,   31,   32,
      117,   34,   35,   36,   37,   38,   39,   40,   41,   42,
      118,   44,   45,   46,   46,   46,   47,   48,   49,   50,
       51,   26,  119,  119,  119,  119,  119,  120,  119,  120,

      119,  120,  120,  119,  119,   54,   26,   55,  119,  119,
      119,  119,  119,  119,  119,  121,  119,  122,  119,  119,
      119,  123,  119,  124,  119,  119,  125,  119,  126,  119,
      119,  119,   26,   62,   26,   63,  127,  225,  200,  156,
      169,  128,  390,  173,  227,  129,  201,  129,  130,  127,
      131,  132,  132,  132,  128,  154,  174,  170,  129,  391,
      129,  130,  822,  131,  132,  132,  132,  134,  135,  136,
      135,  137,  134,  138,  134,  139,  134,  134,  140,  134,
      134,  134,  141,  142,  141,  143,  134,  144,  145,  145,
      145,  146,  134,  134,  134,  134,  134,  147,  147,  147,

      147,  147,  148,  147,  149,  147,  150,  151,  147,  147,
      152,  134,  153,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  134,  134,  134,
      134,  159,  175,  236,  176,  176,  176,  176,  219,  220,
      175,  177,  176,  176,  176,  176,  221,  222,  202,  178,
      176,  176,  176,  176,  223,  224,  240,  240,  821,  240,
      225,  225,  204,  228,  228,  228,  228,  227,  227,  160,
      179,  225,  179,  243,  243,  179,  243,  237,  227,  375,
      375,  204,  245,  299,  180,  180,  180,  180,  246,  247,

      341,  181,  341,  341,  182,  182,  182,  182,  183,  182,
      182,  182,  182,  182,  182,  182,  182,  383,  384,  234,
      184,  185,  186,  187,  182,  188,  189,  190,  182,  191,
      182,  192,  193,  194,  182,  195,  182,  196,  197,  198,
      182,  182,  182,  199,  202,  225,  176,  176,  176,  176,
      238,  820,  227,  225,  225,  225,  225,  203,  204,  353,
      227,  227,  227,  227,  205,  562,  248,  248,  206,  248,
      208,  264,  354,  357,  203,  209,  562,  204,  210,  358,
      211,  212,  213,  214,  215,  279,  205,  216,  229,  217,
      218,  230,  264,  819,  206,  233,  239,  235,  231,  818,

      256,  256,  232,  256,  261,  261,  266,  261,  266,  265,
      266,  266,  268,  311,  269,  269,  269,  269,  270,  270,
      270,  270,  272,  280,  269,  269,  269,  269,  159,  272,
      265,  269,  269,  269,  269,  273,  274,  285,  285,  285,
      285,  817,  275,  274,  360,  281,  276,  281,  361,  281,
      281,  312,  273,  362,  283,  274,  284,  284,  284,  284,
      308,  308,  274,  308,  275,  286,  160,  284,  284,  284,
      284,  816,  276,  286,  225,  284,  284,  284,  284,  288,
      293,  227,  294,  225,  295,  296,  287,  288,  815,  225,
      227,  155,  155,  289,  155,  299,  227,  290,  288,  155,

      155,  299,  155,  287,  225,  225,  288,  300,  300,  300,
      300,  227,  227,  385,  369,  289,  299,  299,  225,  814,
      225,  225,  386,  290,  302,  227,  301,  227,  227,  370,
      299,  303,  299,  299,  268,  813,  269,  269,  269,  269,
      270,  270,  270,  270,  272,  264,  269,  269,  269,  269,
      162,  313,  163,  313,  304,  313,  313,  363,  274,  305,
      812,  364,  315,  307,  316,  316,  316,  316,  306,  317,
      317,  317,  317,  365,  329,  366,  324,  274,  316,  316,
      316,  316,  330,  265,  331,  332,  399,  400,  333,  811,
      326,  336,  336,  336,  336,  335,  337,  337,  337,  337,

      335,  319,  342,  395,  342,  342,  320,  321,  322,  326,
      323,  324,  396,  316,  316,  316,  316,  338,  338,  338,
      338,  335,  423,  423,  325,  326,  339,  339,  339,  339,
      335,  327,  378,  378,  378,  328,  343,  343,  343,  343,
      486,  325,  487,  279,  326,  344,  344,  344,  344,  345,
      345,  345,  345,  327,  346,  346,  346,  346,  431,  431,
      225,  328,  180,  180,  180,  180,  202,  227,  176,  176,
      176,  176,  180,  180,  180,  180,  374,  374,  374,  374,
      204,  280,  387,  810,  348,  376,  388,  376,  348,  392,
      377,  377,  377,  377,  393,  225,  311,  225,  809,  204,

      808,  389,  227,  348,  227,  225,  225,  348,  228,  228,
      228,  228,  227,  227,  225,  225,  225,  240,  240,  521,
      240,  227,  227,  227,  240,  240,  455,  240,  243,  243,
      456,  243,  243,  243,  312,  243,  248,  248,  505,  248,
      807,  248,  248,  404,  248,  405,  406,  407,  408,  256,
      256,  506,  256,  256,  256,  410,  256,  522,  261,  261,
      409,  261,  261,  261,  806,  261,  419,  419,  419,  419,
      270,  270,  270,  270,  272,  805,  269,  269,  269,  269,
      270,  270,  270,  270,  422,  422,  422,  422,  274,  426,
      426,  426,  420,  424,  561,  424,  420,  521,  425,  425,

      425,  425,  428,  428,  428,  428,  562,  274,  434,  434,
      434,  420,  461,  461,  225,  420,  285,  285,  285,  285,
      286,  227,  284,  284,  284,  284,  285,  285,  285,  285,
      430,  430,  430,  430,  288,  522,  225,  804,  429,  432,
      803,  432,  429,  227,  433,  433,  433,  433,  299,  438,
      438,  438,  438,  288,  464,  464,  464,  429,  437,  467,
      468,  429,  439,  439,  439,  439,  440,  440,  440,  440,
      342,  437,  342,  342,  720,  437,  441,  441,  441,  441,
      375,  375,  721,  225,  225,  437,  300,  300,  300,  300,
      227,  227,  225,  225,  225,  299,  299,  423,  423,  227,

      227,  227,  225,  225,  299,  299,  299,  225,  501,  227,
      227,  225,  431,  431,  227,  299,  802,  502,  227,  299,
      503,  308,  308,  299,  308,  308,  308,  801,  308,  378,
      378,  378,  444,  225,  446,  447,  426,  426,  426,  448,
      227,  445,  451,  451,  451,  451,  434,  434,  434,  449,
      225,  450,  317,  317,  317,  317,  324,  227,  316,  316,
      316,  316,  317,  317,  317,  317,  460,  460,  460,  460,
      326,  800,  225,  799,  452,  462,  525,  462,  452,  227,
      463,  463,  463,  463,  336,  336,  336,  336,  335,  326,
      526,  461,  461,  452,  464,  464,  464,  452,  337,  337,

      337,  337,  335,  338,  338,  338,  338,  335,  339,  339,
      339,  339,  335,  343,  343,  343,  343,  344,  344,  344,
      344,  345,  345,  345,  345,  346,  346,  346,  346,  472,
      798,  472,  797,  796,  473,  473,  473,  473,  374,  374,
      374,  374,  377,  377,  377,  377,  377,  377,  377,  377,
      348,  225,  225,  419,  419,  419,  419,  225,  227,  227,
      533,  795,  533,  794,  227,  534,  534,  534,  534,  348,
      422,  422,  422,  422,  425,  425,  425,  425,  425,  425,
      425,  425,  420,  755,  793,  592,  528,  792,  225,  527,
      428,  428,  428,  428,  593,  227,  756,  535,  791,  535,

      299,  420,  536,  536,  536,  536,  430,  430,  430,  430,
      433,  433,  433,  433,  433,  433,  433,  433,  429,  438,
      438,  438,  438,  439,  439,  439,  439,  790,  437,  789,
      788,  539,  437,  440,  440,  440,  440,  429,  441,  441,
      441,  441,  437,  225,  225,  225,  225,  437,  787,  786,
      227,  227,  227,  227,  225,  299,  299,  299,  299,  785,
      225,  227,  451,  451,  451,  451,  299,  227,  543,  771,
      543,  784,  299,  544,  544,  544,  544,  460,  460,  460,
      460,  783,  772,  225,  540,  463,  463,  463,  463,  452,
      227,  782,  541,  781,  542,  463,  463,  463,  463,  473,

      473,  473,  473,  473,  473,  473,  473,  225,  452,  225,
      534,  534,  534,  534,  227,  780,  227,  534,  534,  534,
      534,  536,  536,  536,  536,  536,  536,  536,  536,  225,
      225,  225,  225,  779,  659,  778,  227,  227,  227,  227,
      623,  299,  299,  299,  299,  544,  544,  544,  544,  601,
      544,  544,  544,  544,  624,  637,  602,  225,  225,  659,
      625,  225,  225,  225,  227,  227,  777,  776,  227,  227,
      227,  638,  660,  607,  299,  299,  225,  639,  225,  608,
      225,  710,  775,  227,  774,  227,  773,  227,  770,  769,
      299,  768,  299,  661,  767,  711,  766,  660,  666,  765,

      764,  712,  763,  762,  761,  662,  760,  759,  758,  757,
      667,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   64,   64,   64,   64,   64,   64,   64,   64,
       64,   64,   64,  133,  133,  133,  133,  133,  133,  133,
      133,  133,  133,  133,  158,  754,  158,  158,  158,  158,
      158,  158,  158,  158,  158,  161,  161,  161,  161,  161,
      161,  161,  161,  161,  161,  161,  171,  753,  171,  171,
      171,  171,  171,  171,  171,  171,  171,  207,  207,  207,
      226,  226,  226,  752,  226,  226,  226,  242,  751,  750,
      242,  242,  242,  250,  250,  250,  251,  749,  748,  251,

      251,  251,  258,  258,  258,  259,  259,  747,  259,  259,
      259,  263,  746,  263,  263,  263,  263,  263,  263,  263,
      263,  263,  267,  745,  267,  267,  267,  267,  267,  267,
      267,  267,  267,  271,  744,  743,  271,  271,  271,  277,
      742,  741,  277,  277,  277,  278,  740,  278,  278,  278,
      278,  278,  278,  278,  278,  278,  282,  739,  282,  282,
      282,  282,  282,  282,  282,  282,  282,  291,  738,  737,
      291,  291,  291,  292,  292,  292,  298,  298,  298,  298,
      298,  298,  298,  310,  736,  310,  310,  310,  310,  310,
      310,  310,  310,  310,  314,  735,  314,  314,  314,  314,

      314,  314,  314,  314,  314,  318,  734,  733,  318,  318,
      318,  334,  334,  732,  334,  334,  334,  340,  340,  340,
      340,  340,  340,  340,  340,  340,  158,  731,  158,  158,
      158,  158,  158,  158,  158,  158,  158,  161,  161,  161,
      161,  161,  161,  161,  161,  161,  161,  161,  171,  730,
      171,  171,  171,  171,  171,  171,  171,  171,  171,  349,
      729,  728,  349,  349,  349,  379,  727,  726,  379,  380,
      725,  724,  380,  380,  380,  225,  225,  225,  723,  225,
      225,  225,  226,  226,  226,  722,  226,  226,  226,  403,
      719,  718,  717,  716,  403,  403,  403,  242,  715,  714,

      242,  242,  242,  414,  713,  709,  414,  414,  414,  251,
      708,  707,  251,  251,  251,  259,  259,  706,  259,  259,
      259,  421,  705,  704,  421,  421,  421,  427,  703,  702,
      427,  277,  701,  700,  277,  277,  277,  278,  699,  278,
      278,  278,  278,  278,  278,  278,  278,  278,  282,  698,
      282,  282,  282,  282,  282,  282,  282,  282,  282,  435,
      697,  696,  435,  291,  695,  694,  291,  291,  291,  436,
      693,  436,  436,  436,  436,  442,  442,  442,  298,  298,
      298,  298,  298,  298,  298,  310,  692,  310,  310,  310,
      310,  310,  310,  310,  310,  310,  314,  691,  314,  314,

      314,  314,  314,  314,  314,  314,  314,  453,  690,  689,
      453,  453,  453,  465,  688,  687,  465,  334,  334,  686,
      334,  334,  334,  520,  685,  520,  520,  520,  520,  520,
      520,  520,  520,  520,  523,  523,  523,  684,  523,  523,
      523,  226,  226,  226,  683,  226,  226,  226,  538,  682,
      681,  538,  538,  538,  658,  680,  658,  658,  658,  658,
      658,  658,  658,  658,  658,  679,  678,  677,  676,  675,
      674,  673,  672,  671,  670,  669,  668,  665,  664,  663,
      657,  656,  655,  654,  653,  652,  651,  650,  649,  648,
      647,  646,  645,  644,  643,  642,  641,  640,  636,  635,

      634,  633,  632,  631,  630,  629,  628,  627,  626,  622,
      621,  620,  619,  618,  617,  616,  615,  614,  613,  612,
      611,  610,  609,  606,  605,  604,  603,  600,  524,  599,
      598,  597,  596,  595,  594,  591,  590,  589,  588,  587,
      586,  585,  584,  583,  582,  581,  580,  579,  578,  577,
      576,  575,  574,  573,  572,  571,  570,  569,  568,  567,
      566,  565,  564,  563,  560,  559,  558,  557,  556,  555,
      554,  553,  552,  551,  550,  549,  548,  547,  546,  545,
      537,  437,  532,  531,  530,  529,  524,  402,  519,  518,
      517,  516,  515,  514,  513,  512,  511,  510,  509,  508,

      507,  504,  500,  499,  498,  497,  496,  495,  494,  493,
      492,  491,  490,  489,  488,  485,  484,  483,  482,  481,
      480,  479,  478,  477,  476,  475,  474,  335,  471,  470,
      469,  466,  459,  458,  457,  454,  311,  443,  437,  279,
      264,  260,  260,  418,  417,  416,  415,  413,  412,  411,
      402,  401,  398,  397,  394,  382,  381,  373,  372,  371,
      368,  367,  359,  356,  355,  352,  351,  350,  347,  172,
      335,  311,  309,  264,  297,  279,  264,  262,  260,  257,
      255,  254,  253,  252,  249,  244,  241,  172,  168,  157,
      154,  824,   25,  824,  824,  824,  824,  824,  824,  824,

      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824
    } ;

static yyconst flex_int16_t yy_chk[2468] =
    {   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,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,

        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
        3,    3,    3,    3,    3,    3,    3,    3,    5,    6,
        5,    6,   28,   28,   32,   28,   32,   33,  161,   33,
      161,   33,   33,  815,    5,    6,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,

        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,

        9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
        9,    9,    9,    9,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   11,   11,
       11,   11,   11,   11,   11,   11,   11,   11,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,

       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,

       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   17,   17,   17,   17,
       17,   17,   17,   17,   17,   17,   19,   52,   44,   29,
       35,   19,  213,   39,   52,   19,   44,   19,   19,   20,
       19,   19,   19,   19,   20,   29,   39,   35,   20,  213,
       20,   20,  814,   20,   20,   20,   20,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,

       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   23,   23,   23,   23,   23,   23,   23,   23,   23,
       23,   31,   40,   62,   40,   40,   40,   40,   49,   49,
       42,   40,   42,   42,   42,   42,   50,   50,   46,   42,
       46,   46,   46,   46,   51,   51,   66,   66,  813,   66,
       53,   60,   46,   53,   53,   53,   53,   53,   60,   31,
       43,  119,   43,   73,   73,   43,   73,   62,  119,  203,
      203,   46,   75,  119,   43,   43,   43,   43,   75,   75,

      154,   43,  154,  154,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   43,   43,   43,  210,  210,   60,
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   43,   45,   56,   45,   45,   45,   45,
       63,  812,   56,   58,   59,   61,   57,   45,   45,  187,
       58,   59,   61,   57,   45,  808,   78,   78,   45,   78,
       47,   94,  187,  190,   45,   47,  807,   45,   47,  190,
       47,   47,   47,   47,   47,  109,   45,   47,   56,   47,
       47,   57,  127,  806,   45,   59,   63,   61,   57,  805,

       86,   86,   58,   86,   92,   92,   95,   92,   95,   94,
       95,   95,   99,  138,   99,   99,   99,   99,  101,  101,
      101,  101,  102,  109,  102,  102,  102,  102,  158,  103,
      127,  103,  103,  103,  103,  102,  102,  113,  113,  113,
      113,  804,  102,  103,  192,  110,  102,  110,  192,  110,
      110,  138,  102,  192,  112,  102,  112,  112,  112,  112,
      136,  136,  103,  136,  102,  115,  158,  115,  115,  115,
      115,  802,  102,  114,  226,  114,  114,  114,  114,  115,
      117,  226,  117,  121,  117,  117,  114,  114,  801,  122,
      121,  155,  155,  114,  155,  121,  122,  114,  115,  156,

      156,  122,  156,  114,  120,  123,  114,  120,  120,  120,
      120,  120,  123,  211,  197,  114,  120,  123,  124,  797,
      125,  126,  211,  114,  122,  124,  121,  125,  126,  197,
      124,  122,  125,  126,  129,  796,  129,  129,  129,  129,
      130,  130,  130,  130,  132,  263,  132,  132,  132,  132,
      163,  139,  163,  139,  123,  139,  139,  193,  132,  124,
      795,  193,  141,  126,  141,  141,  141,  141,  125,  143,
      143,  143,  143,  194,  146,  194,  145,  132,  145,  145,
      145,  145,  146,  263,  146,  146,  224,  224,  146,  794,
      145,  148,  148,  148,  148,  148,  149,  149,  149,  149,

      149,  143,  162,  216,  162,  162,  143,  143,  143,  145,
      143,  144,  216,  144,  144,  144,  144,  150,  150,  150,
      150,  150,  273,  273,  144,  144,  151,  151,  151,  151,
      151,  144,  205,  205,  205,  144,  164,  164,  164,  164,
      362,  144,  362,  278,  144,  165,  165,  165,  165,  166,
      166,  166,  166,  144,  167,  167,  167,  167,  287,  287,
      230,  144,  175,  175,  175,  175,  176,  230,  176,  176,
      176,  176,  180,  180,  180,  180,  202,  202,  202,  202,
      176,  278,  212,  792,  180,  204,  212,  204,  202,  214,
      204,  204,  204,  204,  214,  229,  310,  231,  789,  176,

      786,  212,  229,  180,  231,  228,  232,  202,  228,  228,
      228,  228,  228,  232,  234,  235,  233,  240,  240,  402,
      240,  234,  235,  233,  241,  241,  320,  241,  243,  243,
      320,  243,  244,  244,  310,  244,  248,  248,  386,  248,
      785,  249,  249,  229,  249,  231,  232,  232,  233,  256,
      256,  386,  256,  257,  257,  235,  257,  402,  261,  261,
      234,  261,  262,  262,  784,  262,  266,  266,  266,  266,
      268,  268,  268,  268,  269,  783,  269,  269,  269,  269,
      270,  270,  270,  270,  272,  272,  272,  272,  269,  275,
      275,  275,  270,  274,  479,  274,  272,  520,  274,  274,

      274,  274,  281,  281,  281,  281,  479,  269,  289,  289,
      289,  270,  325,  325,  405,  272,  283,  283,  283,  283,
      284,  405,  284,  284,  284,  284,  285,  285,  285,  285,
      286,  286,  286,  286,  284,  520,  298,  782,  285,  288,
      780,  288,  286,  298,  288,  288,  288,  288,  298,  293,
      293,  293,  293,  284,  327,  327,  327,  285,  293,  330,
      330,  286,  294,  294,  294,  294,  295,  295,  295,  295,
      342,  294,  342,  342,  682,  295,  296,  296,  296,  296,
      375,  375,  682,  300,  301,  296,  300,  300,  300,  300,
      300,  301,  302,  303,  304,  300,  301,  423,  423,  302,

      303,  304,  407,  306,  302,  303,  304,  305,  384,  407,
      306,  307,  431,  431,  305,  306,  779,  384,  307,  305,
      384,  308,  308,  307,  308,  309,  309,  778,  309,  378,
      378,  378,  301,  404,  304,  304,  426,  426,  426,  305,
      404,  303,  313,  313,  313,  313,  434,  434,  434,  306,
      406,  307,  315,  315,  315,  315,  316,  406,  316,  316,
      316,  316,  317,  317,  317,  317,  324,  324,  324,  324,
      316,  777,  408,  775,  317,  326,  404,  326,  324,  408,
      326,  326,  326,  326,  336,  336,  336,  336,  336,  316,
      406,  461,  461,  317,  464,  464,  464,  324,  337,  337,

      337,  337,  337,  338,  338,  338,  338,  338,  339,  339,
      339,  339,  339,  343,  343,  343,  343,  344,  344,  344,
      344,  345,  345,  345,  345,  346,  346,  346,  346,  348,
      774,  348,  773,  772,  348,  348,  348,  348,  374,  374,
      374,  374,  376,  376,  376,  376,  377,  377,  377,  377,
      374,  409,  410,  419,  419,  419,  419,  525,  409,  410,
      420,  771,  420,  770,  525,  420,  420,  420,  420,  374,
      422,  422,  422,  422,  424,  424,  424,  424,  425,  425,
      425,  425,  422,  721,  766,  512,  410,  764,  444,  409,
      428,  428,  428,  428,  512,  444,  721,  429,  763,  429,

      444,  422,  429,  429,  429,  429,  430,  430,  430,  430,
      432,  432,  432,  432,  433,  433,  433,  433,  430,  438,
      438,  438,  438,  439,  439,  439,  439,  761,  438,  760,
      758,  444,  439,  440,  440,  440,  440,  430,  441,  441,
      441,  441,  440,  445,  446,  447,  448,  441,  757,  756,
      445,  446,  447,  448,  449,  445,  446,  447,  448,  755,
      450,  449,  451,  451,  451,  451,  449,  450,  452,  738,
      452,  754,  450,  452,  452,  452,  452,  460,  460,  460,
      460,  752,  738,  526,  446,  462,  462,  462,  462,  460,
      526,  751,  449,  750,  450,  463,  463,  463,  463,  472,

      472,  472,  472,  473,  473,  473,  473,  527,  460,  528,
      533,  533,  533,  533,  527,  749,  528,  534,  534,  534,
      534,  535,  535,  535,  535,  536,  536,  536,  536,  539,
      540,  541,  542,  747,  600,  746,  539,  540,  541,  542,
      561,  539,  540,  541,  542,  543,  543,  543,  543,  527,
      544,  544,  544,  544,  561,  576,  528,  601,  602,  658,
      561,  661,  607,  608,  601,  602,  745,  743,  661,  607,
      608,  576,  600,  541,  607,  608,  662,  576,  666,  542,
      667,  674,  742,  662,  740,  666,  739,  667,  737,  736,
      666,  735,  667,  601,  734,  674,  732,  658,  607,  731,

      730,  674,  729,  728,  727,  602,  726,  724,  723,  722,
      608,  825,  825,  825,  825,  825,  825,  825,  825,  825,
      825,  825,  826,  826,  826,  826,  826,  826,  826,  826,
      826,  826,  826,  827,  827,  827,  827,  827,  827,  827,
      827,  827,  827,  827,  828,  720,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  829,  829,  829,  829,  829,
      829,  829,  829,  829,  829,  829,  830,  718,  830,  830,
      830,  830,  830,  830,  830,  830,  830,  831,  831,  831,
      832,  832,  832,  717,  832,  832,  832,  833,  716,  715,
      833,  833,  833,  834,  834,  834,  835,  714,  713,  835,

      835,  835,  836,  836,  836,  837,  837,  712,  837,  837,
      837,  838,  711,  838,  838,  838,  838,  838,  838,  838,
      838,  838,  839,  710,  839,  839,  839,  839,  839,  839,
      839,  839,  839,  840,  709,  708,  840,  840,  840,  841,
      707,  706,  841,  841,  841,  842,  705,  842,  842,  842,
      842,  842,  842,  842,  842,  842,  843,  704,  843,  843,
      843,  843,  843,  843,  843,  843,  843,  844,  703,  701,
      844,  844,  844,  845,  845,  845,  846,  846,  846,  846,
      846,  846,  846,  847,  699,  847,  847,  847,  847,  847,
      847,  847,  847,  847,  848,  698,  848,  848,  848,  848,

      848,  848,  848,  848,  848,  849,  697,  696,  849,  849,
      849,  850,  850,  694,  850,  850,  850,  851,  851,  851,
      851,  851,  851,  851,  851,  851,  852,  693,  852,  852,
      852,  852,  852,  852,  852,  852,  852,  853,  853,  853,
      853,  853,  853,  853,  853,  853,  853,  853,  854,  692,
      854,  854,  854,  854,  854,  854,  854,  854,  854,  855,
      691,  690,  855,  855,  855,  856,  689,  688,  856,  857,
      687,  685,  857,  857,  857,  858,  858,  858,  684,  858,
      858,  858,  859,  859,  859,  683,  859,  859,  859,  860,
      681,  680,  679,  678,  860,  860,  860,  861,  677,  676,

      861,  861,  861,  862,  675,  673,  862,  862,  862,  863,
      672,  671,  863,  863,  863,  864,  864,  670,  864,  864,
      864,  865,  669,  668,  865,  865,  865,  866,  664,  657,
      866,  867,  656,  654,  867,  867,  867,  868,  653,  868,
      868,  868,  868,  868,  868,  868,  868,  868,  869,  651,
      869,  869,  869,  869,  869,  869,  869,  869,  869,  870,
      650,  649,  870,  871,  646,  645,  871,  871,  871,  872,
      644,  872,  872,  872,  872,  873,  873,  873,  874,  874,
      874,  874,  874,  874,  874,  875,  643,  875,  875,  875,
      875,  875,  875,  875,  875,  875,  876,  642,  876,  876,

      876,  876,  876,  876,  876,  876,  876,  877,  640,  639,
      877,  877,  877,  878,  638,  637,  878,  879,  879,  636,
      879,  879,  879,  880,  634,  880,  880,  880,  880,  880,
      880,  880,  880,  880,  881,  881,  881,  633,  881,  881,
      881,  882,  882,  882,  632,  882,  882,  882,  883,  631,
      629,  883,  883,  883,  884,  628,  884,  884,  884,  884,
      884,  884,  884,  884,  884,  627,  626,  625,  624,  623,
      621,  620,  619,  615,  613,  612,  611,  606,  605,  604,
      599,  598,  597,  596,  595,  594,  593,  592,  591,  590,
      589,  588,  586,  584,  583,  581,  578,  577,  575,  574,

      573,  572,  571,  570,  569,  568,  566,  565,  564,  560,
      558,  557,  556,  555,  554,  553,  552,  551,  550,  549,
      548,  547,  545,  532,  531,  530,  529,  524,  523,  518,
      517,  516,  515,  514,  513,  511,  510,  509,  508,  507,
      506,  505,  503,  502,  501,  500,  499,  498,  497,  496,
      494,  493,  492,  491,  490,  489,  488,  487,  486,  485,
      483,  482,  481,  480,  478,  477,  476,  475,  471,  470,
      469,  468,  467,  466,  459,  458,  457,  456,  455,  454,
      437,  436,  418,  413,  412,  411,  403,  401,  400,  398,
      397,  396,  395,  394,  393,  392,  391,  390,  389,  388,

      387,  385,  383,  382,  381,  372,  371,  370,  369,  368,
      367,  366,  365,  364,  363,  361,  360,  359,  358,  357,
      356,  355,  354,  353,  352,  351,  350,  334,  333,  332,
      331,  329,  323,  322,  321,  319,  314,  299,  292,  282,
      267,  259,  258,  255,  254,  253,  252,  247,  246,  245,
      227,  225,  218,  217,  215,  209,  208,  200,  199,  198,
      196,  195,  191,  189,  188,  186,  185,  183,  173,  171,
      147,  140,  137,  128,  118,  111,   96,   93,   89,   87,
       85,   84,   83,   82,   79,   74,   67,   36,   34,   30,
       27,   25,  824,  824,  824,  824,  824,  824,  824,  824,

      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824,  824,  824,  824,
      824,  824,  824,  824,  824,  824,  824
    } ;

/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[210] =
    {   0,
1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 1, 0, 0,     };

static yyconst flex_int16_t yy_rule_linenum[209] =
    {   0,
      226,  248,  250,  252,  274,  275,  276,  277,  278,  279,
      280,  281,  282,  283,  284,  285,  287,  288,  289,  290,
      292,  293,  294,  295,  296,  297,  298,  299,  300,  301,
      302,  303,  305,  310,  311,  313,  314,  315,  316,  317,
      318,  319,  320,  321,  322,  323,  325,  326,  327,  328,
      330,  331,  332,  333,  335,  336,  337,  338,  339,  341,
      342,  343,  344,  345,  346,  347,  348,  350,  351,  352,
      353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
      363,  364,  365,  366,  367,  370,  377,  378,  379,  380,
      381,  382,  383,  384,  385,  386,  387,  388,  389,  390,

      392,  393,  394,  395,  396,  397,  398,  399,  401,  405,
      427,  439,  468,  516,  517,  518,  519,  521,  530,  542,
      571,  572,  573,  574,  575,  577,  585,  636,  649,  671,
      676,  681,  688,  689,  704,  709,  710,  715,  716,  717,
      719,  735,  789,  817,  822,  827,  828,  829,  830,  835,
      846,  847,  849,  851,  862,  876,  881,  882,  883,  884,
      886,  901,  915,  944,  969,  971,  976,  986,  991, 1009,
     1015, 1022, 1055, 1057, 1062, 1098, 1099, 1100, 1102, 1103,
     1104, 1105, 1106, 1107, 1109, 1110, 1111, 1113, 1118, 1123,
     1124, 1127, 1161, 1166, 1169, 1170, 1171, 1172, 1174, 1179,

     1180, 1181, 1182, 1183, 1185, 1190, 1192, 1194
    } ;

/* 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
#line 1 "pir.l"

#line 40 "pir.l"

/*
 * $Id: pirlexer.c 41681 2009-10-04 11:07:09Z kjs $
 * Copyright (C) 2007-2009, Parrot Foundation.
 */

/*

=head1 NAME

pir.l - implementation of the lexical analyzer of the PIR assembly language.

=head1 DESCRIPTION

This file implements the lexical analyzer of the PIR assembly language.
The macro layer is implemented here as well. Heredocs and C<.include>
are processed by a different preprocessor; see F<hdocprep.l>.

=cut

*/

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "pirparser.h"
#include "pircompiler.h"
#include "pirmacro.h"
#include "pirerr.h"

#include "parrot/parrot.h"

/* define the type of the extra field in the yyscan_t object that is passed around;
 * this is the lexer_state structure, defined in "pircompiler.h"
 */
#define YY_EXTRA_TYPE  struct lexer_state *

/* accessor methods for setting and getting the column; flex doesn't generate
 * prototypes for these for some reason. It's probably a missing feature, so
 * let's do that here and now.
 */
extern int  yypirget_column(yyscan_t yyscanner);
extern void yypirset_column(int col, yyscan_t yyscanner);

#ifdef _WIN32
/* warning C4018: "signed/unsigned mismatch" */
#  pragma warning (disable:4018)
/* warning C4244: "conversion from 'int' to 'yytype_int16' */
#  pragma warning (disable:4244)

#else
/* is this possible on other platforms? */

#endif

void include_file(yyscan_t yyscanner, char const * const filename);
char *expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args);

/* static prototypes */
static int is_pir_directive(char * const text);
static macro_table *pop_macro_table(lexer_state * const lexer);
static macro_table *peek_macro_table(lexer_state * const lexer);
static char * munge_id(char const * const id, lexer_state * const lexer);

static void save_filestate(yyscan_t yyscanner);
static int restore_filestate(yyscan_t yyscanner);

/* make sure yytext is a pointer */
/* slightly more efficient when this option is set; our parser is not interactive anyway. */
/* define output file */
/* name of header file */
/* prefix on exported functions. */
/* we don't use unput, so don't generate it */
/* use flex' built-in capability for line counting */
/* make the scanner re-entrant */
/* needed for bison interaction. */
/* make yypirwrap() always return true. */
/* always show warnings if something's wrong with our spec. */
/* create a scanner in debug mode; XXX remove this in production build. */
/* we're pushing and popping lexer states, so we need a stack */
/* override memory allocation function with Parrot's memory functions;
 * don't generate built-ins.
 */
/* XXX document, and possibly rename, these states, when are they used? */


/* The MACROLOCAL state is used ONLY when parsing ".macro_local <type> <ident>". */

/* The MACROLABEL state is used ONLY when parsing ".macro_label <ident>". */

/* The MACROEXPAND state is entered when we find a dot-identifier (e.g. ".foo"); */


/* note that SCANSTR is an inclusive state, purely to override default action for <<EOF>> */



/* The SPECIALSTART state is only used when the parsing starts, and only to
 * read a single character; we're not interested in the character, but we want
 * a way for the lexer to check the PASM flag (indicating a PASM file), and this
 * check must only be done once (it's a waste to do it for each token). The
 * read character will be pushed back into the input stream immediately, and
 * a token will be returned, indicating it's a PASM or PIR file.
 */

/* The PASM state is an exclusive state, recognizing ONLY PASM tokens. */

#line 1548 "pirlexer.c"

#define INITIAL 0
#define MACROHEAD 1
#define MACROBODY 2
#define MACROLOCAL 3
#define MACROLABEL 4
#define MACROEXPAND 5
#define MACROCONST 6
#define SCANSTR 7
#define SCANMACRO 8
#define STRINGEXPAND 9
#define SPECIALSTART 10
#define PASM 11

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

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

/* %if-c-only Reentrant structure and macros (non-C++). */
/* %if-reentrant */

/* Holds the entire state of the reentrant scanner. */
struct yyguts_t
    {

    /* User-defined. Not touched by flex. */
    YY_EXTRA_TYPE yyextra_r;

    /* The rest are the same as the globals declared in the non-reentrant scanner. */
    FILE *yyin_r, *yyout_r;
    size_t yy_buffer_stack_top; /**< index of top of stack. */
    size_t yy_buffer_stack_max; /**< capacity of stack. */
    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
    char yy_hold_char;
    yy_size_t yy_n_chars;
    yy_size_t yyleng_r;
    char *yy_c_buf_p;
    int yy_init;
    int yy_start;
    int yy_did_buffer_switch_on_eof;
    int yy_start_stack_ptr;
    int yy_start_stack_depth;
    int *yy_start_stack;
    yy_state_type yy_last_accepting_state;
    char* yy_last_accepting_cpos;

    int yylineno_r;
    int yy_flex_debug_r;

    char *yytext_r;
    int yy_more_flag;
    int yy_more_len;

    YYSTYPE * yylval_r;

    }; /* end struct yyguts_t */

/* %if-c-only */

static int yy_init_globals (yyscan_t yyscanner );

/* %endif */

/* %if-reentrant */

    /* This must go here because YYSTYPE and YYLTYPE are included
     * from bison output in section 1.*/
    #    define yylval yyg->yylval_r
    
int yypirlex_init (yyscan_t* scanner);

int yypirlex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);

/* %endif */

/* %endif End reentrant structures and macros. */

/* Accessor methods to globals.
   These are made visible to non-reentrant scanners for convenience. */

int yypirlex_destroy (yyscan_t yyscanner );

int yypirget_debug (yyscan_t yyscanner );

void yypirset_debug (int debug_flag ,yyscan_t yyscanner );

YY_EXTRA_TYPE yypirget_extra (yyscan_t yyscanner );

void yypirset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );

FILE *yypirget_in (yyscan_t yyscanner );

void yypirset_in  (FILE * in_str ,yyscan_t yyscanner );

FILE *yypirget_out (yyscan_t yyscanner );

void yypirset_out  (FILE * out_str ,yyscan_t yyscanner );

yy_size_t yypirget_leng (yyscan_t yyscanner );

char *yypirget_text (yyscan_t yyscanner );

int yypirget_lineno (yyscan_t yyscanner );

void yypirset_lineno (int line_number ,yyscan_t yyscanner );

/* %if-bison-bridge */

YYSTYPE * yypirget_lval (yyscan_t yyscanner );

void yypirset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );

/* %endif */

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

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yypirwrap (yyscan_t yyscanner );
#else
extern int yypirwrap (yyscan_t yyscanner );
#endif
#endif

/* %not-for-header */

/* %ok-for-header */

/* %endif */

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

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

#ifndef YY_NO_INPUT
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */

#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner );
#else
static int input (yyscan_t yyscanner );
#endif
/* %ok-for-header */

/* %endif */
#endif

/* %if-c-only */

    static void yy_push_state (int new_state ,yyscan_t yyscanner);
    
    static void yy_pop_state (yyscan_t yyscanner );
    
    static int yy_top_state (yyscan_t yyscanner );
    
/* %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
/* %if-c-only Standard (non-C++) definition */
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO fwrite( yytext, yyleng, 1, yyout )
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#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) \
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		yy_size_t n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\
/* %if-c++-only C++ definition \ */\
/* %endif */

#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
/* %if-c-only */
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
#endif

/* %if-tables-serialization structures and prototypes */
/* %not-for-header */

/* %ok-for-header */

/* %not-for-header */

/* %tables-yydmap generated elements */
/* %endif */
/* end tables serialization structures and prototypes */

/* %ok-for-header */

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */

extern int yypirlex \
               (YYSTYPE * yylval_param ,yyscan_t yyscanner);

#define YY_DECL int yypirlex \
               (YYSTYPE * yylval_param , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif /* !YY_DECL */

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

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

/* %% [6.0] YY_RULE_SETUP definition goes here */
#define YY_RULE_SETUP \
	YY_USER_ACTION

/* %not-for-header */

/** The main scanner function which does all the work.
 */
YY_DECL
{
	register yy_state_type yy_current_state;
	register char *yy_cp, *yy_bp;
	register int yy_act;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

/* %% [7.0] user's declarations go here */
#line 223 "pir.l"



#line 1865 "pirlexer.c"

    yylval = yylval_param;

	if ( !yyg->yy_init )
		{
		yyg->yy_init = 1;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! yyg->yy_start )
			yyg->yy_start = 1;	/* first start state */

		if ( ! yyin )
/* %if-c-only */
			yyin = stdin;
/* %endif */
/* %if-c++-only */
/* %endif */

		if ( ! yyout )
/* %if-c-only */
			yyout = stdout;
/* %endif */
/* %if-c++-only */
/* %endif */

		if ( ! YY_CURRENT_BUFFER ) {
			yypirensure_buffer_stack (yyscanner);
			YY_CURRENT_BUFFER_LVALUE =
				yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
		}

		yypir_load_buffer_state(yyscanner );
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
/* %% [8.0] yymore()-related code goes here */
		yy_cp = yyg->yy_c_buf_p;

		/* Support of yytext. */
		*yy_cp = yyg->yy_hold_char;

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

/* %% [9.0] code to set up and find next match goes here */
		yy_current_state = yyg->yy_start;
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
				yyg->yy_last_accepting_state = yy_current_state;
				yyg->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 >= 825 )
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
		while ( yy_current_state != 824 );
		yy_cp = yyg->yy_last_accepting_cpos;
		yy_current_state = yyg->yy_last_accepting_state;

yy_find_action:
/* %% [10.0] code to find the action number goes here */
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

/* %% [11.0] code for yylineno update goes here */

		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
			{
			int yyl;
			for ( yyl = 0; yyl < yyleng; ++yyl )
				if ( yytext[yyl] == '\n' )
					   
    do{ yylineno++;
        yycolumn=0;
    }while(0)
;
			}

do_action:	/* This label is used only to access EOF actions. */

/* %% [12.0] debug code goes here */
		if ( yy_flex_debug )
			{
			if ( yy_act == 0 )
				fprintf( stderr, "--scanner backing up\n" );
			else if ( yy_act < 209 )
				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
				         (long)yy_rule_linenum[yy_act], yytext );
			else if ( yy_act == 209 )
				fprintf( stderr, "--accepting default rule (\"%s\")\n",
				         yytext );
			else if ( yy_act == 210 )
				fprintf( stderr, "--(end of buffer or a NUL)\n" );
			else
				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
			}

		switch ( yy_act )
	{ /* beginning of action switch */
/* %% [13.0] actions go here */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = yyg->yy_hold_char;
			yy_cp = yyg->yy_last_accepting_cpos;
			yy_current_state = yyg->yy_last_accepting_state;
			goto yy_find_action;

case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
#line 226 "pir.l"
{ /* only when the scanning starts, is this state used. Only a single
                         * character is read, pushed back, and then, depending on the
                         * lexer flags, either PASM or PIR mode (INITIAL state) is activated.
                         * The alternative (documented in Bison's info) would be to have a
                         * check on some variable, which is written right after the %% marker
                         * above. However, that code would be executed on every call to the
                         * lexer, which is a bit of a waste.
                         */
                        yyless(0); /* put everything back. It's only 1 character anyway. */
                        yy_pop_state(yyscanner); /* SPECIALSTART was pushed on state stack. */

                        if (TEST_FLAG(yypirget_extra(yyscanner)->flags, LEXER_FLAG_PASMFILE)) {
                            BEGIN(PASM);
                            return TK_PASM_MARKER_START;
                        }
                        else {
                            BEGIN(INITIAL); /* this is the normal case. */
                            return TK_PIR_MARKER_START;
                        }

                      }
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 248 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 3:
/* rule 3 can match eol */
YY_RULE_SETUP
#line 250 "pir.l"
{ /* ignore line comments */ }
	YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 252 "pir.l"
{ /* a set of continuous newlines yields a single newline token. */
                    int index        = 0;
                    int num_newlines = 0;

                    /* count number of newlines in the matched text;
                     * iterate explicitly using an index is somewhat safer
                     * than with a character pointer, as you'd have to
                     * check for (*iter != '\0'), not (iter != NULL) for
                     * some reason. Just do it safely, and hope the compiler
                     * optimizes this a bit.
                     */
                    while (index < yyleng) {
                        if (yytext[index] == '\n')
                            ++num_newlines;

                        ++index;
                    }
                    /* pass the number of matched newlines */
                    yylval->ival = num_newlines;
                    return TK_NL;
                  }
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 274 "pir.l"
{ return TK_ASSIGN_USHIFT; }
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 275 "pir.l"
{ return TK_USHIFT; }
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 276 "pir.l"
{ return TK_ASSIGN_RSHIFT; }
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 277 "pir.l"
{ return TK_RSHIFT; }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 278 "pir.l"
{ return TK_LSHIFT; }
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 279 "pir.l"
{ return TK_ARROW; }
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 280 "pir.l"
{ return TK_EQ; }
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 281 "pir.l"
{ return TK_NE; }
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 282 "pir.l"
{ return TK_LE; }
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 283 "pir.l"
{ return TK_GE; }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 284 "pir.l"
{ return TK_LT; }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 285 "pir.l"
{ return TK_GT; }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 287 "pir.l"
{ return TK_FDIV; }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 288 "pir.l"
{ return TK_AND; }
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 289 "pir.l"
{ return TK_OR; }
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 290 "pir.l"
{ return TK_XOR; }
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 292 "pir.l"
{ return '+'; }
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 293 "pir.l"
{ return '%'; }
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 294 "pir.l"
{ return '*'; }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 295 "pir.l"
{ return '/'; }
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 296 "pir.l"
{ return '!'; }
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 297 "pir.l"
{ return '~'; }
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 298 "pir.l"
{ return '-'; }
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 299 "pir.l"
{ return '('; }
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 300 "pir.l"
{ return ')'; }
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 301 "pir.l"
{ return ','; }
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 302 "pir.l"
{ return '['; }
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 303 "pir.l"
{ return ']'; }
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 305 "pir.l"
{ /* if the dot is surrounded by whitespace, it's a concatenation operator */
                    return TK_CONC;
                  }
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 310 "pir.l"
{ return '='; }
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 311 "pir.l"
{ return ';'; }
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 313 "pir.l"
{ return TK_ASSIGN_INC; }
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 314 "pir.l"
{ return TK_ASSIGN_DEC; }
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 315 "pir.l"
{ return TK_ASSIGN_DIV; }
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 316 "pir.l"
{ return TK_ASSIGN_MUL; }
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 317 "pir.l"
{ return TK_ASSIGN_MOD; }
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 318 "pir.l"
{ return TK_ASSIGN_POW; }
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 319 "pir.l"
{ return TK_ASSIGN_BOR; }
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 320 "pir.l"
{ return TK_ASSIGN_BAND; }
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 321 "pir.l"
{ return TK_ASSIGN_FDIV; }
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 322 "pir.l"
{ return TK_ASSIGN_BNOT; }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 323 "pir.l"
{ return TK_ASSIGN_CONC; }
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 325 "pir.l"
{ return TK_IF; }
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 326 "pir.l"
{ return TK_GOTO; }
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 327 "pir.l"
{ return TK_UNLESS; }
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 328 "pir.l"
{ return TK_NULL; }
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 330 "pir.l"
{ return TK_INT; }
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 331 "pir.l"
{ return TK_NUM; }
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 332 "pir.l"
{ return TK_PMC; }
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 333 "pir.l"
{ return TK_STRING; }
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 335 "pir.l"
{ return TK_ANNOTATE; }
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 336 "pir.l"
{ return TK_SET_ARG; }
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 337 "pir.l"
{ return TK_CONST; }
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 338 "pir.l"
{ return TK_END; }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 339 "pir.l"
{ return TK_FILE; }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 341 "pir.l"
{ return TK_GET_RESULTS; }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 342 "pir.l"
{ return TK_GLOBALCONST; }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 343 "pir.l"
{ return TK_HLL; }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 344 "pir.l"
{ return TK_INVOCANT; }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 345 "pir.l"
{ return TK_LEX; }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 346 "pir.l"
{ return TK_LINE; }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 347 "pir.l"
{ return TK_LOADLIB; }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 348 "pir.l"
{ return TK_LOCAL; }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 350 "pir.l"
{ return TK_METH_CALL; }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 351 "pir.l"
{ return TK_NAMESPACE; }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 352 "pir.l"
{ return TK_NCI_CALL; }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 353 "pir.l"
{ return TK_PARAM; }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 354 "pir.l"
{ return TK_BEGIN_CALL; }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 355 "pir.l"
{ return TK_BEGIN_RETURN; }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 356 "pir.l"
{ return TK_BEGIN_YIELD; }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 357 "pir.l"
{ return TK_CALL; }
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 358 "pir.l"
{ return TK_END_CALL; }
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 359 "pir.l"
{ return TK_END_RETURN; }
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 360 "pir.l"
{ return TK_END_YIELD; }
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 361 "pir.l"
{ return TK_GET_RESULT; }
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 362 "pir.l"
{ return TK_RETURN; }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 363 "pir.l"
{ return TK_SUB; }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 364 "pir.l"
{ return TK_YIELD; }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 365 "pir.l"
{ return TK_SET_RETURN; }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 366 "pir.l"
{ return TK_SET_YIELD; }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 367 "pir.l"
{ return TK_TAILCALL; }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 370 "pir.l"
{ /* make sure these are not used outside macro defs */
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
                               "cannot use '%s' outside of macro definitions", yytext);
                  }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 377 "pir.l"
{ return TK_FLAG_ANON; }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 378 "pir.l"
{ return TK_FLAG_INIT; }
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 379 "pir.l"
{ return TK_FLAG_LOAD; }
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 380 "pir.l"
{ return TK_FLAG_POSTCOMP; }
	YY_BREAK
case 91:
YY_RULE_SETUP
#line 381 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 382 "pir.l"
{ return TK_FLAG_MAIN; }
	YY_BREAK
case 93:
YY_RULE_SETUP
#line 383 "pir.l"
{ return TK_FLAG_METHOD; }
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 384 "pir.l"
{ return TK_FLAG_LEX; }
	YY_BREAK
case 95:
YY_RULE_SETUP
#line 385 "pir.l"
{ return TK_FLAG_OUTER; }
	YY_BREAK
case 96:
YY_RULE_SETUP
#line 386 "pir.l"
{ return TK_FLAG_VTABLE; }
	YY_BREAK
case 97:
YY_RULE_SETUP
#line 387 "pir.l"
{ return TK_FLAG_MULTI; }
	YY_BREAK
case 98:
YY_RULE_SETUP
#line 388 "pir.l"
{ return TK_FLAG_SUBID; }
	YY_BREAK
case 99:
YY_RULE_SETUP
#line 389 "pir.l"
{ return TK_FLAG_INSTANCEOF; }
	YY_BREAK
case 100:
YY_RULE_SETUP
#line 390 "pir.l"
{ return TK_FLAG_NSENTRY; }
	YY_BREAK
case 101:
YY_RULE_SETUP
#line 392 "pir.l"
{ return TK_FLAG_UNIQUE_REG; }
	YY_BREAK
case 102:
YY_RULE_SETUP
#line 393 "pir.l"
{ return TK_FLAG_OPTIONAL; }
	YY_BREAK
case 103:
YY_RULE_SETUP
#line 394 "pir.l"
{ return TK_FLAG_OPT_FLAG; }
	YY_BREAK
case 104:
YY_RULE_SETUP
#line 395 "pir.l"
{ return TK_FLAG_SLURPY; }
	YY_BREAK
case 105:
YY_RULE_SETUP
#line 396 "pir.l"
{ return TK_FLAG_NAMED; }
	YY_BREAK
case 106:
YY_RULE_SETUP
#line 397 "pir.l"
{ return TK_FLAG_FLAT; }
	YY_BREAK
case 107:
YY_RULE_SETUP
#line 398 "pir.l"
{ return TK_FLAG_INVOCANT; }
	YY_BREAK
case 108:
YY_RULE_SETUP
#line 399 "pir.l"
{ return TK_FLAG_LOOKAHEAD; }
	YY_BREAK
case 109:
YY_RULE_SETUP
#line 401 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                               "unrecognized flag: '%s'", yytext);
                  }
	YY_BREAK
case 110:
YY_RULE_SETUP
#line 405 "pir.l"
{ /* XXX this is a bit hacky. First the string is unescaped, but that
                     * returns a STRING * object; that's not what we want at this point.
                     * So, convert it back to a C string, and return that. Later, that
                     * string is converted into a STRING again, so this must be fixed.
                     * Preferably there would be an unescape function returning a C-string.
                     */
                    lexer_state * const lexer = yypirget_extra(yyscanner);

                    STRING *pstr = Parrot_str_unescape(lexer->interp,
                                                           yytext + 1, '"', "ascii");

                    char *str = Parrot_str_to_cstring(lexer->interp, pstr);

                    yylval->sval = str;
                    
                    /* store the STRING in lexer's sval buffer; once PIRC is doing
                    only STRINGs, it can be stored in yylval.sval. */
                    lexer->sval = pstr;
                    
                    return TK_STRINGC;
                  }
	YY_BREAK
case 111:
YY_RULE_SETUP
#line 427 "pir.l"
{ /* copy the string, remove the quotes. */
                    lexer_state * const lexer = yypirget_extra(yyscanner);
                    
                    STRING *str = Parrot_str_unescape(lexer->interp, yytext + 1, '\'', "ascii");
                    lexer->sval = str;
                    
                    yylval->sval = dupstrn(lexer, yytext + 1, yyleng - 2);

                    
                    return TK_STRINGC;
                  }
	YY_BREAK
case 112:
YY_RULE_SETUP
#line 439 "pir.l"
{ /* XXX these double-quoted strings are not unescaped (yet) */
                    /* parse yytext, which contains the charset, a ':', and the quoted string */
                    char        *colon = strchr(yytext, ':');
                    lexer_state *lexer = yypirget_extra(yyscanner);
                    ucstring    *ustr  = (ucstring *)pir_mem_allocate(lexer, sizeof (ucstring));
                    /* copy the charset part */
                    ustr->charset      = dupstrn(lexer, yytext, colon - yytext);
                    /* the colon becomes a NULL character to end the encoding string */
                    *colon = '\0';
                    /* copy the string contents, strip the quotes. Example:
                     *   iso-8859-1:"hi there"
                     *   123456789012345678901
                     *             ^
                     *          (colon)
                     * colon points to the colon, add 2 to point to the first character
                     * in the string ('h'). yyleng is 20 in the example, subtract
                     * string length of the charset part (10) and 3 for the quotes and colon.
                     */

                    ustr->contents = dupstrn(lexer, colon + 2, yyleng - strlen(ustr->charset) - 3);

                    ustr->encoding = NULL;

                    /* fprintf(stderr, "ucstring: [%s]:[%s]\n", ustr->charset, ustr->contents); */

                    yylval->ustr = ustr;
                    return TK_USTRINGC;
                  }
	YY_BREAK
case 113:
YY_RULE_SETUP
#line 468 "pir.l"
{ /* XXX these double-quoted strings are not unescaped (yet) */
                    /* parse yytext, which contains the encoding, a ':', a charset,
                     * a ':', and the quoted string
                     */
                    char        *colon1 = strchr(yytext, ':');
                    char        *colon2;
                    lexer_state *lexer = yypirget_extra(yyscanner);
                    ucstring    *ustr  = (ucstring *)pir_mem_allocate(lexer, sizeof (ucstring));

                    /* yytext has the following structure:
                     *
                     * <charset><encoding><contents>
                     *
                     *   utf:unicode:"hi there"
                     *   1234567890123456789012
                     *      ^       ^
                     *   (colon1) (colon2)
                     *
                     * colon1 points to the first colon, colon2 points to the second.
                     */

                    /* copy the encoding part */
                    ustr->encoding = dupstrn(lexer, yytext, colon1 - yytext);

                    /* look for the second colon after this one */
                    colon2 = strchr(colon1 + 1, ':');
                    /* the colon becomes a NULL character to end the encoding string */
                    *colon1 = '\0';

                    ustr->charset  = dupstrn(lexer, colon1 + 1, colon2 - colon1 - 1);

                    /* start copying after the second colon, and skip the quote as well.
                     * yyleng contains the total length, substract length of encoding,
                     * length of charset, 2 quotes, and 2 colons (hence -4).
                     */
                    ustr->contents = dupstrn(lexer, colon2 + 2,
                                 yyleng - strlen(ustr->charset) - strlen(ustr->encoding) - 4);

                    /* fprintf(stderr, "ucstring: [%s]:[%s]:[%s]\n", ustr->encoding, ustr->charset,
                                   ustr->contents);
                    */

                    yylval->ustr = ustr;
                    return TK_USTRINGC;

                  }
	YY_BREAK
case 114:
YY_RULE_SETUP
#line 516 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_PREG; }
	YY_BREAK
case 115:
YY_RULE_SETUP
#line 517 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_SREG; }
	YY_BREAK
case 116:
YY_RULE_SETUP
#line 518 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_NREG; }
	YY_BREAK
case 117:
YY_RULE_SETUP
#line 519 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_IREG; }
	YY_BREAK
case 118:
YY_RULE_SETUP
#line 521 "pir.l"
{ /* make the label Id available in the parser. remove the ":" first. */
                    lexer_state * const lexer = yypirget_extra(yyscanner);
                    STRING *str = Parrot_str_new(lexer->interp, yytext, yyleng - 1);
                    lexer->sval = str;
                    
                    yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                    return TK_LABEL;
                  }
	YY_BREAK
case 119:
YY_RULE_SETUP
#line 530 "pir.l"
{ /* give a warning when using PASM registers as PIR identifiers */
                    lexer_state * const lexer = yypirget_extra(yyscanner);

                    if (TEST_FLAG(lexer->flags, LEXER_FLAG_WARNINGS))
                        pirwarning(lexer, yypirget_lineno(yyscanner),
                                   "Use of PASM register identifier ('%s') "
                                   "is not encouraged for readable code", yytext);

                    yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                    return TK_IDENT;
                  }
	YY_BREAK
case 120:
YY_RULE_SETUP
#line 542 "pir.l"
{ /* identifier; can be a global (sub or const), local or parrot op */
                    lexer_state * const lexer = yypirget_extra(yyscanner);
                    constdecl   * const c = find_global_constant(lexer, yytext);

                    if (c) { /* it's  a global const */
                        switch (c->type) {
                            case INT_VAL:
                                yylval->ival = c->val.ival;
                                return TK_INTC;
                            case STRING_VAL:
                                yylval->sval = c->val.sval;
                                return TK_STRINGC;
                            case NUM_VAL:
                                yylval->dval = c->val.nval;
                                return TK_NUMC;
                            case USTRING_VAL:
                                yylval->sval = c->val.ustr->contents;
                                return TK_USTRINGC;
                            default:
                                panic(lexer, "unsupported constant type");
                                break;
                        }
                    }
                    lexer->sval = Parrot_str_new(lexer->interp, yytext, yyleng);
                    					
                    yylval->sval = dupstr(lexer, yytext);
                    return TK_IDENT;
                  }
	YY_BREAK
case 121:
YY_RULE_SETUP
#line 571 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
	YY_BREAK
case 122:
YY_RULE_SETUP
#line 572 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 123:
YY_RULE_SETUP
#line 573 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 124:
YY_RULE_SETUP
#line 574 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 125:
YY_RULE_SETUP
#line 575 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 126:
*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
yyg->yy_c_buf_p = yy_cp = yy_bp + 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
#line 577 "pir.l"
{ /* Make sure the dot is followed by a character that
                     * starts a method object. $ for registers,
                     * quotes for quoted strings, and letters for identifiers.
                     *
                     */
                     return '.';
                  }
	YY_BREAK
case 127:
/* rule 127 can match eol */
YY_RULE_SETUP
#line 585 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                    "no space allowed before a methodcall dot, "
                    "or space expected after the '.' operator");
                    return '.';
                  }
	YY_BREAK


/* SCANSTR<<EOF>> and SCANMACRO<<EOF>> must be defined before <INTIAL><<EOF>>,
 * because they are %s states, which means they are inclusive, not exclusive states.
 * An inclusive scanner state will recognize all other tokens defined in <INITIAL>
 * state, but they are used here to override the action when scanning <INITIAL><<EOF>>.
 */

/* SCANSTR and SCANMACRO are states that are active when expanding a macro_const
 * or a macro, respectively. When expanding a macro_const, no new macro_table
 * is created, which acts as a local symbol table for parameters. Hence, there
 * are two different <<EOF>> actions for them.
 */


case YY_STATE_EOF(SCANSTR):
#line 607 "pir.l"
{ /* switch back from .macro_const buffer to file. */
                     lexer_state * const lexer = yypirget_extra(yyscanner);
                     yy_pop_state(yyscanner);
                     yypir_switch_to_buffer(lexer->buffer,yyscanner);
                   }
	YY_BREAK
case YY_STATE_EOF(SCANMACRO):
#line 613 "pir.l"
{ /* override the default <<EOF>> action; go back to normal state and
                      * switch back to the saved file.
                      */
                     lexer_state * const lexer = yypirget_extra(yyscanner);
                     macro_table * const table = pop_macro_table(lexer);

                     yy_pop_state(yyscanner); /* pop off the SCANMACRO scanner state */

                     /* switch back to whatever buffer we were scanning before we started
                      * to read the macro's buffer.
                      */
                     yypir_switch_to_buffer(table->prev_buff,yyscanner);

                     /* restore line number */
                     yypirset_lineno(table->lineno,yyscanner);

                     /* restore current scope id */
                     lexer->unique_id = table->scopeno;

                     delete_macro_table(table);

                   }
	YY_BREAK
case 128:
YY_RULE_SETUP
#line 636 "pir.l"
{ /* when scanning a macro body, the @ marker indicates the {IDENT} must
                          * be munged.
                          */
                            lexer_state * const lexer = yypirget_extra(yyscanner);
                            char const  * const id    = dupstrn(lexer, yytext, yyleng - 1);
                            yylval->sval              = munge_id(id, lexer);
                            return TK_IDENT;
                       }
	YY_BREAK
case YY_STATE_EOF(INITIAL):
#line 645 "pir.l"
{ /* end of file, stop scanning. */
                    yyterminate();
                  }
	YY_BREAK
case 129:
YY_RULE_SETUP
#line 649 "pir.l"
{ /* any character not covered in the rules above is an error. */
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
                               "unexpected character: '%c'", yytext[0]);
                  }
	YY_BREAK


/*****************************************************************************
*
*  the following rules implement the macro layer.
*
*****************************************************************************/



/********************** .macro_const ****************************************/


case 130:
YY_RULE_SETUP
#line 671 "pir.l"
{
                               yy_push_state(MACROCONST, yyscanner);
                               return TK_MACRO_CONST;
                             }
	YY_BREAK
case 131:
YY_RULE_SETUP
#line 676 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_IDENT;
                             }
	YY_BREAK
case 132:
YY_RULE_SETUP
#line 681 "pir.l"
{
                               /* only these tokens can be macro constant values */
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               yy_pop_state(yyscanner);
                               return TK_MACRO_CONST_VAL;
                             }
	YY_BREAK
case 133:
YY_RULE_SETUP
#line 688 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 134:
YY_RULE_SETUP
#line 689 "pir.l"
{
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "unknown character: '%c'", yytext[0]);
                             }
	YY_BREAK
case YY_STATE_EOF(MACROCONST):
#line 693 "pir.l"
{
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "read end of file during .macro_const definition");
                             }
	YY_BREAK


/**************** macro header (.macro <ident> <parameters> ) ***************/


case 135:
YY_RULE_SETUP
#line 704 "pir.l"
{ /* start a macro definition */
                               yy_push_state(MACROHEAD, yyscanner);
                               return TK_MACRO;
                             }
	YY_BREAK
case 136:
YY_RULE_SETUP
#line 709 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 137:
YY_RULE_SETUP
#line 710 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_IDENT;
                             }
	YY_BREAK
case 138:
YY_RULE_SETUP
#line 715 "pir.l"
{ return '('; }
	YY_BREAK
case 139:
YY_RULE_SETUP
#line 716 "pir.l"
{ return ')'; }
	YY_BREAK
case 140:
YY_RULE_SETUP
#line 717 "pir.l"
{ return ','; }
	YY_BREAK
case 141:
/* rule 141 can match eol */
YY_RULE_SETUP
#line 719 "pir.l"
{ /* a set of continuous newlines yields a single newline token. */
                               yy_pop_state(yyscanner); /* remove MACROHEAD state */
                               yy_push_state(MACROBODY, yyscanner); /* enter MACROBODY state */
                               return TK_NL;
                             }
	YY_BREAK


/******************************* macro expansion ***************************/

/*
 * Only identifiers, constants and registers are recognized.
 */


case 142:
YY_RULE_SETUP
#line 735 "pir.l"
{ /* .foo; it can be a macro, macro_local, or just $P0.foo(),
                                * but we need to check that.
                                */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               macro_def   * const macro = find_macro(lexer->macros, yytext + 1);

                               if (macro == NULL) { /* it's not a macro */

                                   /* it may be a .macro_local */
                                   macro_table *table = peek_macro_table(lexer);

                                   if (table->thismacro != NULL) { /* not expanding a macro */

                                       if (is_macro_local(table->thismacro, yytext + 1)) {
                                           yylval->sval = munge_id(yytext + 1, lexer);
                                           return TK_IDENT;
                                       }
                                       /* else fall through */
                                   }

                                   /* table->thismacro == NULL || is_macro_local() == FALSE */
                                   yyless(1); /* return all but first character */
                                   return '.';

                               }
                               else { /* it's a macro */
                                   /* fprintf(stderr, "found .ident: %s\n", yytext + 1); */

                                   /* store current buffer at this point, because we'll be
                                    * scanning a string buffer later on. Saving must be done
                                    * in the lexer specification, otherwise YY_CURRENT_BUFFER
                                    * cannot be used (it's a macro).
                                    */
                                   lexer->buffer = YY_CURRENT_BUFFER;

                                   /* if it's a .macro, (not .macro_const), then go into
                                    * MACROEXPAND state, to correctly parse the arguments.
                                    * For .macro_const, we don't want this, because a .macro_const
                                    * is expanded here, hidden from the parser.
                                    */
                                   if (macro->takes_args) {
                                       yylval->mval = macro;
                                       yy_push_state(MACROEXPAND, yyscanner);
                                       return TK_MACRO_IDENT;
                                   }
                                   else { /* expand the .macro_const here; no need for
                                           * adding this to the grammar. */
                                       /* goto SCANSTR state, and scan macro->body */
                                       yy_push_state(SCANSTR, yyscanner);
                                       yypir_scan_string(macro->body,yyscanner);
                                   }
                               }
                             }
	YY_BREAK
case 143:
YY_RULE_SETUP
#line 789 "pir.l"
{ /* expand a .macro_const or parameter in argument list */
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               macro_def   * const macro = find_macro(lexer->macros, yytext + 1);

                               if (macro) {
                                   /* .foo( .bar() ) is not allowed; that's too fancy for PIR. */
                                   if (macro->takes_args) {
                                      /*
                                       yypirerror(yyscanner, lexer, "cannot expand a .macro"
                                                  "in another .macro's argument list");

                                       */

                                       yylval->mval = macro;
                                       /* yy_push_state(MACROEXPAND, yyscanner);
                                       */
                                      return TK_MACRO_IDENT;
                                   }
                                   else { /* we do allow expansion of .macro_consts as macro args */
                                       lexer->buffer = YY_CURRENT_BUFFER;
                                       yy_push_state(STRINGEXPAND, yyscanner);
                                       yypir_scan_string(macro->body,yyscanner);
                                   }
                               }
                               else
                                   yypirerror(yyscanner, lexer, "'%s' is not a macro", yytext + 1);
                             }
	YY_BREAK
case 144:
YY_RULE_SETUP
#line 817 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_IDENT;
                             }
	YY_BREAK
case 145:
YY_RULE_SETUP
#line 822 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_OTHER;
                             }
	YY_BREAK
case 146:
YY_RULE_SETUP
#line 827 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 147:
YY_RULE_SETUP
#line 828 "pir.l"
{ return ','; }
	YY_BREAK
case 148:
YY_RULE_SETUP
#line 829 "pir.l"
{ return '('; }
	YY_BREAK
case 149:
YY_RULE_SETUP
#line 830 "pir.l"
{
                               yy_pop_state(yyscanner); /* leave MACROEXPAND state */
                               return ')';
                             }
	YY_BREAK
case 150:
YY_RULE_SETUP
#line 835 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_OTHER;
                             }
	YY_BREAK
case YY_STATE_EOF(STRINGEXPAND):
#line 840 "pir.l"
{
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               yy_pop_state(yyscanner);
                               yypir_switch_to_buffer(lexer->buffer,yyscanner);
                             }
	YY_BREAK
case 151:
YY_RULE_SETUP
#line 846 "pir.l"
{ return '{'; }
	YY_BREAK
case 152:
YY_RULE_SETUP
#line 847 "pir.l"
{ return '}'; }
	YY_BREAK
case 153:
/* rule 153 can match eol */
YY_RULE_SETUP
#line 849 "pir.l"
{ yylval->sval = "\n"; return TK_NL; }
	YY_BREAK
case 154:
YY_RULE_SETUP
#line 851 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "unknown character in macro expansion: %c", yytext[0]);
                             }
	YY_BREAK


/******************************** .macro_local *****************************/


case 155:
YY_RULE_SETUP
#line 862 "pir.l"
{ /* give a warning if the right flag is set */
                              /*
                              lexer_state * const lexer = yypirget_extra(yyscanner);
                              if (TEST_FLAG(lexer->flags, LEXER_FLAG_WARNINGS))
                                  pirwarning(lexer, yypirget_lineno(yyscanner),
                                             "use of .local in macros prevents multiple "
                                             "usage of macro in one sub. Use .macro_local instead");
                              return TK_LOCAL;
                              XXX we should disallow .local altogether in macros.
                              Doesn't make sense to use it.
                              */
                            }
	YY_BREAK
case 156:
YY_RULE_SETUP
#line 876 "pir.l"
{
                              yy_push_state(MACROLOCAL, yyscanner);
                              return TK_MACRO_LOCAL;
                            }
	YY_BREAK
case 157:
YY_RULE_SETUP
#line 881 "pir.l"
{ return TK_INT; }
	YY_BREAK
case 158:
YY_RULE_SETUP
#line 882 "pir.l"
{ return TK_PMC; }
	YY_BREAK
case 159:
YY_RULE_SETUP
#line 883 "pir.l"
{ return TK_NUM; }
	YY_BREAK
case 160:
YY_RULE_SETUP
#line 884 "pir.l"
{ return TK_STRING; }
	YY_BREAK
case 161:
YY_RULE_SETUP
#line 886 "pir.l"
{ /* normal .macro_local */
                              lexer_state * const lexer = yypirget_extra(yyscanner);
                              /* reserve space for {IDENT}, the @ marker and the NULL char. */
                              char * temp = (char *)mem_sys_allocate((yyleng + 2) * sizeof (char));
                              /* stick a special marker "@" so we can recognize this as a id
                               * that must be munged.
                               */
                              sprintf(temp, "%s@", yytext);
                              yylval->sval = temp;

                              /* declare it as a macro local symbol */
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                              return TK_MACRO_LOCAL_ID;
                            }
	YY_BREAK
case 162:
YY_RULE_SETUP
#line 901 "pir.l"
{ /* declare a .macro_local based on a parameter */
                              lexer_state * const lexer = yypirget_extra(yyscanner);

                              char * temp = (char *)mem_sys_allocate((yyleng + 2) * sizeof (char));
                              /* stick a "@" after, so it can be recognized later */
                              sprintf(temp, "%s@", yytext);
                              yylval->sval = temp;

                              /* declare the {IDENT} part as a local */
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext + 1));
                              return TK_MACRO_LOCAL_ID;

                            }
	YY_BREAK
case 163:
YY_RULE_SETUP
#line 915 "pir.l"
{ /* .$foo */
                              lexer_state * const lexer = yypirget_extra(yyscanner);
                              macro_table * const table = peek_macro_table(lexer);
                              macro_def   * const param = find_macro(table, yytext + 2);

                              if (param == NULL)
                                  yypirerror(yyscanner, lexer, "Cannot expand '%s', as it is "
                                             "not a macro parameter", yytext);
                              else {
                                  unsigned len = strlen(param->body);
                                  /* length includes quotes, so substract 2, + 1 for NULL char. */
                                  char *unquoted = (char *)mem_sys_allocate_zeroed(
                                                                        (len - 1) * sizeof (char));
                                  /* remove the quotes */
                                  if (param->body[0] != '"')
                                      yypirerror(yyscanner, lexer,
                                         "value of macro argument '%s' must be a quoted string",
                                         yytext);

                                  strncpy(unquoted, param->body + 1, len - 2);
                                  yylval->sval = munge_id(unquoted, lexer);

                                  mem_sys_free(unquoted);
                                  return TK_IDENT;

                              }

                            }
	YY_BREAK
case 164:
YY_RULE_SETUP
#line 944 "pir.l"
{ /* expanding a .macro_local using a macro parameter value */
                             lexer_state * const lexer     = yypirget_extra(yyscanner);
                             char  const * const paramname = dupstrn(lexer, yytext + 1, yyleng - 2);
                             macro_def   * const param     = find_macro(lexer->macros, paramname);

                             if (param == NULL) {
                                yypirerror(yyscanner, lexer, "Cannot expand %s; '%s' was not "
                                           "declared as a macro parameter", yytext, paramname);
                             }
                             else {
                                unsigned  len      = strlen(param->body);
                                char     *unquoted = (char *)mem_sys_allocate_zeroed(
                                                                      (len - 1) * sizeof (char));

                                /* unquote the string */
                                strncpy(unquoted, param->body + 1, len - 2);

                                yylval->sval       = munge_id(unquoted, lexer);
                                mem_sys_free(unquoted);
                             }
                             /* fprintf(stderr, "scanmacro:$id@: [%s]\n", yylval->sval); */

                             return TK_IDENT;
                           }
	YY_BREAK
case 165:
YY_RULE_SETUP
#line 969 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 166:
/* rule 166 can match eol */
YY_RULE_SETUP
#line 971 "pir.l"
{ /* newline after .macro_local <type> <ident> line */
                              yy_pop_state(yyscanner);
                              return TK_NL;
                            }
	YY_BREAK
case 167:
YY_RULE_SETUP
#line 976 "pir.l"
{ /* this state is only used for declaring .macro_locals */
                              yypirerror(yyscanner, yypirget_extra(yyscanner),
                                 "unknown character '%c' when declaring .macro_local", yytext[0]);
                            }
	YY_BREAK


/****************************** .macro_label ********************************/


case 168:
YY_RULE_SETUP
#line 986 "pir.l"
{
                              yy_push_state(MACROLABEL, yyscanner);
                              return TK_MACRO_LABEL;
                            }
	YY_BREAK
case 169:
YY_RULE_SETUP
#line 991 "pir.l"
{ /* if the "$" is there, it's a macro label using a macro
                               * parameter's value; otherwise it's a normal macro label
                               */
                              lexer_state * const lexer = yypirget_extra(yyscanner);
                              char * temp = (char *)pir_mem_allocate(lexer,
                                                                     (yyleng + 2) * sizeof (char));
                              /* stick a special marker "@" so we can recognize this as a label
                               * that must be munged.
                               */
                              strncpy(temp, yytext, yyleng - 1);
                              strcpy(temp + yyleng - 1, "@:");

                              yylval->sval = temp;
                              declare_macro_local(CURRENT_MACRO(lexer), dupstr(lexer, yytext));
                              return TK_MACRO_LABEL_ID;
                            }
	YY_BREAK
case 170:
/* rule 170 can match eol */
YY_RULE_SETUP
#line 1009 "pir.l"
{ /* the newline character after a ".macro_label $foo:" declaration */
                              yy_pop_state(yyscanner); /* leave MACROLABEL state */
                              return TK_NL;
                            }
	YY_BREAK
case 171:
YY_RULE_SETUP
#line 1015 "pir.l"
{ /* scan a label when expanding a buffer; declared as .macro_label */
                              lexer_state * const lexer = yypirget_extra(yyscanner);
                              char const  * const label = dupstrn(lexer, yytext, yyleng - 2);
                              yylval->sval = munge_id(label, lexer);
                              return TK_LABEL;
                            }
	YY_BREAK
case 172:
YY_RULE_SETUP
#line 1022 "pir.l"
{ /* scan a label when expanding macro; was a macro parameter */
                             lexer_state * const lexer     = yypirget_extra(yyscanner);
                             char const  * const paramname = dupstrn(lexer, yytext + 1, yyleng - 3);
                             macro_def   * const param     = find_macro(lexer->macros, paramname);

                             if (param == NULL) {
                                 yypirerror(yyscanner, lexer, "Cannot expand %s; '%s' was not "
                                            "declared as a macro parameter", yytext, paramname);
                             }
                             else {
                                 unsigned len   = strlen(param->body);
                                 char *unquoted = (char *)mem_sys_allocate_zeroed(
                                                                       (len - 1) * sizeof (char));
                                 /* unquote the string */
                                 if (param->body[0] != '"')
                                     yypirerror(yyscanner, lexer,
                                         "value of macro argument '%s' must be a quoted string",
                                         yytext);

                                 strncpy(unquoted, param->body + 1, len - 2);
                                 yylval->sval = munge_id(unquoted, lexer);
                                 mem_sys_free(unquoted);
                             }
                             return TK_LABEL;
                           }
	YY_BREAK


/*************************** macro body scanning (storing) ****************************/


case 173:
/* rule 173 can match eol */
YY_RULE_SETUP
#line 1055 "pir.l"
{ store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
	YY_BREAK
case 174:
YY_RULE_SETUP
#line 1057 "pir.l"
{
                               yy_pop_state(yyscanner); /* leave MACROBODY state */
                               return TK_ENDM;
                             }
	YY_BREAK
case 175:
YY_RULE_SETUP
#line 1062 "pir.l"
{ /* store everything else */
                               store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), yytext[0]);
                             }
	YY_BREAK
case YY_STATE_EOF(MACROBODY):
#line 1066 "pir.l"
{ /* catch run-away macro bodys */
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "read end of file while reading macro body");
                             }
	YY_BREAK
 /*
{WS}"."           {
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
                          "ambiguous '.'; must be enclosed in space on both sides or none at all.");
                    return TK_CONC;
                  }


"."{WS}           {
                    yypirerror(yyscanner, yypirget_extra(yyscanner),
                          "ambiguous '.'; must be enclosed in space on both sides or none at all.");
                    return TK_CONC;
                  }

       */



/* PASM tokens.
 *
 * do not mix with other tokens, using <state1,state2> notation.
 * This becomes unmanageable
 */

case 176:
YY_RULE_SETUP
#line 1098 "pir.l"
{ return ','; }
	YY_BREAK
case 177:
YY_RULE_SETUP
#line 1099 "pir.l"
{ return '['; }
	YY_BREAK
case 178:
YY_RULE_SETUP
#line 1100 "pir.l"
{ return ']'; }
	YY_BREAK
case 179:
YY_RULE_SETUP
#line 1102 "pir.l"
{ return TK_FLAG_MAIN; }
	YY_BREAK
case 180:
YY_RULE_SETUP
#line 1103 "pir.l"
{ return TK_FLAG_LOAD; }
	YY_BREAK
case 181:
YY_RULE_SETUP
#line 1104 "pir.l"
{ return TK_FLAG_INIT; }
	YY_BREAK
case 182:
YY_RULE_SETUP
#line 1105 "pir.l"
{ return TK_FLAG_ANON; }
	YY_BREAK
case 183:
YY_RULE_SETUP
#line 1106 "pir.l"
{ return TK_FLAG_POSTCOMP; }
	YY_BREAK
case 184:
YY_RULE_SETUP
#line 1107 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
	YY_BREAK
case 185:
YY_RULE_SETUP
#line 1109 "pir.l"
{ return TK_PCC_SUB; }
	YY_BREAK
case 186:
YY_RULE_SETUP
#line 1110 "pir.l"
{ return TK_LEX; }
	YY_BREAK
case 187:
YY_RULE_SETUP
#line 1111 "pir.l"
{ return TK_NAMESPACE; }
	YY_BREAK
case 188:
YY_RULE_SETUP
#line 1113 "pir.l"
{
                          yy_push_state(MACROHEAD, yyscanner);
                          return TK_MACRO;
                        }
	YY_BREAK
case 189:
YY_RULE_SETUP
#line 1118 "pir.l"
{
                          yy_push_state(MACROCONST, yyscanner);
                          return TK_MACRO_CONST;
                        }
	YY_BREAK
case 190:
YY_RULE_SETUP
#line 1123 "pir.l"
{ return TK_LINE; }
	YY_BREAK
case 191:
YY_RULE_SETUP
#line 1124 "pir.l"
{ return TK_FILE; }
	YY_BREAK
case 192:
YY_RULE_SETUP
#line 1127 "pir.l"
{ /* macro expansion in PASM mode. */
                          lexer_state * const lexer = yypirget_extra(yyscanner);
                          macro_def   * const macro = find_macro(lexer->macros, yytext + 1);

                          if (macro == NULL) { /* it's not a macro */
                              yypirerror(yyscanner, lexer, "cannot find macro '%s'", yytext + 1);
                          }
                          else { /* it's a macro */
                              /* store current buffer at this point, because we'll be
                               * scanning a string buffer later on. Saving must be done
                               * in the lexer specification, otherwise YY_CURRENT_BUFFER
                               * cannot be used (it's a macro).
                               */
                              lexer->buffer = YY_CURRENT_BUFFER;

                              /* if it's a .macro, (not .macro_const), then go into
                               * MACROEXPAND state, to correctly parse the arguments.
                               * For .macro_const, we don't want this, because a .macro_const
                               * is expanded here, hidden from the parser.
                               */
                              if (macro->takes_args) {
                                  yylval->mval = macro;
                                  yy_push_state(MACROEXPAND, yyscanner);
                                  return TK_MACRO_IDENT;
                              }
                              else { /* expand the .macro_const here; no need for
                                      * adding this to the grammar. */
                                  /* goto SCANSTR state, and scan macro->body */
                                  yy_push_state(SCANSTR, yyscanner);
                                  yypir_scan_string(macro->body,yyscanner);
                              }
                          }
                        }
	YY_BREAK
case 193:
YY_RULE_SETUP
#line 1161 "pir.l"
{ /* a label in PASM */
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                          return TK_LABEL;
                        }
	YY_BREAK
case 194:
YY_RULE_SETUP
#line 1166 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                     "symbolic registers are not allowed in PASM mode");
                        }
	YY_BREAK
case 195:
YY_RULE_SETUP
#line 1169 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_PREG; }
	YY_BREAK
case 196:
YY_RULE_SETUP
#line 1170 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_NREG; }
	YY_BREAK
case 197:
YY_RULE_SETUP
#line 1171 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_IREG; }
	YY_BREAK
case 198:
YY_RULE_SETUP
#line 1172 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_SREG; }
	YY_BREAK
case 199:
YY_RULE_SETUP
#line 1174 "pir.l"
{ /* can be a parrot op or a label; the check is done in the parser. */
                          yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                          return TK_IDENT;
                        }
	YY_BREAK
case 200:
YY_RULE_SETUP
#line 1179 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
	YY_BREAK
case 201:
YY_RULE_SETUP
#line 1180 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 202:
YY_RULE_SETUP
#line 1181 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 203:
YY_RULE_SETUP
#line 1182 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 204:
YY_RULE_SETUP
#line 1183 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
	YY_BREAK
case 205:
YY_RULE_SETUP
#line 1185 "pir.l"
{ /* copy the string, remove the quotes. */
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                          return TK_STRINGC;
                        }
	YY_BREAK
case 206:
YY_RULE_SETUP
#line 1190 "pir.l"
{ /* ignore whitespace */ }
	YY_BREAK
case 207:
/* rule 207 can match eol */
YY_RULE_SETUP
#line 1192 "pir.l"
{ return TK_NL; }
	YY_BREAK
case 208:
YY_RULE_SETUP
#line 1194 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                     "unrecognized character: %c", yytext[0]);
                        }
	YY_BREAK
case YY_STATE_EOF(PASM):
#line 1197 "pir.l"
{ yyterminate(); }
	YY_BREAK
case 209:
YY_RULE_SETUP
#line 1199 "pir.l"
ECHO;
	YY_BREAK
#line 3723 "pirlexer.c"
case YY_STATE_EOF(MACROHEAD):
case YY_STATE_EOF(MACROLOCAL):
case YY_STATE_EOF(MACROLABEL):
case YY_STATE_EOF(MACROEXPAND):
case YY_STATE_EOF(SPECIALSTART):
	yyterminate();

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

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

		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yypirlex().  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.
			 */
			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

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

			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state( yyscanner );

			/* 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 , yyscanner);

			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;

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

			else
				{
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
				yy_cp = yyg->yy_last_accepting_cpos;
				yy_current_state = yyg->yy_last_accepting_state;
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer( yyscanner ) )
			{
			case EOB_ACT_END_OF_FILE:
				{
				yyg->yy_did_buffer_switch_on_eof = 0;

				if ( yypirwrap(yyscanner ) )
					{
					/* 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.
					 */
					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! yyg->yy_did_buffer_switch_on_eof )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				yyg->yy_c_buf_p =
					yyg->yytext_ptr + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state( yyscanner );

				yy_cp = yyg->yy_c_buf_p;
				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
				goto yy_match;

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

				yy_current_state = yy_get_previous_state( yyscanner );

				yy_cp = yyg->yy_c_buf_p;
				yy_bp = yyg->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 yypirlex */
/* %ok-for-header */

/* %if-c++-only */
/* %not-for-header */

/* %ok-for-header */

/* %endif */

/* 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
 */
/* %if-c-only */
static int yy_get_next_buffer (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = yyg->yytext_ptr;
	register int number_to_move, i;
	int ret_val;

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

	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( yyg->yy_c_buf_p - yyg->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) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;

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

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

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

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

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

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

			if ( b->yy_is_our_buffer )
				{
				yy_size_t 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. */
					yypirrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
				}
			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" );

			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
		}

	if ( yyg->yy_n_chars == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yypirrestart(yyin  ,yyscanner);
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yypirrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
	}

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

	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];

	return ret_val;
}

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

/* %if-c-only */
/* %not-for-header */

    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register yy_state_type yy_current_state;
	register char *yy_cp;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

/* %% [15.0] code to get the start state into yy_current_state goes here */
	yy_current_state = yyg->yy_start;

	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
		{
/* %% [16.0] code to find the next state goes here */
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			yyg->yy_last_accepting_state = yy_current_state;
			yyg->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 >= 825 )
				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 );
 */
/* %if-c-only */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register int yy_is_jam;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
/* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
	register char *yy_cp = yyg->yy_c_buf_p;

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		yyg->yy_last_accepting_state = yy_current_state;
		yyg->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 >= 825 )
			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 == 824);

	return yy_is_jam ? 0 : yy_current_state;
}

/* %if-c-only */

/* %endif */

/* %if-c-only */
#ifndef YY_NO_INPUT
#ifdef __cplusplus
    static int yyinput (yyscan_t yyscanner)
#else
    static int input  (yyscan_t yyscanner)
#endif

/* %endif */
/* %if-c++-only */
/* %endif */
{
	int c;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	*yyg->yy_c_buf_p = yyg->yy_hold_char;

	if ( *yyg->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 ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
			/* This was really a NUL. */
			*yyg->yy_c_buf_p = '\0';

		else
			{ /* need more input */
			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
			++yyg->yy_c_buf_p;

			switch ( yy_get_next_buffer( yyscanner ) )
				{
				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. */
					yypirrestart(yyin ,yyscanner);

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( yypirwrap(yyscanner ) )
						return 0;

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

				case EOB_ACT_CONTINUE_SCAN:
					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
					break;
				}
			}
		}

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

/* %% [19.0] update BOL and yylineno */
	if ( c == '\n' )
		   
    do{ yylineno++;
        yycolumn=0;
    }while(0)
;

	return c;
}
/* %if-c-only */
#endif	/* ifndef YY_NO_INPUT */
/* %endif */

/** Immediately switch to a different input stream.
 * @param input_file A readable stream.
 * @param yyscanner The scanner object.
 * @note This function does not reset the start condition to @c INITIAL .
 */
/* %if-c-only */
    void yypirrestart  (FILE * input_file , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	if ( ! YY_CURRENT_BUFFER ){
        yypirensure_buffer_stack (yyscanner);
		YY_CURRENT_BUFFER_LVALUE =
            yypir_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
	}

	yypir_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
	yypir_load_buffer_state(yyscanner );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * @param yyscanner The scanner object.
 */
/* %if-c-only */
    void yypir_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypirpop_buffer_state();
	 *		yypirpush_buffer_state(new_buffer);
     */
	yypirensure_buffer_stack (yyscanner);
	if ( YY_CURRENT_BUFFER == new_buffer )
		return;

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

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	yypir_load_buffer_state(yyscanner );

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

/* %if-c-only */
static void yypir_load_buffer_state  (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
	yyg->yy_hold_char = *yyg->yy_c_buf_p;
}

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * @param yyscanner The scanner object.
 * @return the allocated buffer state.
 */
/* %if-c-only */
    YY_BUFFER_STATE yypir_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yypir_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 *) yypiralloc(b->yy_buf_size + 2 ,yyscanner );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yypir_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yypir_init_buffer(b,file ,yyscanner);

	return b;
}

/** Destroy the buffer.
 * @param b a buffer created with yypir_create_buffer()
 * @param yyscanner The scanner object.
 */
/* %if-c-only */
    void yypir_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	if ( ! b )
		return;

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

	if ( b->yy_is_our_buffer )
		yypirfree((void *) b->yy_ch_buf ,yyscanner );

	yypirfree((void *) b ,yyscanner );
}

/* %if-c-only */

/* %endif */

/* %if-c++-only */
/* %endif */

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a yypirrestart() or at EOF.
 */
/* %if-c-only */
    static void yypir_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */

{
	int oerrno = errno;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	yypir_flush_buffer(b ,yyscanner);

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

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

/* %if-c-only */

        b->yy_is_interactive = 0;
    
/* %endif */
/* %if-c++-only */
/* %endif */
	errno = oerrno;
}

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * @param yyscanner The scanner object.
 */
/* %if-c-only */
    void yypir_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	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 )
		yypir_load_buffer_state(yyscanner );
}

/* %if-c-or-c++ */
/** Pushes the new state onto the stack. The new state becomes
 *  the current state. This function will allocate the stack
 *  if necessary.
 *  @param new_buffer The new state.
 *  @param yyscanner The scanner object.
 */
/* %if-c-only */
void yypirpush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if (new_buffer == NULL)
		return;

	yypirensure_buffer_stack(yyscanner);

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

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

	/* copied from yypir_switch_to_buffer. */
	yypir_load_buffer_state(yyscanner );
	yyg->yy_did_buffer_switch_on_eof = 1;
}
/* %endif */

/* %if-c-or-c++ */
/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  @param yyscanner The scanner object.
 */
/* %if-c-only */
void yypirpop_buffer_state (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if (!YY_CURRENT_BUFFER)
		return;

	yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if (yyg->yy_buffer_stack_top > 0)
		--yyg->yy_buffer_stack_top;

	if (YY_CURRENT_BUFFER) {
		yypir_load_buffer_state(yyscanner );
		yyg->yy_did_buffer_switch_on_eof = 1;
	}
}
/* %endif */

/* %if-c-or-c++ */
/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
/* %if-c-only */
static void yypirensure_buffer_stack (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	yy_size_t num_to_alloc;
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

	if (!yyg->yy_buffer_stack) {

		/* First allocation is just for 2 elements, since we don't know if this
		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
		 * immediate realloc on the next call.
         */
		num_to_alloc = 1;
		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypiralloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								, yyscanner);
		if ( ! yyg->yy_buffer_stack )
			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );
								  
		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
				
		yyg->yy_buffer_stack_max = num_to_alloc;
		yyg->yy_buffer_stack_top = 0;
		return;
	}

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

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

		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
		yyg->yy_buffer_stack = (struct yy_buffer_state**)yypirrealloc
								(yyg->yy_buffer_stack,
								num_to_alloc * sizeof(struct yy_buffer_state*)
								, yyscanner);
		if ( ! yyg->yy_buffer_stack )
			YY_FATAL_ERROR( "out of dynamic memory in yypirensure_buffer_stack()" );

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

/* %if-c-only */
/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * @param yyscanner The scanner object.
 * @return the newly allocated buffer state object. 
 */
YY_BUFFER_STATE yypir_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
{
	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) yypiralloc(sizeof( struct yy_buffer_state ) ,yyscanner );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yypir_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;

	yypir_switch_to_buffer(b ,yyscanner );

	return b;
}
/* %endif */

/* %if-c-only */
/** Setup the input buffer state to scan a string. The next call to yypirlex() will
 * scan from a @e copy of @a str.
 * @param yystr a NUL-terminated string to scan
 * @param yyscanner The scanner object.
 * @return the newly allocated buffer state object.
 * @note If you want to scan bytes that may contain NUL values, then use
 *       yypir_scan_bytes() instead.
 */
YY_BUFFER_STATE yypir_scan_string (yyconst char * yystr , yyscan_t yyscanner)
{
    
	return yypir_scan_bytes(yystr,strlen(yystr) ,yyscanner);
}
/* %endif */

/* %if-c-only */
/** Setup the input buffer state to scan the given bytes. The next call to yypirlex() will
 * scan from a @e copy of @a bytes.
 * @param bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * @param yyscanner The scanner object.
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE yypir_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n, i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) yypiralloc(n ,yyscanner );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yypir_scan_bytes()" );

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

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

	b = yypir_scan_buffer(buf,n ,yyscanner);
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yypir_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 */

/* %if-c-only */
    static void yy_push_state (int  new_state , yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth )
		{
		yy_size_t new_size;

		yyg->yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yyg->yy_start_stack_depth * sizeof( int );

		if ( ! yyg->yy_start_stack )
			yyg->yy_start_stack = (int *) yypiralloc(new_size ,yyscanner );

		else
			yyg->yy_start_stack = (int *) yypirrealloc((void *) yyg->yy_start_stack,new_size ,yyscanner );

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

	yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
}

/* %if-c-only */
    static void yy_pop_state  (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	if ( --yyg->yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yyg->yy_start_stack[yyg->yy_start_stack_ptr]);
}

/* %if-c-only */
    static int yy_top_state  (yyscan_t yyscanner)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
	return yyg->yy_start_stack[yyg->yy_start_stack_ptr - 1];
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

/* %if-c-only */
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
{
    	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}
/* %endif */
/* %if-c++-only */
/* %endif */

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

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

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

/* %if-c-only */
/* %if-reentrant */

/** Get the user-defined data for this scanner.
 * @param yyscanner The scanner object.
 */
YY_EXTRA_TYPE yypirget_extra  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyextra;
}

/* %endif */

/** Get the current line number.
 * @param yyscanner The scanner object.
 */
int yypirget_lineno  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    
        if (! YY_CURRENT_BUFFER)
            return 0;
    
    return yylineno;
}

/** Get the current column number.
 * @param yyscanner The scanner object.
 */
int yypirget_column  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    
        if (! YY_CURRENT_BUFFER)
            return 0;
    
    return yycolumn;
}

/** Get the input stream.
 * @param yyscanner The scanner object.
 */
FILE *yypirget_in  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyin;
}

/** Get the output stream.
 * @param yyscanner The scanner object.
 */
FILE *yypirget_out  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyout;
}

/** Get the length of the current token.
 * @param yyscanner The scanner object.
 */
yy_size_t yypirget_leng  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yyleng;
}

/** Get the current token.
 * @param yyscanner The scanner object.
 */

char *yypirget_text  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yytext;
}

/* %if-reentrant */

/** Set the user-defined data. This data is never touched by the scanner.
 * @param user_defined The data to be associated with this scanner.
 * @param yyscanner The scanner object.
 */
void yypirset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyextra = user_defined ;
}

/* %endif */

/** Set the current line number.
 * @param line_number
 * @param yyscanner The scanner object.
 */
void yypirset_lineno (int  line_number , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

        /* lineno is only valid if an input buffer exists. */
        if (! YY_CURRENT_BUFFER )
           yy_fatal_error( "yypirset_lineno called with no buffer" , yyscanner); 
    
    yylineno = line_number;
}

/** Set the current column.
 * @param line_number
 * @param yyscanner The scanner object.
 */
void yypirset_column (int  column_no , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

        /* column is only valid if an input buffer exists. */
        if (! YY_CURRENT_BUFFER )
           yy_fatal_error( "yypirset_column called with no buffer" , yyscanner); 
    
    yycolumn = column_no;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param in_str A readable stream.
 * @param yyscanner The scanner object.
 * @see yypir_switch_to_buffer
 */
void yypirset_in (FILE *  in_str , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyin = in_str ;
}

void yypirset_out (FILE *  out_str , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yyout = out_str ;
}

int yypirget_debug  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yy_flex_debug;
}

void yypirset_debug (int  bdebug , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yy_flex_debug = bdebug ;
}

/* %endif */

/* %if-reentrant */
/* Accessor methods for yylval and yylloc */

/* %if-bison-bridge */

YYSTYPE * yypirget_lval  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    return yylval;
}

void yypirset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    yylval = yylval_param;
}

/* %endif */

/* User-visible API */

/* yypirlex_init is special because it creates the scanner itself, so it is
 * the ONLY reentrant function that doesn't take the scanner as the last argument.
 * That's why we explicitly handle the declaration, instead of using our macros.
 */

int yypirlex_init(yyscan_t* ptr_yy_globals)

{
    if (ptr_yy_globals == NULL){
        errno = EINVAL;
        return 1;
    }

    *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), NULL );

    if (*ptr_yy_globals == NULL){
        errno = ENOMEM;
        return 1;
    }

    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));

    return yy_init_globals ( *ptr_yy_globals );
}

/* yypirlex_init_extra has the same functionality as yypirlex_init, but follows the
 * convention of taking the scanner as the last argument. Note however, that
 * this is a *pointer* to a scanner, as it will be allocated by this call (and
 * is the reason, too, why this function also must handle its own declaration).
 * The user defined value in the first argument will be available to yypiralloc in
 * the yyextra field.
 */

int yypirlex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )

{
    struct yyguts_t dummy_yyguts;

    yypirset_extra (yy_user_defined, &dummy_yyguts);

    if (ptr_yy_globals == NULL){
        errno = EINVAL;
        return 1;
    }
	
    *ptr_yy_globals = (yyscan_t) yypiralloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
	
    if (*ptr_yy_globals == NULL){
        errno = ENOMEM;
        return 1;
    }
    
    /* By setting to 0xAA, we expose bugs in
    yy_init_globals. Leave at 0x00 for releases. */
    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
    
    yypirset_extra (yy_user_defined, *ptr_yy_globals);
    
    return yy_init_globals ( *ptr_yy_globals );
}

/* %endif if-c-only */

/* %if-c-only */
static int yy_init_globals (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
    /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from yypirlex_destroy(), so don't allocate here.
     */

    yyg->yy_buffer_stack = 0;
    yyg->yy_buffer_stack_top = 0;
    yyg->yy_buffer_stack_max = 0;
    yyg->yy_c_buf_p = (char *) 0;
    yyg->yy_init = 0;
    yyg->yy_start = 0;

    yyg->yy_start_stack_ptr = 0;
    yyg->yy_start_stack_depth = 0;
    yyg->yy_start_stack =  NULL;

/* Defined in main.c */
#ifdef YY_STDINIT
    yyin = stdin;
    yyout = stdout;
#else
    yyin = (FILE *) 0;
    yyout = (FILE *) 0;
#endif

    /* For future reference: Set errno on error, since we are called by
     * yypirlex_init()
     */
    return 0;
}
/* %endif */

/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
/* yypirlex_destroy is for both reentrant and non-reentrant scanners. */
int yypirlex_destroy  (yyscan_t yyscanner)
{
    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		yypir_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		yypirpop_buffer_state(yyscanner);
	}

	/* Destroy the stack itself. */
	yypirfree(yyg->yy_buffer_stack ,yyscanner);
	yyg->yy_buffer_stack = NULL;

    /* Destroy the start condition stack. */
        yypirfree(yyg->yy_start_stack ,yyscanner );
        yyg->yy_start_stack = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * yypirlex() is called, initialization will occur. */
    yy_init_globals( yyscanner);

/* %if-reentrant */
    /* Destroy the main struct (reentrant only). */
    yypirfree ( yyscanner , yyscanner );
    yyscanner = NULL;
/* %endif */
    return 0;
}
/* %endif */

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

/* %if-tables-serialization definitions */
/* %define-yytables   The name for this specific scanner's tables. */
#define YYTABLES_NAME "yytables"
/* %endif */

/* %ok-for-header */

#line 1199 "pir.l"





/*

=head1 FUNCTIONS

Helper functions for macro expansion. These function are only used by the lexer,
so keep them local to this file.

=over 4

=cut

*/


/*

=item C<void
init_scanner_state(yyscan_t yyscanner)>

Initializes C<yyscanner> to the SPECIALSTART state, which can then decide
whether to scan PASM or PIR tokens. State identifiers (e.g. SPECIALSTART)
are not exported (private to the generated lexer), so this function wraps
the call to yy_push_state().

=cut

*/
void
init_scanner_state(yyscan_t yyscanner) {
    yy_push_state(SPECIALSTART, yyscanner);
}


/*

=item C<static macro_table *
peek_macro_table(lexer_state * const lexer)>

Return the top of the macro_table stack; this is the currently
active macro_table object.

=cut

*/
PARROT_WARN_UNUSED_RESULT
static macro_table *
peek_macro_table(lexer_state * const lexer) {
    return lexer->macros;
}

/*

=item C<static char *
munge_id(char const * const id, lexer_state * const lexer)>

Generate an identifier based on a macro label or local expansion.

A label expansion looks like ".$<LABEL>", from which a label identifier is
generated, formatted as: "$macro_<MACRO>_<LABEL>_<SCOPE>".

In this format, C<MACRO> refers to the macro name of the macro in which
the .macro_local or .macro_label was defined; C<LABEL> refers to the runtime
value of the label or local variable (this can be a macro's argument's value).
C<SCOPE> refers to the unique scope ID of this macro expansion.

=cut

*/
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
static char *
munge_id(char const * const id, lexer_state * const lexer) {
    /* the format of the generated label; note that it has a $ character,
     * which is not allowed in normal PIR identifiers. This way, you cannot
     * use the generated names outside of macros. We dont't want people
     * write outside of macros:
     *
     *   macro_foo_bar_1 = 42
     *
     * Hence the $ character.
     */
    char       *       munged_id;
    char const * const format        = "$macro_%s_%s_%d"; /* 15 characters */
    int  const         format_length = strlen(format);


    macro_table *table = peek_macro_table(lexer);

    /* calculate length of the generated label: length of macro name,
     * plus length of label name.
     */
    int length = format_length;

    /* add length of the macro name */
    length += strlen(table->thismacro->name);

    /* add length of unique id to total length */
    length += lexer->num_digits;

    /* add length of the actual label id */
    length += strlen(id);

    munged_id = (char *)pir_mem_allocate_zeroed(lexer, (length + 1) * sizeof (char));

    sprintf(munged_id, format, table->thismacro->name, id, lexer->unique_id);

    return munged_id;
}



/*

=item C<static macro_table *
pop_macro_table(lexer_state * const lexer)>

Pop off the current macro symbol table from the
macro symbol table stack and return it.

=cut

*/
PARROT_IGNORABLE_RESULT
PARROT_CANNOT_RETURN_NULL
static macro_table *
pop_macro_table(lexer_state * const lexer) {
    macro_table *popped = lexer->macros;
    lexer->macros       = popped->prev;
    return popped;
}


/*

=item C<static void
push_macro_table(lexer_state * const lexer, macro_table * const table)>

Push macro_table C<table> onto the macro scope stack. Any attempt to find
a macro definition will start in C<table>. If not found, the stack will be walked
down (recursing into older entries).

=cut

*/
static void
push_macro_table(lexer_state * const lexer, macro_table * const table) {
    table->prev   = lexer->macros;
    lexer->macros = table;
}

/*

=item C<static void
update_unique_id(lexer_state * const lexer)>

Update the unique ID generator; the number of characters that the new number
is taking in a string is recalculated, as the unique IDs are used in string
context.

=cut

*/
static void
update_unique_id(lexer_state * const lexer) {
    /* each expansion has a unique id that is used for label/local munging */
    ++lexer->id_gen;
    /* Count number of digits:
     * log10 returns a double, get the part before the dot (so, "3.14" -> "3")
     * using the floor() function.
     * log10(1000) -> 3, so add 1 more digit.
     */
    lexer->num_digits = (int)floor(log10(lexer->id_gen)) + 1;
}


/*

=item C<static void
expand(yyscan_t yyscanner, macro_def * const macro, list * args, lexer_state * const lexer)>

Expand the specified macro (or constant). The current yy_buffer_state is saved, as well
as the current scope ID (for macro expansions; each expansion has its own unique scope ID);
as well as the current line number. The macro_table, which defines the macro parameters/arguments,
gets a reference to the macro definition that is being expanded; that's the C<thismacro> field
of the C<macro_table> structure.

An argument count check is done to make sure there's exactly enough arguments for the defined
parameters. Then, the macro definition's body (a string buffer) is scanned (instead of the
file that we were scanning).

The function returns the body of the macro being expanded.

=cut

*/
char *
expand_macro(yyscan_t yyscanner, macro_def * const macro, macro_param * args) {
    /* construct a map data structure that maps the argument values to the parameter names */
    /* enter the parameters as temporary symbols (.macro_const) */
    lexer_state *lexer        = yypirget_extra(yyscanner);
    macro_table *macro_params = new_macro_table(lexer->macros);
    macro_param *params       = macro->parameters;

    /* push the new macro_table, acting as a local symbol scope */
    push_macro_table(lexer, macro_params);

    /* save the current line, unique_id and current buffer in the macro_table,
     * so they can be restored when the macro_table is popped from the stack.
     */
    macro_params->lineno     = yypirget_lineno(yyscanner);
    /* save current scope id */
    macro_params->scopeno    = lexer->unique_id;
    macro_params->prev_buff  = lexer->buffer; /* cannot use YY_CURRENT_BUFFER here, but it was
                                                 stored in lexer->buffer anyway, so store that. */
    macro_params->thismacro  = macro; /* let the macro_table point to the macro-definition that
                                         is being expanded; this allows access to macro name etc. */

    while (params && args) {
        new_macro_const(macro_params, params->name, args->name, yypirget_lineno(yyscanner));
      /*  fprintf(stderr, "defining parameter '%s' as '%s'\n", params->name, args->name); */
        params = params->next;
        args   = args->next;
    }

    /* check for both conditions; either can be non-null, indicating an error.
     * If both are null, then all went ok.
     */
    if (params != NULL)  /* args must be null, so too few arguments */
        yypirerror(yyscanner, lexer, "Too few arguments for macro expansion '%s'", macro->name);

    if (args != NULL)  /* params must be null, so too many arguments */
        yypirerror(yyscanner, lexer, "Too many arguments for macro expansion '%s'", macro->name);


    update_unique_id(lexer);
    lexer->unique_id = lexer->id_gen;

    /* switch to SCANMACRO state, and tell the lexer to get
     * next tokens from the string buffer by calling yypir_scan_string().
     */
    yy_push_state(SCANMACRO, yyscanner);
    yypir_scan_string(macro->body,yyscanner);
    /* update the line number in the yyscanner so that any error message occuring
     * refers to the bad line in the macro definition. Note that this must done
     * **after** the call to yypir_scan_string(), which sets the line number to 1.
     */
    yypirset_lineno(macro->linedefined,yyscanner);

    return macro->body;
}


/* override Flex generated memory functions: all memory allocated
 * by Flex goes through Parrot's memory allocators.
 */

/*

=item C<void *
yypiralloc(yy_size_t bytes,yyscan_t yyscanner)>

Allocate C<bytes> of memory; the C<yyscanner> argument is not used.

=cut

*/
PARROT_MALLOC
void *
yypiralloc(yy_size_t bytes,yyscan_t yyscanner) {
    return mem_sys_allocate(bytes);
}

/*

=item C<void *
yypirrealloc(void * ptr,yy_size_t bytes,yyscan_t yyscanner)>

Reallocate memory pointed to by C<ptr>. The new memory region is C<bytes> in size;
the C<yyscanner> argument is not used.

=cut

*/
void *
yypirrealloc(void * ptr,yy_size_t bytes,yyscan_t yyscanner) {
    return mem_sys_realloc(ptr, bytes);
}

/*

=item C<void
yypirfree(void *ptr,yyscan_t yyscanner)>

Free memory pointed to by C<ptr>. The C<yyscanner> argument is not used,
but part of the signature as it is a Flex-generated function.

=cut

*/
void
yypirfree(void *ptr,yyscan_t yyscanner) {
    mem_sys_free(ptr);
}




/*

=back

=cut

*/

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */

