#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

/* %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_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

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

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

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

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

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */

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

    int yy_buffer_status;

#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
    /* When an EOF's been seen but there's still some text to process
     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
     * shouldn't try reading from the input source any more.  We might
     * still have a bunch of tokens to match, though, because of
     * possible backing-up.
     *
     * When we actually see the EOF, we change the status to "new"
     * (via 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,int 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 210
#define YY_END_OF_BUFFER 211
/* 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[829] =
    {   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,  211,  130,    2,    4,    2,   25,
      130,  130,  130,   22,  130,  130,   28,   29,   23,   21,
       30,   27,  130,   24,  123,  123,  130,   35,   15,   34,
       16,  121,  121,   31,   32,  121,  121,  121,  121,  121,
      121,  130,   26,  210,  137,  142,  137,  139,  140,  141,
      138,  176,  174,  176,  176,  168,  166,  167,  166,  168,
      162,  162,  162,  162,  162,  171,  210,  210,  210,  155,
      147,  154,  147,  155,  155,  155,  149,  150,  155,  148,

      155,  151,  151,  145,  152,  153,  135,  134,  135,  135,
      135,  135,  135,  133,  133,  132,  130,  130,  121,  121,
      121,  121,  121,  121,  121,  121,  210,  210,  210,  210,
      151,  151,    1,  209,  207,  208,  207,  209,  209,  209,
      209,  177,  209,  202,  202,  209,  200,  200,  200,  200,
      200,  178,  179,    0,    4,    4,   12,    0,  111,    0,
        0,    3,    0,    0,    0,    0,    0,   40,   18,   43,
        0,  112,    0,   39,    0,  123,   36,   37,  127,  122,
       46,  127,  127,  143,  127,  127,  127,  127,  127,  127,
      127,  127,  127,  127,  127,  127,  127,  127,  127,   17,

       38,  122,    0,    0,    0,    0,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,    9,   13,
       11,   10,   14,    8,    0,  121,  119,  120,  121,   47,
      121,  121,  121,  121,  121,   42,   19,   45,   20,  142,
      142,  138,  174,  174,    0,    0,    0,  167,  167,  163,
      162,  162,  162,  162,  162,  171,  171,    0,    0,  170,
      154,  154,    0,  151,    0,    0,    0,    0,  151,  151,
      144,  151,    0,    0,    0,    0,  145,    0,  133,    0,
        0,    0,    0,  133,  133,  133,    0,    0,    0,    0,
      132,    0,    0,    0,    0,    0,  127,  121,  129,  120,

      121,   47,  121,  121,  121,  121,  121,  208,  208,    0,
      206,    0,    0,    0,    0,  202,  201,  193,  193,  193,
      193,  193,  193,  201,    0,    0,    0,    0,    0,    0,
        0,    0,    0,  200,  194,  198,  197,  196,  199,  128,
       33,    3,  118,  117,  115,  116,   41,    0,  143,  143,
      143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
      143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
      143,  143,   44,  122,  125,    0,  122,  126,  124,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,    7,    6,

        0,    0,    0,  121,   51,  121,   52,   53,  121,  121,
        0,    0,    0,  163,  158,  160,  159,  162,  146,    0,
      144,  151,  151,    0,  151,  151,  151,  133,    0,  133,
      133,    0,  133,  133,  133,    0,  165,  118,  117,  115,
      116,  164,  172,  121,   51,  121,   52,   53,  121,  121,
      195,    0,  193,  193,  193,  193,  193,  193,  193,  201,
      204,    0,  201,  205,  203,    0,    0,    0,    0,    0,
        0,    0,  122,   62,  143,  143,  143,  143,   58,  143,
      143,  143,  143,   65,  143,  143,  143,  143,  143,  143,
      143,  143,  143,  143,   82,  143,  143,  110,  110,  110,

      110,  110,  110,   95,  110,  110,  110,  110,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,    5,    0,
      113,    0,    0,    0,   48,   50,  121,  121,    0,    0,
        0,  162,    0,  151,    0,  133,  173,  164,   48,   50,
      121,  121,    0,  201,  193,  187,  193,  193,  193,  193,
        0,    0,    0,    0,    0,    0,  143,  143,  143,   76,
      143,  143,   87,   59,  143,  143,  143,   66,  143,  143,
      143,  143,  143,  143,  143,  143,  143,  143,  143,   88,
      107,  110,   89,  110,  110,   90,  110,   93,  110,  110,
      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,

        0,  121,  121,  175,    0,    0,  162,  121,  121,  192,
      191,  193,  193,  193,  183,    0,  182,  181,  180,    0,
      143,  143,  143,   57,  143,  143,  143,  143,  143,  143,
      143,   68,  136,  143,  143,  143,   72,  143,  143,  143,
      143,  143,   83,  110,  110,  110,  110,  110,   98,  106,
      110,  110,  110,   96,  110,  110,   99,  110,  110,    0,
      114,    0,   54,   49,  156,    0,  161,   54,   49,  189,
      193,  193,    0,    0,  143,  143,  143,  143,  143,  143,
      143,  143,  143,  143,  143,  143,  143,  143,   81,  143,
      143,  143,  143,  110,  110,  110,  110,   94,  110,  110,

      110,  110,  105,  110,   97,    0,  193,  193,  193,    0,
        0,   63,  143,  143,  143,  143,  143,  143,  143,  143,
      143,  143,   67,  143,  143,  143,  143,  143,   56,  143,
      143,  143,  110,  110,  110,  110,  101,  110,  110,  110,
      110,    0,  193,  193,  186,    0,    0,   55,  143,  143,
      143,   77,  143,  143,  143,  143,   64,  143,  143,  143,
      143,  143,   71,  143,  143,   86,  110,  110,  108,  110,
      104,  103,   91,  110,    0,    0,  193,  193,    0,  184,
      143,  143,  143,  143,   79,  143,  143,  143,  143,  143,
       69,   70,  143,   85,   92,  110,  109,  110,    0,    0,

      193,  188,  185,   73,  143,  143,   78,   80,  143,  143,
      143,  143,   84,  100,  102,    0,    0,  193,  143,   75,
       60,   61,  131,  169,  157,  190,   74,    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[889] =
    {   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, 2396, 2397, 2376,  151,  537, 2366,
      635,  152,  122, 2365,  530, 2380, 2397, 2397,  529,  624,
     2397,  632,  674,  519,  726,  640,  723, 2397,  622,  629,
      637,  520,  653, 2397, 2397,  728,  739,  736,  737,  654,
      738,  616,  723, 2397, 2397,  665, 2388, 2397, 2397, 2397,
        0, 2397,  682, 2387,  641, 2397, 2397,  765, 2386,    0,
        0, 2328, 2320, 2327, 2319,  799, 2381,    0, 2358, 2397,
     2397,  803, 2379,  765,  771, 2369, 2397, 2397,  794, 2397,

      798,  804,  811,    0, 2397, 2397, 2397, 2397,  779,  810,
     2368,  836,  817,  855,  847,    0,  845, 2370,  664,  887,
      866,  872,  888,  901,  903,  904,  786, 2366,  916,  920,
        0,  926, 2397, 2397, 2397,  859, 2374,  807,  916, 2364,
      944, 2397,  949,  993,  958,  927, 2350,  971,  976,  997,
     1006, 2397, 2397,  699,  890,  898, 2397,  822, 2397,    0,
      156, 1001,  948, 1016, 1025, 1029, 1034, 2397, 2397, 2397,
     2362, 2397, 2345, 2397, 1042, 1048, 2397, 2397, 2397, 1052,
     2397,    0, 2335,    0, 2311, 2318,  712, 2309, 2312,  722,
     2307,  793,  910,  926, 2318, 2313,  863, 2316, 2307, 2334,

     2397, 1056,  669, 1070, 1012,    0,    0, 2301, 2302,  659,
      862, 1035,  495, 1028, 2298,  946, 2298, 2291, 2397, 2397,
     2397, 2397, 2397,  959, 2331,  857, 2348, 1088, 1078, 1043,
     1080, 1089, 1099, 1097, 1098, 2397, 2397, 2397, 2397, 1116,
     1123,    0, 1127, 1131, 2294, 2292, 2304, 1135, 1140,    0,
        0, 2285, 2291, 2299, 2284, 1148, 1152, 2322, 2321, 2397,
     1157, 1161,  939, 2397,    0, 1146, 2333, 1150, 1156, 1160,
        0, 1164, 1002, 1178, 1169,    0,    0, 1037, 2397,    0,
     1182, 2332, 1196, 1202, 1206, 1210, 1038, 1224, 1188,    0,
        0, 2313, 1229, 1242, 1246, 1256,    0, 1219, 2317, 1266,

     1267, 1275, 1276, 1277, 1290, 1286, 1294, 1320, 1324, 1090,
     2397,    0, 1322, 2329, 1332, 1338, 1342,    0, 2284, 1075,
     2291, 2290, 2287, 1346, 1192, 1360, 1234,    0, 2276, 1201,
     2274, 2286, 2272, 2307, 2397, 1364, 1378, 1383, 1388, 2397,
     2397, 1269, 1393, 1397, 1401, 1405, 2397, 1414,    0, 2294,
     2270, 2275, 2270, 2267, 2275, 2267, 2258, 2262, 2254, 2252,
     2260,  993, 2269, 2252, 2258, 2260, 2251, 2248, 2247, 2263,
     2255, 2258, 2397, 1418, 1260, 1422, 1426, 1309,    0,    0,
     2248, 2260, 2248, 1253, 2237, 1091, 2249, 2238, 2245, 2243,
     2249, 2234, 2233, 2233, 2230, 2247, 2239, 2246, 2397, 2265,

     2285, 1113, 2266, 1316, 1197, 1333, 1285, 1355, 1434, 1435,
     2239, 2239, 2238,    0,    0,    0,    0, 2231, 1433, 1445,
        0, 1450, 1277, 1454, 1458, 1316,    0, 1470, 1482, 1486,
     1292, 1490, 1494, 1326,    0, 2256, 2260, 1499, 1503, 1513,
     1518,    0, 2397, 1471, 1526, 1527, 1528, 1529, 1537, 1543,
     1542, 1553,    0, 2226, 2214, 2222, 2231, 2221, 2229, 1557,
     1371, 1565, 1575, 1374,    0, 2217, 2218, 2220, 2227, 2218,
     2208, 1579, 1583, 2225, 2210, 2214, 2211, 2203, 1148, 2215,
     2219, 2216, 2203,    0, 2211, 2211, 2213, 2196, 2204, 2206,
     2210, 2208, 2188, 2207,    0, 2195, 2194, 2191, 2184, 2197,

     2182, 2181, 2185,    0, 2194, 2187, 2183, 2187, 2175, 2188,
     2179, 1439, 2186, 2171, 2172, 2179, 2171, 2184, 2397, 1191,
     2397,    0, 2207, 2224, 1440, 1566, 1590, 1592, 2171, 2181,
     2164, 2167, 1590, 1597, 1601, 1605, 2397,    0, 1612, 1613,
     1614, 1615, 1625, 1630, 2174,    0, 2173, 2160, 2171, 2175,
     2161, 2168, 2153, 2167, 2157, 2150, 2156, 2148, 2153,    0,
     2146, 1591,    0,    0, 2147, 2162, 2159,    0, 2150, 2149,
     2145, 2158, 2139, 2153, 2143, 2137, 1608, 2150, 2148,    0,
        0, 2147,    0, 2149, 2146,    0, 2147,    0, 2133, 2137,
     2141, 2125, 2137, 2128, 2124, 2137, 2124, 2134, 2117, 2125,

     1628, 1640, 1641, 2397, 2124, 2120, 2126, 1645, 1646,    0,
        0, 2118, 2113, 2112, 2397, 2125, 2397, 2397, 2397, 2125,
     2126, 2125, 2125,    0, 2123, 2118, 2113, 2116, 2109, 2118,
     2100,    0, 2104, 2100, 2083, 2090,    0, 2065, 2056, 2064,
     2059, 2062,    0, 2053, 2038, 2039, 2016, 2015,    0,    0,
     2001, 2004, 2001,    0, 1989, 1969,    0, 1982, 1981, 1653,
     2397,    0, 1644, 1659, 2397, 1983,    0, 1661, 1663, 1982,
     1962, 1956, 1962, 1951, 1949, 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,    0, 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, 2397,
     1314, 1261, 1259, 1181,    0, 1172, 1111, 1100, 1089, 1053,
        0,    0, 1039,    0,    0, 1031,    0,  936,  909,  888,

      855,    0, 2397,    0,  825,  821,    0,  777,  734,  728,
      719,  708,    0,    0,    0,  694,  611,  497,  104,    0,
        0,    0,    0, 2397, 2397,    0,    0, 2397, 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[889] =
    {   0,
      828,    1,  828,    3,  829,  829,  828,    7,  828,    9,
      828,   11,  828,   13,    1,    1,  828,   17,  830,  830,
      831,  831,  828,   23,  828,  828,  828,  828,  828,  828,
      832,  833,  828,  828,  828,  834,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  835,  828,  828,  828,
      828,  836,  836,  828,  828,  836,  836,  836,  836,  836,
      836,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      837,  828,  828,  828,  828,  828,  828,  828,  828,  838,
      839,  839,  839,  839,  839,  828,  828,  840,  841,  828,
      828,  828,  828,  842,  828,  843,  828,  828,  828,  828,

      844,  828,  828,  845,  828,  828,  828,  828,  846,  828,
      847,  828,  828,  828,  828,  848,  849,   43,  850,  850,
      850,  850,  850,  850,  850,  850,  842,  843,  828,  828,
      102,  828,  828,  828,  828,  828,  828,  851,  828,  852,
      828,  828,  853,  828,  828,  828,  854,  854,  854,  854,
      854,  828,  828,  855,  828,  828,  828,  856,  828,  856,
      857,  828,  857,  828,  828,  828,  828,  828,  828,  828,
      858,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  828,

      828,  828,  828,  828,  828,  860,  861,  861,  861,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  828,  828,
      828,  828,  828,  828,  862,  863,  864,  863,  863,  863,
      863,  863,  863,  863,  863,  828,  828,  828,  828,  828,
      828,  865,  828,  828,  828,  828,  828,  828,  828,  866,
      867,  867,  867,  867,  867,  828,  828,  868,  868,  828,
      828,  828,  842,  828,  842,  828,  843,  828,  828,  828,
      869,  828,  828,  828,  828,  870,  871,  872,  828,  872,
      828,  873,  828,  828,  828,  828,  828,  828,  828,  874,
      875,  876,  876,  876,  876,  876,  877,  878,  828,  878,

      878,  878,  878,  878,  878,  878,  878,  828,  828,  879,
      828,  879,  828,  880,  828,  828,  828,  881,  881,  881,
      881,  881,  881,  828,  828,  828,  828,  882,  828,  828,
      828,  828,  828,  883,  828,  883,  883,  883,  883,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  828,  828,  828,  828,  828,  828,  860,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  861,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  828,  828,

      864,  884,  885,  886,  886,  886,  886,  886,  886,  886,
      828,  828,  828,  866,  867,  867,  867,  867,  828,  828,
      869,  828,  828,  828,  828,  828,  870,  828,  828,  828,
      828,  828,  828,  828,  874,  876,  828,  876,  876,  876,
      876,  887,  828,  878,  878,  878,  878,  878,  878,  878,
      828,  828,  881,  881,  881,  881,  881,  881,  881,  828,
      828,  828,  828,  828,  882,  828,  828,  828,  828,  828,
      828,  828,  828,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  861,  861,  861,

      861,  861,  861,  861,  861,  861,  861,  861,  861,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  828,  884,
      828,  884,  885,  828,  886,  886,  886,  886,  828,  828,
      828,  867,  828,  828,  828,  828,  828,  887,  878,  878,
      878,  878,  828,  828,  881,  881,  881,  881,  881,  881,
      828,  828,  828,  828,  828,  828,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  861,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  861,  861,

      888,  886,  886,  828,  828,  828,  867,  878,  878,  881,
      881,  881,  881,  881,  828,  828,  828,  828,  828,  828,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  861,  861,  861,  861,  861,  861,  861,
      861,  861,  861,  861,  861,  861,  861,  861,  861,  888,
      828,  888,  886,  886,  828,  828,  867,  878,  878,  881,
      881,  881,  828,  828,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  861,  861,  861,  861,  861,  861,  861,

      861,  861,  861,  861,  861,  828,  881,  881,  881,  828,
      828,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  861,  861,  861,  861,  861,  861,  861,  861,
      861,  828,  881,  881,  881,  828,  828,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  859,  859,  861,  861,  861,  861,
      861,  861,  861,  861,  828,  828,  881,  881,  828,  828,
      859,  859,  859,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  859,  861,  861,  861,  861,  828,  828,

      881,  881,  828,  859,  859,  859,  859,  859,  859,  859,
      859,  859,  859,  861,  861,  828,  828,  881,  859,  859,
      859,  859,  859,  828,  828,  881,  859,    0,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828
    } ;

static yyconst flex_int16_t yy_nxt[2472] =
    {   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,  827,   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,  826,  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,  825,  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,  824,  227,  225,  225,  225,  225,  203,  204,  353,
      227,  227,  227,  227,  205,  563,  248,  248,  206,  248,
      208,  264,  354,  357,  203,  209,  563,  204,  210,  358,
      211,  212,  213,  214,  215,  279,  205,  216,  229,  217,
      218,  230,  264,  823,  206,  233,  239,  235,  231,  822,

      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,  821,  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,  820,  276,  286,  225,  284,  284,  284,  284,  288,
      293,  227,  294,  225,  295,  296,  287,  288,  819,  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,  818,
      225,  225,  386,  290,  302,  227,  301,  227,  227,  370,
      299,  303,  299,  299,  268,  817,  269,  269,  269,  269,
      270,  270,  270,  270,  272,  264,  269,  269,  269,  269,
      162,  313,  163,  313,  304,  313,  313,  363,  274,  305,
      816,  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,  815,
      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,  814,  348,  376,  388,  376,  348,  392,
      377,  377,  377,  377,  393,  225,  311,  225,  813,  204,

      812,  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,
      811,  248,  248,  404,  248,  405,  406,  407,  408,  256,
      256,  506,  256,  256,  256,  410,  256,  522,  261,  261,
      409,  261,  261,  261,  810,  261,  419,  419,  419,  419,
      270,  270,  270,  270,  272,  809,  269,  269,  269,  269,
      270,  270,  270,  270,  422,  422,  422,  422,  274,  426,
      426,  426,  420,  424,  562,  424,  420,  521,  425,  425,

      425,  425,  428,  428,  428,  428,  563,  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,  808,  429,  432,
      807,  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,  724,  437,  441,  441,  441,  441,
      375,  375,  725,  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,  806,  502,  227,  299,
      503,  308,  308,  299,  308,  308,  308,  805,  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,  804,  225,  803,  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,
      802,  472,  801,  800,  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,  799,  533,  798,  227,  534,  534,  534,  534,  348,
      422,  422,  422,  422,  425,  425,  425,  425,  425,  425,
      425,  425,  420,  759,  797,  593,  528,  796,  225,  527,
      428,  428,  428,  428,  594,  227,  760,  535,  795,  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,  794,  437,  793,
      792,  539,  437,  440,  440,  440,  440,  429,  441,  441,
      441,  441,  437,  225,  225,  225,  225,  437,  791,  790,
      227,  227,  227,  227,  225,  299,  299,  299,  299,  789,
      225,  227,  451,  451,  451,  451,  299,  227,  543,  775,
      543,  788,  299,  544,  544,  544,  544,  460,  460,  460,
      460,  787,  776,  225,  540,  463,  463,  463,  463,  452,
      227,  786,  541,  785,  542,  463,  463,  463,  463,  473,

      473,  473,  473,  473,  473,  473,  473,  225,  452,  225,
      534,  534,  534,  534,  227,  784,  227,  534,  534,  534,
      534,  536,  536,  536,  536,  536,  536,  536,  536,  225,
      225,  225,  225,  783,  661,  782,  227,  227,  227,  227,
      625,  299,  299,  299,  299,  544,  544,  544,  544,  602,
      544,  544,  544,  544,  626,  639,  603,  225,  225,  661,
      627,  225,  225,  225,  227,  227,  781,  780,  227,  227,
      227,  640,  662,  608,  299,  299,  225,  641,  225,  609,
      225,  714,  779,  227,  778,  227,  777,  227,  774,  773,
      299,  772,  299,  663,  771,  715,  770,  662,  668,  769,

      768,  716,  767,  766,  765,  664,  764,  763,  762,  761,
      669,   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,  758,  158,  158,  158,  158,
      158,  158,  158,  158,  158,  161,  161,  161,  161,  161,
      161,  161,  161,  161,  161,  161,  171,  757,  171,  171,
      171,  171,  171,  171,  171,  171,  171,  207,  207,  207,
      226,  226,  226,  756,  226,  226,  226,  242,  755,  754,
      242,  242,  242,  250,  250,  250,  251,  753,  752,  251,

      251,  251,  258,  258,  258,  259,  259,  751,  259,  259,
      259,  263,  750,  263,  263,  263,  263,  263,  263,  263,
      263,  263,  267,  749,  267,  267,  267,  267,  267,  267,
      267,  267,  267,  271,  748,  747,  271,  271,  271,  277,
      746,  745,  277,  277,  277,  278,  744,  278,  278,  278,
      278,  278,  278,  278,  278,  278,  282,  743,  282,  282,
      282,  282,  282,  282,  282,  282,  282,  291,  742,  741,
      291,  291,  291,  292,  292,  292,  298,  298,  298,  298,
      298,  298,  298,  310,  740,  310,  310,  310,  310,  310,
      310,  310,  310,  310,  314,  739,  314,  314,  314,  314,

      314,  314,  314,  314,  314,  318,  738,  737,  318,  318,
      318,  334,  334,  736,  334,  334,  334,  340,  340,  340,
      340,  340,  340,  340,  340,  340,  158,  735,  158,  158,
      158,  158,  158,  158,  158,  158,  158,  161,  161,  161,
      161,  161,  161,  161,  161,  161,  161,  161,  171,  734,
      171,  171,  171,  171,  171,  171,  171,  171,  171,  349,
      733,  732,  349,  349,  349,  379,  731,  730,  379,  380,
      729,  728,  380,  380,  380,  225,  225,  225,  727,  225,
      225,  225,  226,  226,  226,  726,  226,  226,  226,  403,
      723,  722,  721,  720,  403,  403,  403,  242,  719,  718,

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

      314,  314,  314,  314,  314,  314,  314,  453,  694,  693,
      453,  453,  453,  465,  692,  691,  465,  334,  334,  690,
      334,  334,  334,  520,  689,  520,  520,  520,  520,  520,
      520,  520,  520,  520,  523,  523,  523,  688,  523,  523,
      523,  226,  226,  226,  687,  226,  226,  226,  538,  686,
      685,  538,  538,  538,  660,  684,  660,  660,  660,  660,
      660,  660,  660,  660,  660,  683,  682,  681,  680,  679,
      678,  677,  676,  675,  674,  673,  672,  671,  670,  667,
      666,  665,  659,  658,  657,  656,  655,  654,  653,  652,
      651,  650,  649,  648,  647,  646,  645,  644,  643,  642,

      638,  637,  636,  635,  634,  633,  632,  631,  630,  629,
      628,  624,  623,  622,  621,  620,  619,  618,  617,  616,
      615,  614,  613,  612,  611,  610,  607,  606,  605,  604,
      601,  524,  600,  599,  598,  597,  596,  595,  592,  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,  561,  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,  828,   25,  828,  828,  828,

      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828
    } ;

static yyconst flex_int16_t yy_chk[2472] =
    {   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,  819,    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,  818,   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,  817,   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,  816,   56,   58,   59,   61,   57,   45,   45,  187,
       58,   59,   61,   57,   45,  812,   78,   78,   45,   78,
       47,   94,  187,  190,   45,   47,  811,   45,   47,  190,
       47,   47,   47,   47,   47,  109,   45,   47,   56,   47,
       47,   57,  127,  810,   45,   59,   63,   61,   57,  809,

       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,  808,  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,  806,  102,  114,  226,  114,  114,  114,  114,  115,
      117,  226,  117,  121,  117,  117,  114,  114,  805,  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,  801,
      125,  126,  211,  114,  122,  124,  121,  125,  126,  197,
      124,  122,  125,  126,  129,  800,  129,  129,  129,  129,
      130,  130,  130,  130,  132,  263,  132,  132,  132,  132,
      163,  139,  163,  139,  123,  139,  139,  193,  132,  124,
      799,  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,  798,
      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,  796,  180,  204,  212,  204,  202,  214,
      204,  204,  204,  204,  214,  229,  310,  231,  793,  176,

      790,  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,
      789,  249,  249,  229,  249,  231,  232,  232,  233,  256,
      256,  386,  256,  257,  257,  235,  257,  402,  261,  261,
      234,  261,  262,  262,  788,  262,  266,  266,  266,  266,
      268,  268,  268,  268,  269,  787,  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,  786,  285,  288,
      784,  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,  685,  295,  296,  296,  296,  296,
      375,  375,  685,  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,  783,  384,  307,  305,
      384,  308,  308,  307,  308,  309,  309,  782,  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,  781,  408,  779,  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,
      778,  348,  777,  776,  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,  775,  420,  774,  525,  420,  420,  420,  420,  374,
      422,  422,  422,  422,  424,  424,  424,  424,  425,  425,
      425,  425,  422,  725,  770,  512,  410,  768,  444,  409,
      428,  428,  428,  428,  512,  444,  725,  429,  767,  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,  765,  438,  764,
      762,  444,  439,  440,  440,  440,  440,  430,  441,  441,
      441,  441,  440,  445,  446,  447,  448,  441,  761,  760,
      445,  446,  447,  448,  449,  445,  446,  447,  448,  759,
      450,  449,  451,  451,  451,  451,  449,  450,  452,  742,
      452,  758,  450,  452,  452,  452,  452,  460,  460,  460,
      460,  756,  742,  526,  446,  462,  462,  462,  462,  460,
      526,  755,  449,  754,  450,  463,  463,  463,  463,  472,

      472,  472,  472,  473,  473,  473,  473,  527,  460,  528,
      533,  533,  533,  533,  527,  753,  528,  534,  534,  534,
      534,  535,  535,  535,  535,  536,  536,  536,  536,  539,
      540,  541,  542,  751,  601,  750,  539,  540,  541,  542,
      562,  539,  540,  541,  542,  543,  543,  543,  543,  527,
      544,  544,  544,  544,  562,  577,  528,  602,  603,  660,
      562,  663,  608,  609,  602,  603,  749,  747,  663,  608,
      609,  577,  601,  541,  608,  609,  664,  577,  668,  542,
      669,  677,  746,  664,  744,  668,  743,  669,  741,  740,
      668,  739,  669,  602,  738,  677,  736,  660,  608,  735,

      734,  677,  733,  732,  731,  603,  730,  728,  727,  726,
      609,  829,  829,  829,  829,  829,  829,  829,  829,  829,
      829,  829,  830,  830,  830,  830,  830,  830,  830,  830,
      830,  830,  830,  831,  831,  831,  831,  831,  831,  831,
      831,  831,  831,  831,  832,  724,  832,  832,  832,  832,
      832,  832,  832,  832,  832,  833,  833,  833,  833,  833,
      833,  833,  833,  833,  833,  833,  834,  722,  834,  834,
      834,  834,  834,  834,  834,  834,  834,  835,  835,  835,
      836,  836,  836,  721,  836,  836,  836,  837,  720,  719,
      837,  837,  837,  838,  838,  838,  839,  718,  717,  839,

      839,  839,  840,  840,  840,  841,  841,  716,  841,  841,
      841,  842,  715,  842,  842,  842,  842,  842,  842,  842,
      842,  842,  843,  714,  843,  843,  843,  843,  843,  843,
      843,  843,  843,  844,  713,  711,  844,  844,  844,  845,
      710,  709,  845,  845,  845,  846,  708,  846,  846,  846,
      846,  846,  846,  846,  846,  846,  847,  707,  847,  847,
      847,  847,  847,  847,  847,  847,  847,  848,  706,  704,
      848,  848,  848,  849,  849,  849,  850,  850,  850,  850,
      850,  850,  850,  851,  702,  851,  851,  851,  851,  851,
      851,  851,  851,  851,  852,  701,  852,  852,  852,  852,

      852,  852,  852,  852,  852,  853,  700,  699,  853,  853,
      853,  854,  854,  697,  854,  854,  854,  855,  855,  855,
      855,  855,  855,  855,  855,  855,  856,  696,  856,  856,
      856,  856,  856,  856,  856,  856,  856,  857,  857,  857,
      857,  857,  857,  857,  857,  857,  857,  857,  858,  695,
      858,  858,  858,  858,  858,  858,  858,  858,  858,  859,
      694,  693,  859,  859,  859,  860,  692,  691,  860,  861,
      690,  688,  861,  861,  861,  862,  862,  862,  687,  862,
      862,  862,  863,  863,  863,  686,  863,  863,  863,  864,
      684,  683,  682,  681,  864,  864,  864,  865,  680,  679,

      865,  865,  865,  866,  678,  676,  866,  866,  866,  867,
      675,  674,  867,  867,  867,  868,  868,  673,  868,  868,
      868,  869,  672,  671,  869,  869,  869,  870,  670,  666,
      870,  871,  659,  658,  871,  871,  871,  872,  656,  872,
      872,  872,  872,  872,  872,  872,  872,  872,  873,  655,
      873,  873,  873,  873,  873,  873,  873,  873,  873,  874,
      653,  652,  874,  875,  651,  648,  875,  875,  875,  876,
      647,  876,  876,  876,  876,  877,  877,  877,  878,  878,
      878,  878,  878,  878,  878,  879,  646,  879,  879,  879,
      879,  879,  879,  879,  879,  879,  880,  645,  880,  880,

      880,  880,  880,  880,  880,  880,  880,  881,  644,  642,
      881,  881,  881,  882,  641,  640,  882,  883,  883,  639,
      883,  883,  883,  884,  638,  884,  884,  884,  884,  884,
      884,  884,  884,  884,  885,  885,  885,  636,  885,  885,
      885,  886,  886,  886,  635,  886,  886,  886,  887,  634,
      633,  887,  887,  887,  888,  631,  888,  888,  888,  888,
      888,  888,  888,  888,  888,  630,  629,  628,  627,  626,
      625,  623,  622,  621,  620,  616,  614,  613,  612,  607,
      606,  605,  600,  599,  598,  597,  596,  595,  594,  593,
      592,  591,  590,  589,  587,  585,  584,  582,  579,  578,

      576,  575,  574,  573,  572,  571,  570,  569,  567,  566,
      565,  561,  559,  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,  474,  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,  828,  828,  828,  828,

      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828,  828,  828,  828,  828,  828,  828,  828,  828,  828,
      828
    } ;

/* Table of booleans, true if rule could match eol. */
static yyconst flex_int32_t yy_rule_can_match_eol[211] =
    {   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, 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[210] =
    {   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,  349,  351,  352,
      353,  354,  355,  356,  357,  358,  359,  360,  361,  362,
      363,  364,  365,  366,  367,  368,  371,  378,  379,  380,
      381,  382,  383,  384,  385,  386,  387,  388,  389,  390,

      391,  393,  394,  395,  396,  397,  398,  399,  400,  402,
      406,  423,  428,  457,  505,  506,  507,  508,  510,  515,
      527,  555,  556,  557,  558,  559,  561,  569,  620,  633,
      655,  660,  665,  672,  673,  688,  693,  694,  699,  700,
      701,  703,  719,  773,  801,  806,  811,  812,  813,  814,
      819,  830,  831,  833,  835,  846,  860,  865,  866,  867,
      868,  870,  885,  899,  928,  953,  955,  960,  970,  975,
      993,  999, 1006, 1039, 1041, 1046, 1082, 1083, 1084, 1086,
     1087, 1088, 1089, 1090, 1091, 1093, 1094, 1095, 1097, 1102,
     1107, 1108, 1111, 1145, 1150, 1153, 1154, 1155, 1156, 1158,

     1163, 1164, 1165, 1166, 1167, 1169, 1174, 1176, 1178
    } ;

/* 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: /mirror/trunk/compilers/pirc/src/pirlexer.c 35825 2009-01-20T11:10:03.399372Z kjs  $
 * Copyright (C) 2007-2009, The Perl 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 1550 "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;
    int yy_n_chars;
    int 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 );

int 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 = '*'; \
        int 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 1867 "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 >= 829 )
                    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 != 828 );
        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 < 210 )
                fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
                         (long)yy_rule_linenum[yy_act], yytext );
            else if ( yy_act == 210 )
                fprintf( stderr, "--accepting default rule (\"%s\")\n",
                         yytext );
            else if ( yy_act == 211 )
                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_HLL_MAP; }
    YY_BREAK
case 64:
YY_RULE_SETUP
#line 345 "pir.l"
{ return TK_INVOCANT; }
    YY_BREAK
case 65:
YY_RULE_SETUP
#line 346 "pir.l"
{ return TK_LEX; }
    YY_BREAK
case 66:
YY_RULE_SETUP
#line 347 "pir.l"
{ return TK_LINE; }
    YY_BREAK
case 67:
YY_RULE_SETUP
#line 348 "pir.l"
{ return TK_LOADLIB; }
    YY_BREAK
case 68:
YY_RULE_SETUP
#line 349 "pir.l"
{ return TK_LOCAL; }
    YY_BREAK
case 69:
YY_RULE_SETUP
#line 351 "pir.l"
{ return TK_METH_CALL; }
    YY_BREAK
case 70:
YY_RULE_SETUP
#line 352 "pir.l"
{ return TK_NAMESPACE; }
    YY_BREAK
case 71:
YY_RULE_SETUP
#line 353 "pir.l"
{ return TK_NCI_CALL; }
    YY_BREAK
case 72:
YY_RULE_SETUP
#line 354 "pir.l"
{ return TK_PARAM; }
    YY_BREAK
case 73:
YY_RULE_SETUP
#line 355 "pir.l"
{ return TK_BEGIN_CALL; }
    YY_BREAK
case 74:
YY_RULE_SETUP
#line 356 "pir.l"
{ return TK_BEGIN_RETURN; }
    YY_BREAK
case 75:
YY_RULE_SETUP
#line 357 "pir.l"
{ return TK_BEGIN_YIELD; }
    YY_BREAK
case 76:
YY_RULE_SETUP
#line 358 "pir.l"
{ return TK_CALL; }
    YY_BREAK
case 77:
YY_RULE_SETUP
#line 359 "pir.l"
{ return TK_END_CALL; }
    YY_BREAK
case 78:
YY_RULE_SETUP
#line 360 "pir.l"
{ return TK_END_RETURN; }
    YY_BREAK
case 79:
YY_RULE_SETUP
#line 361 "pir.l"
{ return TK_END_YIELD; }
    YY_BREAK
case 80:
YY_RULE_SETUP
#line 362 "pir.l"
{ return TK_GET_RESULT; }
    YY_BREAK
case 81:
YY_RULE_SETUP
#line 363 "pir.l"
{ return TK_RETURN; }
    YY_BREAK
case 82:
YY_RULE_SETUP
#line 364 "pir.l"
{ return TK_SUB; }
    YY_BREAK
case 83:
YY_RULE_SETUP
#line 365 "pir.l"
{ return TK_YIELD; }
    YY_BREAK
case 84:
YY_RULE_SETUP
#line 366 "pir.l"
{ return TK_SET_RETURN; }
    YY_BREAK
case 85:
YY_RULE_SETUP
#line 367 "pir.l"
{ return TK_SET_YIELD; }
    YY_BREAK
case 86:
YY_RULE_SETUP
#line 368 "pir.l"
{ return TK_TAILCALL; }
    YY_BREAK
case 87:
YY_RULE_SETUP
#line 371 "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 88:
YY_RULE_SETUP
#line 378 "pir.l"
{ return TK_FLAG_ANON; }
    YY_BREAK
case 89:
YY_RULE_SETUP
#line 379 "pir.l"
{ return TK_FLAG_INIT; }
    YY_BREAK
case 90:
YY_RULE_SETUP
#line 380 "pir.l"
{ return TK_FLAG_LOAD; }
    YY_BREAK
case 91:
YY_RULE_SETUP
#line 381 "pir.l"
{ return TK_FLAG_POSTCOMP; }
    YY_BREAK
case 92:
YY_RULE_SETUP
#line 382 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
    YY_BREAK
case 93:
YY_RULE_SETUP
#line 383 "pir.l"
{ return TK_FLAG_MAIN; }
    YY_BREAK
case 94:
YY_RULE_SETUP
#line 384 "pir.l"
{ return TK_FLAG_METHOD; }
    YY_BREAK
case 95:
YY_RULE_SETUP
#line 385 "pir.l"
{ return TK_FLAG_LEX; }
    YY_BREAK
case 96:
YY_RULE_SETUP
#line 386 "pir.l"
{ return TK_FLAG_OUTER; }
    YY_BREAK
case 97:
YY_RULE_SETUP
#line 387 "pir.l"
{ return TK_FLAG_VTABLE; }
    YY_BREAK
case 98:
YY_RULE_SETUP
#line 388 "pir.l"
{ return TK_FLAG_MULTI; }
    YY_BREAK
case 99:
YY_RULE_SETUP
#line 389 "pir.l"
{ return TK_FLAG_SUBID; }
    YY_BREAK
case 100:
YY_RULE_SETUP
#line 390 "pir.l"
{ return TK_FLAG_INSTANCEOF; }
    YY_BREAK
case 101:
YY_RULE_SETUP
#line 391 "pir.l"
{ return TK_FLAG_NSENTRY; }
    YY_BREAK
case 102:
YY_RULE_SETUP
#line 393 "pir.l"
{ return TK_FLAG_UNIQUE_REG; }
    YY_BREAK
case 103:
YY_RULE_SETUP
#line 394 "pir.l"
{ return TK_FLAG_OPTIONAL; }
    YY_BREAK
case 104:
YY_RULE_SETUP
#line 395 "pir.l"
{ return TK_FLAG_OPT_FLAG; }
    YY_BREAK
case 105:
YY_RULE_SETUP
#line 396 "pir.l"
{ return TK_FLAG_SLURPY; }
    YY_BREAK
case 106:
YY_RULE_SETUP
#line 397 "pir.l"
{ return TK_FLAG_NAMED; }
    YY_BREAK
case 107:
YY_RULE_SETUP
#line 398 "pir.l"
{ return TK_FLAG_FLAT; }
    YY_BREAK
case 108:
YY_RULE_SETUP
#line 399 "pir.l"
{ return TK_FLAG_INVOCANT; }
    YY_BREAK
case 109:
YY_RULE_SETUP
#line 400 "pir.l"
{ return TK_FLAG_LOOKAHEAD; }
    YY_BREAK
case 110:
YY_RULE_SETUP
#line 402 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                               "unrecognized flag: '%s'", yytext);
                  }
    YY_BREAK
case 111:
YY_RULE_SETUP
#line 406 "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 = string_unescape_cstring(lexer->interp,
                                                           yytext + 1, '"', "ascii");

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

                    yylval->sval = str;
                    return TK_STRINGC;
                  }
    YY_BREAK
case 112:
YY_RULE_SETUP
#line 423 "pir.l"
{ /* copy the string, remove the quotes. */
                    yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                    return TK_STRINGC;
                  }
    YY_BREAK
case 113:
YY_RULE_SETUP
#line 428 "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 114:
YY_RULE_SETUP
#line 457 "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 115:
YY_RULE_SETUP
#line 505 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_PREG; }
    YY_BREAK
case 116:
YY_RULE_SETUP
#line 506 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_SREG; }
    YY_BREAK
case 117:
YY_RULE_SETUP
#line 507 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_NREG; }
    YY_BREAK
case 118:
YY_RULE_SETUP
#line 508 "pir.l"
{ yylval->ival = atoi(yytext + 2); return TK_IREG; }
    YY_BREAK
case 119:
YY_RULE_SETUP
#line 510 "pir.l"
{ /* make the label Id available in the parser. remove the ":" first. */
                    yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                    return TK_LABEL;
                  }
    YY_BREAK
case 120:
YY_RULE_SETUP
#line 515 "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 121:
YY_RULE_SETUP
#line 527 "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) {
                        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;
                        }
                    }

                    yylval->sval = dupstr(lexer, yytext);
                    return TK_IDENT;
                  }
    YY_BREAK
case 122:
YY_RULE_SETUP
#line 555 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
    YY_BREAK
case 123:
YY_RULE_SETUP
#line 556 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 124:
YY_RULE_SETUP
#line 557 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 125:
YY_RULE_SETUP
#line 558 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 126:
YY_RULE_SETUP
#line 559 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 127:
*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 561 "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 128:
/* rule 128 can match eol */
YY_RULE_SETUP
#line 569 "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 591 "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 597 "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 129:
YY_RULE_SETUP
#line 620 "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 629 "pir.l"
{ /* end of file, stop scanning. */
                    yyterminate();
                  }
    YY_BREAK
case 130:
YY_RULE_SETUP
#line 633 "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 131:
YY_RULE_SETUP
#line 655 "pir.l"
{
                               yy_push_state(MACROCONST, yyscanner);
                               return TK_MACRO_CONST;
                             }
    YY_BREAK
case 132:
YY_RULE_SETUP
#line 660 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_IDENT;
                             }
    YY_BREAK
case 133:
YY_RULE_SETUP
#line 665 "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 134:
YY_RULE_SETUP
#line 672 "pir.l"
{ /* ignore whitespace */ }
    YY_BREAK
case 135:
YY_RULE_SETUP
#line 673 "pir.l"
{
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "unknown character: '%c'", yytext[0]);
                             }
    YY_BREAK
case YY_STATE_EOF(MACROCONST):
#line 677 "pir.l"
{
                               yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "read end of file during .macro_const definition");
                             }
    YY_BREAK


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


case 136:
YY_RULE_SETUP
#line 688 "pir.l"
{ /* start a macro definition */
                               yy_push_state(MACROHEAD, yyscanner);
                               return TK_MACRO;
                             }
    YY_BREAK
case 137:
YY_RULE_SETUP
#line 693 "pir.l"
{ /* ignore whitespace */ }
    YY_BREAK
case 138:
YY_RULE_SETUP
#line 694 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_IDENT;
                             }
    YY_BREAK
case 139:
YY_RULE_SETUP
#line 699 "pir.l"
{ return '('; }
    YY_BREAK
case 140:
YY_RULE_SETUP
#line 700 "pir.l"
{ return ')'; }
    YY_BREAK
case 141:
YY_RULE_SETUP
#line 701 "pir.l"
{ return ','; }
    YY_BREAK
case 142:
/* rule 142 can match eol */
YY_RULE_SETUP
#line 703 "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 143:
YY_RULE_SETUP
#line 719 "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 144:
YY_RULE_SETUP
#line 773 "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 145:
YY_RULE_SETUP
#line 801 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_IDENT;
                             }
    YY_BREAK
case 146:
YY_RULE_SETUP
#line 806 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_OTHER;
                             }
    YY_BREAK
case 147:
YY_RULE_SETUP
#line 811 "pir.l"
{ /* ignore whitespace */ }
    YY_BREAK
case 148:
YY_RULE_SETUP
#line 812 "pir.l"
{ return ','; }
    YY_BREAK
case 149:
YY_RULE_SETUP
#line 813 "pir.l"
{ return '('; }
    YY_BREAK
case 150:
YY_RULE_SETUP
#line 814 "pir.l"
{
                               yy_pop_state(yyscanner); /* leave MACROEXPAND state */
                               return ')';
                             }
    YY_BREAK
case 151:
YY_RULE_SETUP
#line 819 "pir.l"
{
                               yylval->sval = dupstr(yypirget_extra(yyscanner), yytext);
                               return TK_MACRO_ARG_OTHER;
                             }
    YY_BREAK
case YY_STATE_EOF(STRINGEXPAND):
#line 824 "pir.l"
{
                               lexer_state * const lexer = yypirget_extra(yyscanner);
                               yy_pop_state(yyscanner);
                               yypir_switch_to_buffer(lexer->buffer,yyscanner);
                             }
    YY_BREAK
case 152:
YY_RULE_SETUP
#line 830 "pir.l"
{ return '{'; }
    YY_BREAK
case 153:
YY_RULE_SETUP
#line 831 "pir.l"
{ return '}'; }
    YY_BREAK
case 154:
/* rule 154 can match eol */
YY_RULE_SETUP
#line 833 "pir.l"
{ yylval->sval = "\n"; return TK_NL; }
    YY_BREAK
case 155:
YY_RULE_SETUP
#line 835 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                          "unknown character in macro expansion: %c", yytext[0]);
                             }
    YY_BREAK


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


case 156:
YY_RULE_SETUP
#line 846 "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 157:
YY_RULE_SETUP
#line 860 "pir.l"
{
                              yy_push_state(MACROLOCAL, yyscanner);
                              return TK_MACRO_LOCAL;
                            }
    YY_BREAK
case 158:
YY_RULE_SETUP
#line 865 "pir.l"
{ return TK_INT; }
    YY_BREAK
case 159:
YY_RULE_SETUP
#line 866 "pir.l"
{ return TK_PMC; }
    YY_BREAK
case 160:
YY_RULE_SETUP
#line 867 "pir.l"
{ return TK_NUM; }
    YY_BREAK
case 161:
YY_RULE_SETUP
#line 868 "pir.l"
{ return TK_STRING; }
    YY_BREAK
case 162:
YY_RULE_SETUP
#line 870 "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 163:
YY_RULE_SETUP
#line 885 "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 164:
YY_RULE_SETUP
#line 899 "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 165:
YY_RULE_SETUP
#line 928 "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 166:
YY_RULE_SETUP
#line 953 "pir.l"
{ /* ignore whitespace */ }
    YY_BREAK
case 167:
/* rule 167 can match eol */
YY_RULE_SETUP
#line 955 "pir.l"
{ /* newline after .macro_local <type> <ident> line */
                              yy_pop_state(yyscanner);
                              return TK_NL;
                            }
    YY_BREAK
case 168:
YY_RULE_SETUP
#line 960 "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 169:
YY_RULE_SETUP
#line 970 "pir.l"
{
                              yy_push_state(MACROLABEL, yyscanner);
                              return TK_MACRO_LABEL;
                            }
    YY_BREAK
case 170:
YY_RULE_SETUP
#line 975 "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 171:
/* rule 171 can match eol */
YY_RULE_SETUP
#line 993 "pir.l"
{ /* the newline character after a ".macro_label $foo:" declaration */
                              yy_pop_state(yyscanner); /* leave MACROLABEL state */
                              return TK_NL;
                            }
    YY_BREAK
case 172:
YY_RULE_SETUP
#line 999 "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 173:
YY_RULE_SETUP
#line 1006 "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 174:
/* rule 174 can match eol */
YY_RULE_SETUP
#line 1039 "pir.l"
{ store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), '\n'); }
    YY_BREAK
case 175:
YY_RULE_SETUP
#line 1041 "pir.l"
{
                               yy_pop_state(yyscanner); /* leave MACROBODY state */
                               return TK_ENDM;
                             }
    YY_BREAK
case 176:
YY_RULE_SETUP
#line 1046 "pir.l"
{ /* store everything else */
                               store_macro_char(CURRENT_MACRO(yypirget_extra(yyscanner)), yytext[0]);
                             }
    YY_BREAK
case YY_STATE_EOF(MACROBODY):
#line 1050 "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 177:
YY_RULE_SETUP
#line 1082 "pir.l"
{ return ','; }
    YY_BREAK
case 178:
YY_RULE_SETUP
#line 1083 "pir.l"
{ return '['; }
    YY_BREAK
case 179:
YY_RULE_SETUP
#line 1084 "pir.l"
{ return ']'; }
    YY_BREAK
case 180:
YY_RULE_SETUP
#line 1086 "pir.l"
{ return TK_FLAG_MAIN; }
    YY_BREAK
case 181:
YY_RULE_SETUP
#line 1087 "pir.l"
{ return TK_FLAG_LOAD; }
    YY_BREAK
case 182:
YY_RULE_SETUP
#line 1088 "pir.l"
{ return TK_FLAG_INIT; }
    YY_BREAK
case 183:
YY_RULE_SETUP
#line 1089 "pir.l"
{ return TK_FLAG_ANON; }
    YY_BREAK
case 184:
YY_RULE_SETUP
#line 1090 "pir.l"
{ return TK_FLAG_POSTCOMP; }
    YY_BREAK
case 185:
YY_RULE_SETUP
#line 1091 "pir.l"
{ return TK_FLAG_IMMEDIATE; }
    YY_BREAK
case 186:
YY_RULE_SETUP
#line 1093 "pir.l"
{ return TK_PCC_SUB; }
    YY_BREAK
case 187:
YY_RULE_SETUP
#line 1094 "pir.l"
{ return TK_LEX; }
    YY_BREAK
case 188:
YY_RULE_SETUP
#line 1095 "pir.l"
{ return TK_NAMESPACE; }
    YY_BREAK
case 189:
YY_RULE_SETUP
#line 1097 "pir.l"
{
                          yy_push_state(MACROHEAD, yyscanner);
                          return TK_MACRO;
                        }
    YY_BREAK
case 190:
YY_RULE_SETUP
#line 1102 "pir.l"
{
                          yy_push_state(MACROCONST, yyscanner);
                          return TK_MACRO_CONST;
                        }
    YY_BREAK
case 191:
YY_RULE_SETUP
#line 1107 "pir.l"
{ return TK_LINE; }
    YY_BREAK
case 192:
YY_RULE_SETUP
#line 1108 "pir.l"
{ return TK_FILE; }
    YY_BREAK
case 193:
YY_RULE_SETUP
#line 1111 "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 194:
YY_RULE_SETUP
#line 1145 "pir.l"
{ /* a label in PASM */
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext, yyleng - 1);
                          return TK_LABEL;
                        }
    YY_BREAK
case 195:
YY_RULE_SETUP
#line 1150 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                     "symbolic registers are not allowed in PASM mode");
                        }
    YY_BREAK
case 196:
YY_RULE_SETUP
#line 1153 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_PREG; }
    YY_BREAK
case 197:
YY_RULE_SETUP
#line 1154 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_NREG; }
    YY_BREAK
case 198:
YY_RULE_SETUP
#line 1155 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_IREG; }
    YY_BREAK
case 199:
YY_RULE_SETUP
#line 1156 "pir.l"
{ yylval->ival = atoi(yytext + 1); return TK_SREG; }
    YY_BREAK
case 200:
YY_RULE_SETUP
#line 1158 "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 201:
YY_RULE_SETUP
#line 1163 "pir.l"
{ yylval->dval = atof(yytext); return TK_NUMC; }
    YY_BREAK
case 202:
YY_RULE_SETUP
#line 1164 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 203:
YY_RULE_SETUP
#line 1165 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 204:
YY_RULE_SETUP
#line 1166 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 205:
YY_RULE_SETUP
#line 1167 "pir.l"
{ yylval->ival = atoi(yytext); return TK_INTC; }
    YY_BREAK
case 206:
YY_RULE_SETUP
#line 1169 "pir.l"
{ /* copy the string, remove the quotes. */
                          yylval->sval = dupstrn(yypirget_extra(yyscanner), yytext + 1, yyleng - 2);
                          return TK_STRINGC;
                        }
    YY_BREAK
case 207:
YY_RULE_SETUP
#line 1174 "pir.l"
{ /* ignore whitespace */ }
    YY_BREAK
case 208:
/* rule 208 can match eol */
YY_RULE_SETUP
#line 1176 "pir.l"
{ return TK_NL; }
    YY_BREAK
case 209:
YY_RULE_SETUP
#line 1178 "pir.l"
{ yypirerror(yyscanner, yypirget_extra(yyscanner),
                                     "unrecognized character: %c", yytext[0]);
                        }
    YY_BREAK
case YY_STATE_EOF(PASM):
#line 1181 "pir.l"
{ yyterminate(); }
    YY_BREAK
case 210:
YY_RULE_SETUP
#line 1183 "pir.l"
ECHO;
    YY_BREAK
#line 3713 "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
        {
            int 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 )
                {
                int new_size = b->yy_buf_size * 2;

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

                b->yy_ch_buf = (char *)
                    /* Include room in for 2 EOB chars. */
                    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, (size_t) 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 >= 829 )
                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 >= 829 )
            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 == 828);

    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 */
            int 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 EOF;

                    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 */
{
    int 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, int  _yybytes_len , yyscan_t yyscanner)
{
    YY_BUFFER_STATE b;
    char *buf;
    yy_size_t n;
    int 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.
 */
int 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 1183 "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:
 */

