#line 2 "pl_scan.c"

#line 4 "pl_scan.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer plpgsql_base_yy_create_buffer
#define yy_delete_buffer plpgsql_base_yy_delete_buffer
#define yy_flex_debug plpgsql_base_yy_flex_debug
#define yy_init_buffer plpgsql_base_yy_init_buffer
#define yy_flush_buffer plpgsql_base_yy_flush_buffer
#define yy_load_buffer_state plpgsql_base_yy_load_buffer_state
#define yy_switch_to_buffer plpgsql_base_yy_switch_to_buffer
#define yyin plpgsql_base_yyin
#define yyleng plpgsql_base_yyleng
#define yylex plpgsql_base_yylex
#define yylineno plpgsql_base_yylineno
#define yyout plpgsql_base_yyout
#define yyrestart plpgsql_base_yyrestart
#define yytext plpgsql_base_yytext
#define yywrap plpgsql_base_yywrap
#define yyalloc plpgsql_base_yyalloc
#define yyrealloc plpgsql_base_yyrealloc
#define yyfree plpgsql_base_yyfree

#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

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

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

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

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

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

#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

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

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

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

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

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

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

#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

extern int plpgsql_base_yyleng;

extern FILE *plpgsql_base_yyin, *plpgsql_base_yyout;

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

    #define YY_LESS_LINENO(n)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up plpgsql_base_yytext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = (yy_hold_char); \
		YY_RESTORE_YY_MORE_OFFSET \
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up plpgsql_base_yytext again */ \
		} \
	while ( 0 )

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

#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
	{
	FILE *yy_input_file;

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

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

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

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

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

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

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

	int yy_buffer_status;

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

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

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

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

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

/* yy_hold_char holds the character lost when plpgsql_base_yytext is formed. */
static char yy_hold_char;
static int yy_n_chars;		/* number of characters read into yy_ch_buf */
int plpgsql_base_yyleng;

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

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

void plpgsql_base_yyrestart (FILE *input_file  );
void plpgsql_base_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE plpgsql_base_yy_create_buffer (FILE *file,int size  );
void plpgsql_base_yy_delete_buffer (YY_BUFFER_STATE b  );
void plpgsql_base_yy_flush_buffer (YY_BUFFER_STATE b  );
void plpgsql_base_yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
void plpgsql_base_yypop_buffer_state (void );

static void plpgsql_base_yyensure_buffer_stack (void );
static void plpgsql_base_yy_load_buffer_state (void );
static void plpgsql_base_yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER plpgsql_base_yy_flush_buffer(YY_CURRENT_BUFFER )

YY_BUFFER_STATE plpgsql_base_yy_scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE plpgsql_base_yy_scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE plpgsql_base_yy_scan_bytes (yyconst char *bytes,int len  );

void *plpgsql_base_yyalloc (yy_size_t  );
void *plpgsql_base_yyrealloc (void *,yy_size_t  );
void plpgsql_base_yyfree (void *  );

#define yy_new_buffer plpgsql_base_yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        plpgsql_base_yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            plpgsql_base_yy_create_buffer(plpgsql_base_yyin,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        plpgsql_base_yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            plpgsql_base_yy_create_buffer(plpgsql_base_yyin,YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

#define plpgsql_base_yywrap(n) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;

FILE *plpgsql_base_yyin = (FILE *) 0, *plpgsql_base_yyout = (FILE *) 0;

typedef int yy_state_type;

extern int plpgsql_base_yylineno;

int plpgsql_base_yylineno = 1;

extern char *plpgsql_base_yytext;
#define yytext_ptr plpgsql_base_yytext

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

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

#define YY_NUM_RULES 90
#define YY_END_OF_BUFFER 91
/* 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[355] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   91,   89,
       72,   72,   89,   89,   78,   89,   89,   89,   70,   89,
        2,   54,   54,   54,   54,   54,   54,   54,   54,   54,
       54,   54,   54,   54,   54,   54,   54,   54,   89,   84,
       83,   81,   77,   76,   77,   87,   87,   88,   72,   71,
        0,   54,   85,   62,    0,   73,    3,   74,   70,    1,
        0,   54,    0,    0,   54,   54,   54,   54,   54,   54,
       54,   54,   79,   54,   54,   54,   54,   54,   54,   54,
       25,   26,   29,   54,   54,   54,   54,   54,   37,   54,
       54,   54,   54,   54,   54,   47,   54,   54,   54,    0,

       84,   82,   80,   75,   87,   86,    0,   54,    0,    0,
        0,    0,    0,   73,    0,    0,    0,    0,   55,   54,
       54,   54,   54,   54,   54,   54,   54,   54,   54,   54,
       17,   54,   54,   54,   54,   22,   54,   24,   54,   54,
       30,   54,   54,   33,   54,   54,   54,   54,   54,   54,
       54,   54,   54,   54,   54,   54,   54,   54,   54,    0,
        0,    0,    0,    0,    0,   63,    0,    0,    0,   55,
        0,   55,    0,    0,   54,   54,   54,   54,   54,   54,
       54,   54,   54,   54,   53,   14,   54,   54,   54,   20,
       54,   23,   27,   28,   31,   32,   54,   35,   36,   54,

       54,   54,   54,   54,   54,   54,   54,   46,   48,   54,
       50,   54,    0,    0,    0,    0,   63,    0,   63,    0,
        0,    0,    0,    0,    0,    0,    0,   56,    4,    5,
        6,   54,   54,   54,   10,   54,   54,   54,   54,   16,
       54,   54,   21,   54,   54,   39,   54,   54,   54,   54,
       54,   54,   54,   51,    0,    0,    0,    0,    0,    0,
        0,   64,    0,   57,    0,    0,    0,   56,    0,   56,
        0,   54,   54,    9,   54,   54,   54,   15,   54,   54,
       34,   54,   40,   54,   42,   54,   54,   45,   54,    0,
        0,   65,    0,    0,    0,   64,    0,   64,    0,    0,

        0,    0,    0,   54,   54,   11,   12,   54,   54,   19,
       38,   54,   43,   54,   49,   52,    0,    0,    0,    0,
        0,    0,   58,    0,    7,    8,   54,   54,   54,   54,
        0,    0,   66,    0,   60,    0,    0,   54,   18,   54,
       44,   68,    0,    0,    0,   59,   54,   41,    0,   67,
       61,   13,   69,    0
    } ;

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

       46,   47,   48,   49,   50,   26,   26,   51,   52,   53,
       54,   55,   26,   56,   57,   58,   59,   60,   61,   62,
       63,   26,    1,    1,    1,    1,    1,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,

       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26
    } ;

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

static yyconst flex_int16_t yy_base[381] =
    {   0,
        0,  243,   55,   56,   63,   64,   65,   68,  248, 2289,
       74,   77,   79,   76, 2289,  225,  216,  217,  208,  178,
     2289,   85,   96,  141,  180,  231,  273,  111,   99,  331,
      100,  104,  158,  170,  372,  200,  408,  221,   40,    0,
      179,    0, 2289, 2289,  173,    0,    0,  177,  118,  178,
      175,  239, 2289,  269,  172,    0, 2289, 2289,  163, 2289,
      144,  284,  153,  194,  313,  338,  272,  315,  363,  454,
      379,  401, 2289,  323,  310,  510,  408,  437,  371,  448,
      476,  452,  488,  493,  530,  547,  510,  551,  563,  575,
      565,  610,  600,  591,  603,  652,  669,  672,  664,   54,

        0, 2289, 2289, 2289,    0, 2289,  168,  689,  162,  703,
      218,  215,  131,    0,   56,   53,  251,  132,  714,  717,
      711,  605,  709,  680,  714,  718,  772,  779,  791,  767,
      804,  779,  799,  828,  814,  849,  863,  866,  846,  850,
      880,  891,  904,  877,  883,  897,  902,  910,  962,  918,
      941,  959,  979,  969,  964,  987,  985,  994,  995,   71,
      126,  110,  102,  522,  123, 1032,  132,  204,  121, 1053,
     1060, 1067,  233, 1078, 1044, 1045, 1065, 1091, 1085, 1086,
     1115, 1139, 1123, 1067, 1157, 1143, 1150, 1182, 1161, 1196,
     1214, 1221, 1228, 1239, 1242, 1253, 1239, 1264, 1267, 1247,

     1259, 1284, 1264, 1317, 1329, 1309, 1319, 1344, 1364, 1356,
     1376, 1368,  156,  243,  318,  119, 1393, 1405, 1417,  412,
     1428,  366,  211,  404,  398, 1432,  113,  500, 1436, 1439,
     1450, 1453, 1444, 1472, 1484, 1503, 1463, 1473, 1487, 1534,
     1545, 1548, 1559, 1520, 1572, 1583, 1569, 1597, 1536, 1585,
     1590, 1631, 1607, 1644,  435,  461,  216,  485,  519, 1619,
      101, 1420,  535, 2289,  552,  562,   86, 1664, 1594, 1608,
      562, 1628, 1643, 1680, 1655, 1704, 1657, 1715, 1690, 1701,
     1727, 1740, 1751, 1762, 1769, 1761, 1758, 1787, 1798,  570,
      567, 2289,  579,  604,   64, 1811, 1820, 1823,  607,  635,

      645,  274,  649, 1830, 1816, 1841, 1853, 1865, 1824, 1868,
     1882, 1852, 1889, 1867, 1905, 2289,  668,  705,  290,  701,
      333,  707, 2289,  716, 1923, 1926, 1897, 1911, 1927, 1947,
      348,  715, 2289,  754, 2289,  766,  369, 1941, 1972, 1986,
     1999, 2289,  779,  371,  387, 2289, 1971, 2011,  500, 2289,
     2289, 2018, 2289, 2289, 2031, 2042, 2053, 2064, 2070, 2080,
     2091, 2102, 2113, 2119, 2130, 2136, 2147, 2157, 2163, 2173,
     2184, 2194, 2205, 2215, 2225, 2235, 2246, 2256, 2267, 2277
    } ;

static yyconst flex_int16_t yy_def[381] =
    {   0,
      354,    1,  355,  355,  356,  356,  357,  357,  354,  354,
      354,  354,  358,  359,  354,  354,  354,  354,  354,  354,
      354,  360,  360,  360,   24,   24,   24,  360,  360,  360,
       24,   24,  360,  360,   24,  360,   24,  360,  354,  361,
      354,  362,  354,  354,  354,  363,  363,  364,  354,  365,
      365,  354,  354,  354,  366,  367,  354,  354,  354,  354,
      354,  360,  354,  368,  360,  360,   24,   30,  360,   30,
      360,  360,  354,   30,  360,  360,  360,  360,   24,  360,
      360,   30,  360,   24,  360,  360,   24,   76,  360,  360,
       76,   30,  360,   24,   76,  360,  360,  360,   76,  354,

      361,  354,  354,  354,  363,  354,  369,  354,  365,  354,
      354,  370,  366,  367,  354,  354,  368,  371,  372,  360,
       76,   30,   30,   30,   24,   24,  360,  360,  360,   76,
      360,   76,   76,  360,   76,  360,  360,  360,   24,   24,
      360,  360,  360,   76,   24,   30,   30,   30,  360,   24,
       24,   76,  360,   76,   30,   76,   30,   30,   24,  354,
      369,  354,  354,  370,  373,  374,  354,  354,  371,  354,
      354,  372,  354,  375,   30,   30,   76,  360,   76,   24,
      360,  360,   24,   30,  360,   76,   30,  360,   24,  360,
      360,  360,  360,  360,  360,  360,   76,  360,  360,   24,

       76,  360,   24,  360,  360,   76,   76,  360,  360,   76,
      360,   76,  354,  354,  354,  373,  354,  354,  374,  354,
      376,  354,  354,  354,  354,  375,  377,  378,  360,  360,
      360,  360,   30,  360,  360,  360,   24,   24,   30,  360,
      360,  360,  360,   76,  360,  360,   76,  360,   30,   30,
       24,  360,   30,  360,  354,  354,  354,  354,  354,  376,
      379,  380,  354,  354,  354,  354,  377,  354,  354,  378,
      354,   30,   24,  360,   76,  360,   30,  360,   76,   76,
      360,  360,  360,  360,  360,   76,   24,  360,  360,  354,
      354,  354,  354,  354,  379,  354,  354,  380,  354,  354,

      354,  354,  354,  360,   76,  360,  360,  360,   24,  360,
      360,   24,  360,   30,  360,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  360,  360,   76,   30,   76,  360,
      354,  354,  354,  354,  354,  354,  354,   76,  360,  360,
      360,  354,  354,  354,  354,  354,   30,  360,  354,  354,
      354,  360,  354,    0,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354
    } ;

static yyconst flex_int16_t yy_nxt[2353] =
    {   0,
       10,   11,   12,   11,   13,   10,   14,   10,   15,   10,
       16,   17,   18,   19,   20,   21,   22,   23,   24,   25,
       26,   27,   28,   29,   30,   29,   31,   29,   32,   33,
       34,   35,   36,   37,   29,   29,   38,   29,   29,   10,
       29,   22,   23,   24,   25,   26,   27,   28,   29,   30,
       31,   29,   32,   33,   34,   35,   36,   37,   29,   29,
       38,   29,   29,   41,   41,   44,   44,   47,  296,  100,
       47,   48,   45,   45,   48,   49,   49,   49,   49,   49,
       49,   51,   53,   52,  160,  167,   61,   61,   61,   54,
      268,  168,   63,  100,   42,   42,   64,   61,   61,   61,

       61,   61,   61,   63,  213,  296,   63,   64,  160,  167,
       64,   65,   61,   61,   61,  168,   66,  268,   63,   49,
       49,   49,   64,  217,   85,  170,   62,  217,  213,   84,
       62,   80,  106,   86,   62,   65,  170,   53,   87,  214,
      215,   66,   61,   61,   61,   61,   61,   61,   63,   85,
       62,   63,   64,   84,   62,   64,   80,   86,   62,   61,
       61,   61,   87,  214,  215,   63,  108,   67,  222,   64,
       68,   61,   61,   61,  106,   69,   59,   63,   53,  108,
      255,   64,  108,  106,  115,  104,  116,  102,   88,   89,
       90,   67,  222,   60,   68,  117,  117,  117,  118,   69,

       70,   61,   61,   61,   71,  255,   62,   63,  115,   62,
      116,   64,   88,   89,   72,   90,  164,  164,  164,  165,
       94,   59,   61,   61,   61,   70,   58,   57,   63,   71,
       62,  264,   64,   62,  223,   56,  292,   98,   72,   73,
       61,   61,   61,  109,   99,   94,   63,  354,   39,  162,
       64,  163,  117,  117,  117,  118,  264,   74,  223,   75,
       62,  292,   98,  354,  224,   62,  225,  354,   76,   99,
      110,  110,  110,  162,  354,  163,  111,  354,  354,  256,
      112,   74,   54,   75,   62,   61,   61,   61,  224,   62,
      225,   63,   76,   77,  323,   64,  354,  354,   62,   62,

      354,  122,   78,  256,   79,  354,   62,   62,  354,  354,
      333,   61,   61,   61,   61,   61,   61,   63,   77,  323,
       63,   64,   62,   62,   64,  122,   78,  354,   79,  131,
       62,   62,   61,   61,   61,  333,   62,  120,   63,   61,
       61,   61,   64,  123,   62,   63,  354,   62,  257,   64,
      354,   62,   81,  335,  131,  130,  354,  354,  354,   82,
      121,   62,  120,   83,   61,   61,   61,  123,  342,   62,
       63,   62,  257,  354,   64,   62,  354,   81,  335,  130,
       61,   61,   61,   82,  354,  121,   63,   83,   91,  346,
       64,  350,   92,  342,  124,  128,  354,   62,   62,  263,

      137,   93,   61,   61,   61,   62,   62,  351,   63,   61,
       61,   61,   64,   91,  346,   63,  350,   92,  124,   64,
      128,   62,   62,  263,  137,   93,  354,  354,  129,   62,
       62,   95,  351,  265,   62,  354,  266,   96,   61,   61,
       61,  135,   62,  258,   63,  259,   97,  354,   64,   61,
       61,   61,  129,  354,  354,   63,   95,  265,   62,   64,
      266,   96,  354,  354,  290,  135,   62,  258,  136,  259,
       97,  125,  126,  139,  354,  127,  354,   61,   61,   61,
       62,  138,   62,   63,   62,  140,   62,   64,  290,   61,
       61,   61,  136,  354,  291,   63,  125,  126,  139,   64,

      127,  269,  269,  269,   62,  138,   62,  271,   62,  140,
       62,   61,   61,   61,  293,  141,  354,   63,  291,   62,
      353,   64,  142,  164,  164,  164,  165,   62,  132,  354,
      133,   61,   61,   61,  134,  354,  145,   63,  293,   62,
      141,   64,  354,   62,   62,  353,  142,  354,   61,   61,
       61,   62,  354,  132,   63,  133,  354,  294,   64,  134,
      145,  354,  354,   62,   61,   61,   61,  143,   62,   62,
       63,  146,  354,  300,   64,   62,   61,   61,   61,  354,
      144,  294,   63,   62,  354,   62,   64,  354,  301,  148,
      354,  143,  302,  354,   62,  303,  146,  300,  316,  354,

       62,   61,   61,   61,  144,  317,  147,   63,   62,  354,
       62,   64,  301,  354,  148,  318,  302,  154,  354,  303,
       62,   62,  316,  155,  354,   62,   62,   62,  354,  317,
      147,   62,  354,   62,  319,  354,  153,  177,  149,  318,
      320,  154,  150,  151,   62,  152,   62,  354,  155,   62,
      354,   62,   62,   61,   61,   61,   62,   62,  319,   63,
      153,  177,  149,   64,  320,  321,  150,  151,  354,  152,
       61,   61,   61,   61,   61,   61,   63,  354,  322,   63,
       64,  354,   62,   64,  158,  354,  354,  324,  159,  321,
       61,   61,   61,  109,  354,  354,   63,  354,  331,  156,

       64,   62,  322,  157,  110,  110,  110,   62,   62,  158,
      111,  324,  180,  159,  112,  171,  171,  171,   61,   61,
       61,  173,  331,  156,   63,  174,   62,  157,   64,   62,
       62,   62,   62,  175,  354,  176,  180,   62,  332,  334,
       62,  178,  179,   62,  182,  336,  337,   62,  181,  354,
      354,  354,   62,  343,   62,   62,   62,  354,  175,  354,
      176,   62,  332,  334,   62,  178,  179,   62,  182,  336,
      337,   62,  181,   61,   61,   61,   62,  343,  354,   63,
       61,   61,   61,   64,  344,   62,   63,  186,  183,  354,
       64,  187,   61,   61,   61,  354,  345,   62,   63,  188,

      354,  184,   64,   62,  354,   61,   61,   61,  344,  349,
       62,   63,  186,  183,  354,   64,  187,  189,  354,   62,
      345,  185,   62,   62,  188,  354,  184,  354,   62,   61,
       61,   61,  191,  349,   62,   63,  354,  354,   62,   64,
      354,  354,  189,  354,   62,  185,  354,  354,   62,  354,
       61,   61,   61,  354,  354,  354,   63,  191,  354,   62,
       64,  190,  354,   62,   61,   61,   61,   61,   61,   61,
       63,  354,   62,   63,   64,  193,   62,   64,  354,  194,
       62,   61,   61,   61,   62,  190,  354,   63,  354,  354,
      192,   64,   61,   61,   61,   62,   62,   62,   63,  193,

       62,  197,   64,  194,   62,   61,   61,   61,   62,  198,
      354,   63,   62,  354,  192,   64,  354,   62,   62,  354,
       62,  195,   62,  200,  354,  199,  197,  354,  354,   62,
       62,   62,  354,  198,   62,  354,   62,  196,   62,  354,
      354,   62,  201,   62,   62,  195,  354,   62,  200,  199,
      354,  354,  203,   62,   62,  354,   62,  354,   62,  354,
      354,  196,   62,   61,   61,   61,  201,   62,   62,   63,
       62,   62,  354,   64,  354,  204,  203,   62,  202,  205,
       61,   61,   61,   62,  354,   62,   63,   62,  354,  207,
       64,   62,  208,   62,   62,  354,   62,  354,  354,  204,

      354,  354,   62,  202,  205,   62,   62,  209,   62,  354,
       62,   62,   62,  210,  207,   62,  208,   62,   62,  206,
       62,  212,  211,  354,   62,  354,   62,  354,  354,   62,
       62,   62,  209,  218,  218,  218,   62,  210,  354,  220,
       62,   62,  354,  221,  354,  212,  211,  354,   62,  354,
       62,  354,  354,   62,  171,  171,  171,  118,  354,  354,
      173,  171,  171,  171,  174,   62,   62,  173,  171,  171,
      171,  174,   62,  230,  173,  354,  229,   62,  174,  226,
      226,  226,  227,   62,  354,  231,  354,  354,   62,   62,
       62,   62,   61,   61,   61,  238,   62,  230,   63,   62,

      229,   62,   64,   62,  354,   62,  354,  354,   62,  233,
      231,  354,   62,   62,   62,  234,   61,   61,   61,  238,
       62,  354,   63,   62,  232,  354,   64,  354,   62,  354,
       62,  354,  354,  354,  233,  354,   62,  235,  354,  234,
       61,   61,   61,  354,   62,  354,   63,  354,  232,   62,
       64,  354,   62,  354,  354,  236,  354,  237,   61,   61,
       61,   62,  235,   62,   63,  354,  354,  239,   64,  354,
      354,  240,  354,   62,  354,  354,   62,  354,   62,  354,
      236,  237,   62,   61,   61,   61,   62,   62,   62,   63,
       62,  354,  239,   64,  354,  242,  240,   61,   61,   61,

      354,  354,   62,   63,  354,  354,   62,   64,  354,  354,
      354,   62,  241,  354,   62,   61,   61,   61,  354,  242,
      354,   63,   61,   61,   61,   64,  354,  354,   63,   61,
       61,   61,   64,  354,  354,   63,  241,  243,  354,   64,
       61,   61,   61,   61,   61,   61,   63,  354,  354,   63,
       64,  354,  354,   64,   61,   61,   61,  244,  354,   62,
       63,  354,  243,   62,   64,   61,   61,   61,   61,   61,
       61,   63,  354,   62,   63,   64,  245,   62,   64,  246,
      354,   62,  244,   62,   62,   61,   61,   61,   62,  354,
      248,   63,  354,   62,  354,   64,  354,   62,   62,  354,

      245,  354,   62,  354,  246,   62,  354,  354,   62,  354,
      354,  247,  354,  354,  248,  354,  354,   62,   61,   61,
       61,  354,   62,  354,   63,  354,  354,  251,   64,   62,
       61,   61,   61,   62,  354,  247,   63,  252,  354,   62,
       64,  354,  354,   62,  354,   61,   61,   61,  249,  354,
      354,   63,  251,  354,   62,   64,  354,  354,   62,  354,
      250,  354,  252,  354,   62,   61,   61,   61,   62,  354,
      354,   63,  249,  354,   62,   64,   62,   61,   61,   61,
      253,  354,  354,   63,  250,  354,   62,   64,  254,  354,
      354,  354,   62,  354,  218,  218,  218,  165,  354,   62,

      220,   62,  354,  354,  221,  253,  218,  218,  218,  354,
      354,   62,  220,  254,  354,  354,  221,   62,  218,  218,
      218,  297,  297,  297,  220,  354,  354,  299,  221,  260,
      260,  260,  261,  226,  226,  226,  227,   61,   61,   61,
       61,   61,   61,   63,  354,  354,   63,   64,  354,  354,
       64,   61,   61,   61,   61,   61,   61,   63,  354,  354,
       63,   64,  354,  354,   64,   62,  354,  354,  354,  272,
      354,  354,  273,   61,   61,   61,   62,  354,  354,   63,
      354,  354,  354,   64,  354,   61,   61,   61,  354,  276,
       62,   63,   62,  354,  272,   64,  273,   62,  354,   62,

       62,  354,  277,  274,   61,   61,   61,   62,  278,  354,
       63,  354,  354,  276,   64,   62,   62,  354,  354,   62,
      354,   62,  354,   62,  354,  354,  277,  274,  354,  354,
      354,   62,  354,  278,  275,   61,   61,   61,   62,   62,
      281,   63,  354,   62,   62,   64,   61,   61,   61,   61,
       61,   61,   63,  354,  354,   63,   64,   62,  275,   64,
       61,   61,   61,   62,  285,  281,   63,  354,   62,   62,
       64,  354,  354,   61,   61,   61,  354,  354,  279,   63,
      354,  280,   62,   64,   61,   61,   61,   62,  285,  283,
       63,  354,   62,   62,   64,  269,  269,  269,   61,   61,

       61,  271,  279,  282,   63,  280,   62,  354,   64,  269,
      269,  269,   62,   62,  283,  271,   62,  286,   62,  287,
      260,  260,  260,  261,   62,  354,  354,  282,   62,  354,
      284,   62,   61,   61,   61,  289,  354,   62,   63,   62,
       62,  286,   64,  287,  354,   61,   61,   61,   62,   62,
      354,   63,  354,   62,  284,   64,  304,  354,  354,  289,
       62,  354,  354,   62,  288,  269,  269,  269,  227,   62,
      354,  271,   62,   62,   62,  306,  354,  305,   62,   62,
      304,   61,   61,   61,   62,   62,  354,   63,  288,  308,
      354,   64,  354,   62,  354,  354,   62,  354,   62,  354,

      306,  305,  354,   62,   62,   61,   61,   61,   62,   62,
       62,   63,  354,  308,  309,   64,   61,   61,   61,   62,
      354,  310,   63,  354,  354,   62,   64,  354,   61,   61,
       61,  354,  354,   62,   63,   62,  354,  307,   64,  309,
      354,   61,   61,   61,   62,  354,  310,   63,  354,  354,
       62,   64,   61,   61,   61,  354,  354,  354,   63,  354,
      354,  307,   64,   61,   61,   61,  354,  311,  354,   63,
       61,   61,   61,   64,  354,  354,   63,  354,  354,   62,
       64,  313,  354,  354,   62,   62,  354,   62,   61,   61,
       61,  311,  314,  354,   63,  354,  354,  354,   64,   61,

       61,   61,  312,  354,   62,   63,  313,  354,   62,   64,
       62,   62,  297,  297,  297,  261,  314,  354,  299,  354,
      315,  297,  297,  297,  297,  297,  297,  299,  354,  354,
      299,   61,   61,   61,   62,  354,  326,   63,  354,  354,
       62,   64,   61,   61,   61,  315,  354,  354,   63,  354,
       62,  354,   64,  328,   61,   61,   61,  354,   62,   62,
       63,  326,  354,  325,   64,   62,   61,   61,   61,   61,
       61,   61,   63,  354,   62,   63,   64,  328,   62,   64,
      354,  329,   62,   61,   61,   61,   62,  325,   62,   63,
       61,   61,   61,   64,  354,  330,   63,  354,  327,   62,

       64,  354,   62,  354,  354,  329,   61,   61,   61,  354,
       62,  354,   63,   62,  354,   62,   64,   62,  354,  330,
      354,  338,  327,   62,   61,   61,   61,   61,   61,   61,
       63,  354,   62,   63,   64,  354,  354,   64,  354,  339,
       62,  354,   62,   62,  354,   62,  338,   62,   61,   61,
       61,  340,  354,  354,   63,  354,  354,   62,   64,  347,
      354,   62,  354,  339,  354,   62,  354,   62,  354,  354,
       62,  354,   62,   61,   61,   61,  340,  354,  354,   63,
      341,  354,  354,   64,  347,  354,   62,   61,   61,   61,
       62,  354,   62,   63,  354,  354,  354,   64,  354,   62,

       61,   61,   61,  352,  341,  348,   63,  354,  354,  354,
       64,  354,   61,   61,   61,  354,  354,   62,   63,   61,
       61,   61,   64,   62,  354,   63,  354,  352,  354,   64,
      348,   40,   40,   40,   40,   40,   40,   40,   40,   40,
       40,   40,   43,   43,   43,   43,   43,   43,   43,   43,
       43,   43,   43,   46,   46,   46,   46,   46,   46,   46,
       46,   46,   46,   46,   50,   50,   50,   50,   50,   50,
       50,   50,   50,   50,   50,   55,  354,  354,  354,   55,
       55,   62,   62,   62,  354,   62,   62,  354,   62,   62,
       62,  101,  101,  101,  101,  101,  101,  101,  354,  101,

      101,  101,  103,  103,  354,  103,  103,  103,  103,  103,
      103,  103,  103,  105,  105,  105,  105,  105,  354,  105,
      105,  105,  105,  105,  107,  354,  354,  354,  354,  107,
       51,   51,   51,   51,   51,   51,   51,   51,   51,   51,
       51,  113,  354,  354,  354,  113,  113,  114,  114,  354,
      354,  114,  114,  114,  114,  114,  114,  114,  119,  119,
      119,  119,  354,  354,  354,  354,  354,  119,  161,  354,
      354,  354,  161,  161,  166,  166,  166,  166,  354,  354,
      354,  354,  354,  166,  169,  169,  169,  169,  169,  169,
      169,  169,  169,  169,  169,  172,  172,  172,  354,  172,

      172,  354,  172,  172,  172,  216,  216,  216,  216,  216,
      216,  216,  216,  216,  216,  216,  219,  219,  219,  354,
      219,  219,  354,  219,  219,  219,  228,  228,  228,  228,
      354,  354,  354,  354,  354,  228,  262,  262,  262,  262,
      354,  354,  354,  354,  354,  262,  267,  267,  267,  267,
      267,  267,  267,  267,  267,  267,  267,  270,  270,  270,
      354,  270,  270,  354,  354,  270,  270,  295,  295,  295,
      295,  295,  295,  295,  295,  295,  295,  295,  298,  298,
      298,  354,  298,  298,  354,  354,  298,  298,    9,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,

      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354
    } ;

static yyconst flex_int16_t yy_chk[2353] =
    {   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,    3,    4,    5,    6,    7,  295,   39,
        8,    7,    5,    6,    8,   11,   11,   11,   12,   12,
       12,   13,   14,   13,  100,  115,   22,   22,   22,   14,
      267,  116,   22,   39,    3,    4,   22,   23,   23,   23,

       29,   29,   29,   23,  160,  261,   29,   23,  100,  115,
       29,   22,   28,   28,   28,  116,   23,  227,   28,   49,
       49,   49,   28,  216,   32,  169,   31,  165,  160,   31,
       32,   28,  161,   32,   31,   22,  118,  113,   32,  162,
      163,   23,   24,   24,   24,   61,   61,   61,   24,   32,
       31,   61,   24,   31,   32,   61,   28,   32,   31,   33,
       33,   33,   32,  162,  163,   33,  109,   24,  167,   33,
       24,   34,   34,   34,  107,   24,   59,   34,   55,   51,
      213,   34,   50,   48,   63,   45,   63,   41,   33,   33,
       34,   24,  167,   20,   24,   64,   64,   64,   64,   24,

       25,   36,   36,   36,   25,  213,   25,   36,   63,   25,
       63,   36,   33,   33,   25,   34,  112,  112,  112,  112,
       36,   19,   38,   38,   38,   25,   18,   17,   38,   25,
       25,  223,   38,   25,  168,   16,  257,   38,   25,   26,
       52,   52,   52,   52,   38,   36,   52,    9,    2,  111,
       52,  111,  117,  117,  117,  117,  223,   26,  168,   26,
       26,  257,   38,    0,  173,   26,  173,    0,   26,   38,
       54,   54,   54,  111,    0,  111,   54,    0,    0,  214,
       54,   26,   54,   26,   26,   62,   62,   62,  173,   26,
      173,   62,   26,   27,  302,   62,    0,    0,   67,   27,

        0,   67,   27,  214,   27,    0,   67,   27,    0,    0,
      319,   75,   75,   75,   65,   65,   65,   75,   27,  302,
       65,   75,   67,   27,   65,   67,   27,    0,   27,   75,
       67,   27,   30,   30,   30,  319,   68,   65,   30,   66,
       66,   66,   30,   68,   74,   66,    0,   68,  215,   66,
        0,   74,   30,  321,   75,   74,    0,    0,    0,   30,
       66,   68,   65,   30,   69,   69,   69,   68,  331,   74,
       69,   68,  215,    0,   69,   74,    0,   30,  321,   74,
       71,   71,   71,   30,    0,   66,   71,   30,   35,  337,
       71,  344,   35,  331,   69,   71,    0,   79,   35,  222,

       79,   35,   72,   72,   72,   79,   35,  345,   72,   77,
       77,   77,   72,   35,  337,   77,  344,   35,   69,   77,
       71,   79,   35,  222,   79,   35,    0,    0,   72,   79,
       35,   37,  345,  224,   37,    0,  225,   37,   78,   78,
       78,   77,   37,  220,   78,  220,   37,    0,   78,   80,
       80,   80,   72,    0,    0,   80,   37,  224,   37,   80,
      225,   37,    0,    0,  255,   77,   37,  220,   78,  220,
       37,   70,   70,   82,    0,   70,    0,   81,   81,   81,
       82,   80,   70,   81,   82,   82,   70,   81,  255,   83,
       83,   83,   78,    0,  256,   83,   70,   70,   82,   83,

       70,  228,  228,  228,   82,   80,   70,  228,   82,   82,
       70,   76,   76,   76,  258,   84,    0,   76,  256,   84,
      349,   76,   84,  164,  164,  164,  164,   84,   76,    0,
       76,   85,   85,   85,   76,    0,   87,   85,  258,   87,
       84,   85,    0,   84,   87,  349,   84,    0,   86,   86,
       86,   84,    0,   76,   86,   76,    0,  259,   86,   76,
       87,    0,    0,   87,   89,   89,   89,   85,   87,   88,
       89,   88,    0,  263,   89,   88,   90,   90,   90,    0,
       86,  259,   90,   91,    0,   91,   90,    0,  265,   91,
        0,   85,  266,    0,   88,  271,   88,  263,  290,    0,

       88,   93,   93,   93,   86,  291,   90,   93,   91,    0,
       91,   93,  265,    0,   91,  293,  266,   94,    0,  271,
       94,   95,  290,   95,    0,   94,  122,   95,    0,  291,
       90,   92,    0,  122,  294,    0,   93,  122,   92,  293,
      299,   94,   92,   92,   94,   92,   95,    0,   95,   94,
        0,  122,   95,   96,   96,   96,   92,  122,  294,   96,
       93,  122,   92,   96,  299,  300,   92,   92,    0,   92,
       97,   97,   97,   98,   98,   98,   97,    0,  301,   98,
       97,    0,   99,   98,   99,    0,    0,  303,   99,  300,
      108,  108,  108,  108,    0,    0,  108,    0,  317,   97,

      108,  124,  301,   98,  110,  110,  110,   99,  124,   99,
      110,  303,  124,   99,  110,  119,  119,  119,  120,  120,
      120,  119,  317,   97,  120,  119,  124,   98,  120,  121,
      123,  121,  124,  120,    0,  121,  124,  123,  318,  320,
      125,  123,  123,  125,  126,  322,  324,  126,  125,    0,
        0,    0,  126,  332,  121,  123,  121,    0,  120,    0,
      121,  123,  318,  320,  125,  123,  123,  125,  126,  322,
      324,  126,  125,  127,  127,  127,  126,  332,    0,  127,
      128,  128,  128,  127,  334,  130,  128,  130,  127,    0,
      128,  130,  129,  129,  129,    0,  336,  132,  129,  132,

        0,  128,  129,  132,    0,  131,  131,  131,  334,  343,
      130,  131,  130,  127,    0,  131,  130,  133,    0,  133,
      336,  129,  132,  133,  132,    0,  128,    0,  132,  134,
      134,  134,  135,  343,  135,  134,    0,    0,  135,  134,
        0,    0,  133,    0,  133,  129,    0,    0,  133,    0,
      136,  136,  136,    0,    0,    0,  136,  135,    0,  135,
      136,  134,    0,  135,  137,  137,  137,  138,  138,  138,
      137,    0,  139,  138,  137,  139,  140,  138,    0,  140,
      139,  141,  141,  141,  140,  134,    0,  141,    0,    0,
      137,  141,  142,  142,  142,  144,  139,  144,  142,  139,

      140,  144,  142,  140,  139,  143,  143,  143,  140,  145,
        0,  143,  145,    0,  137,  143,    0,  145,  146,    0,
      144,  142,  144,  147,    0,  146,  144,    0,    0,  146,
      147,  148,    0,  145,  147,    0,  145,  143,  148,    0,
        0,  145,  148,  146,  150,  142,    0,  150,  147,  146,
        0,    0,  150,  146,  147,    0,  148,    0,  147,    0,
        0,  143,  148,  149,  149,  149,  148,  151,  150,  149,
      151,  150,    0,  149,    0,  151,  150,  152,  149,  152,
      153,  153,  153,  152,    0,  155,  153,  154,    0,  154,
      153,  151,  155,  154,  151,    0,  155,    0,    0,  151,

        0,    0,  152,  149,  152,  156,  157,  156,  152,    0,
      155,  156,  154,  157,  154,  158,  155,  157,  154,  153,
      155,  159,  158,    0,  159,    0,  158,    0,    0,  159,
      156,  157,  156,  166,  166,  166,  156,  157,    0,  166,
      158,  157,    0,  166,    0,  159,  158,    0,  159,    0,
      158,    0,    0,  159,  170,  170,  170,  170,    0,    0,
      170,  171,  171,  171,  170,  175,  176,  171,  172,  172,
      172,  171,  175,  176,  172,    0,  175,  176,  172,  174,
      174,  174,  174,  177,    0,  177,    0,    0,  184,  177,
      175,  176,  178,  178,  178,  184,  175,  176,  178,  184,

      175,  176,  178,  179,    0,  179,    0,    0,  177,  179,
      177,    0,  180,  184,  177,  180,  181,  181,  181,  184,
      180,    0,  181,  184,  178,    0,  181,    0,  179,    0,
      179,    0,    0,    0,  179,    0,  180,  181,    0,  180,
      182,  182,  182,    0,  180,    0,  182,    0,  178,  183,
      182,    0,  183,    0,    0,  182,    0,  183,  185,  185,
      185,  186,  181,  186,  185,    0,    0,  186,  185,    0,
        0,  187,    0,  183,    0,    0,  183,    0,  187,    0,
      182,  183,  187,  188,  188,  188,  186,  189,  186,  188,
      189,    0,  186,  188,    0,  189,  187,  190,  190,  190,

        0,    0,  187,  190,    0,    0,  187,  190,    0,    0,
        0,  189,  188,    0,  189,  191,  191,  191,    0,  189,
        0,  191,  192,  192,  192,  191,    0,    0,  192,  193,
      193,  193,  192,    0,    0,  193,  188,  191,    0,  193,
      194,  194,  194,  195,  195,  195,  194,    0,    0,  195,
      194,    0,    0,  195,  196,  196,  196,  197,    0,  197,
      196,    0,  191,  197,  196,  198,  198,  198,  199,  199,
      199,  198,    0,  200,  199,  198,  200,  201,  199,  201,
        0,  200,  197,  201,  197,  202,  202,  202,  197,    0,
      203,  202,    0,  203,    0,  202,    0,  200,  203,    0,

      200,    0,  201,    0,  201,  200,    0,    0,  201,    0,
        0,  202,    0,    0,  203,    0,    0,  203,  204,  204,
      204,    0,  203,    0,  204,    0,    0,  206,  204,  206,
      205,  205,  205,  206,    0,  202,  205,  207,    0,  207,
      205,    0,    0,  207,    0,  208,  208,  208,  204,    0,
        0,  208,  206,    0,  206,  208,    0,    0,  206,    0,
      205,    0,  207,    0,  207,  209,  209,  209,  207,    0,
        0,  209,  204,    0,  210,  209,  210,  211,  211,  211,
      210,    0,    0,  211,  205,    0,  212,  211,  212,    0,
        0,    0,  212,    0,  217,  217,  217,  217,    0,  210,

      217,  210,    0,    0,  217,  210,  218,  218,  218,    0,
        0,  212,  218,  212,    0,    0,  218,  212,  219,  219,
      219,  262,  262,  262,  219,    0,    0,  262,  219,  221,
      221,  221,  221,  226,  226,  226,  226,  229,  229,  229,
      230,  230,  230,  229,    0,    0,  230,  229,    0,    0,
      230,  231,  231,  231,  232,  232,  232,  231,    0,    0,
      232,  231,    0,    0,  232,  233,    0,    0,    0,  232,
        0,    0,  233,  234,  234,  234,  233,    0,    0,  234,
        0,    0,    0,  234,    0,  235,  235,  235,    0,  237,
      233,  235,  237,    0,  232,  235,  233,  237,    0,  238,

      233,    0,  238,  234,  236,  236,  236,  238,  239,    0,
      236,    0,    0,  237,  236,  239,  237,    0,    0,  239,
        0,  237,    0,  238,    0,    0,  238,  234,    0,    0,
        0,  238,    0,  239,  236,  240,  240,  240,  244,  239,
      244,  240,    0,  239,  244,  240,  241,  241,  241,  242,
      242,  242,  241,    0,    0,  242,  241,  249,  236,  242,
      243,  243,  243,  244,  249,  244,  243,    0,  249,  244,
      243,    0,    0,  245,  245,  245,    0,    0,  241,  245,
        0,  242,  249,  245,  246,  246,  246,  247,  249,  247,
      246,    0,  249,  247,  246,  269,  269,  269,  248,  248,

      248,  269,  241,  245,  248,  242,  250,    0,  248,  270,
      270,  270,  247,  250,  247,  270,  251,  250,  247,  251,
      260,  260,  260,  260,  251,    0,    0,  245,  253,    0,
      248,  250,  252,  252,  252,  253,    0,  250,  252,  253,
      251,  250,  252,  251,    0,  254,  254,  254,  251,  272,
        0,  254,    0,  253,  248,  254,  272,    0,    0,  253,
      272,    0,    0,  253,  252,  268,  268,  268,  268,  273,
        0,  268,  273,  275,  272,  275,    0,  273,  277,  275,
      272,  274,  274,  274,  272,  277,    0,  274,  252,  277,
        0,  274,    0,  273,    0,    0,  273,    0,  275,    0,

      275,  273,    0,  277,  275,  276,  276,  276,  279,  277,
      279,  276,    0,  277,  279,  276,  278,  278,  278,  280,
        0,  280,  278,    0,    0,  280,  278,    0,  281,  281,
      281,    0,    0,  279,  281,  279,    0,  276,  281,  279,
        0,  282,  282,  282,  280,    0,  280,  282,    0,    0,
      280,  282,  283,  283,  283,    0,    0,    0,  283,    0,
        0,  276,  283,  284,  284,  284,    0,  282,    0,  284,
      285,  285,  285,  284,    0,    0,  285,    0,    0,  286,
      285,  286,    0,    0,  287,  286,    0,  287,  288,  288,
      288,  282,  287,    0,  288,    0,    0,    0,  288,  289,

      289,  289,  284,    0,  286,  289,  286,    0,  287,  289,
      286,  287,  296,  296,  296,  296,  287,    0,  296,    0,
      289,  297,  297,  297,  298,  298,  298,  297,    0,    0,
      298,  304,  304,  304,  305,    0,  305,  304,    0,    0,
      305,  304,  306,  306,  306,  289,    0,    0,  306,    0,
      309,    0,  306,  309,  307,  307,  307,    0,  309,  305,
      307,  305,    0,  304,  307,  305,  308,  308,  308,  310,
      310,  310,  308,    0,  309,  310,  308,  309,  312,  310,
        0,  312,  309,  311,  311,  311,  312,  304,  314,  311,
      313,  313,  313,  311,    0,  314,  313,    0,  308,  314,

      313,    0,  312,    0,    0,  312,  315,  315,  315,    0,
      312,    0,  315,  314,    0,  327,  315,  327,    0,  314,
        0,  327,  308,  314,  325,  325,  325,  326,  326,  326,
      325,    0,  328,  326,  325,    0,    0,  326,    0,  328,
      327,    0,  327,  328,    0,  329,  327,  329,  330,  330,
      330,  329,    0,    0,  330,    0,    0,  328,  330,  338,
        0,  338,    0,  328,    0,  338,    0,  328,    0,    0,
      329,    0,  329,  339,  339,  339,  329,    0,    0,  339,
      330,    0,    0,  339,  338,    0,  338,  340,  340,  340,
      338,    0,  347,  340,    0,    0,    0,  340,    0,  347,

      341,  341,  341,  347,  330,  340,  341,    0,    0,    0,
      341,    0,  348,  348,  348,    0,    0,  347,  348,  352,
      352,  352,  348,  347,    0,  352,    0,  347,    0,  352,
      340,  355,  355,  355,  355,  355,  355,  355,  355,  355,
      355,  355,  356,  356,  356,  356,  356,  356,  356,  356,
      356,  356,  356,  357,  357,  357,  357,  357,  357,  357,
      357,  357,  357,  357,  358,  358,  358,  358,  358,  358,
      358,  358,  358,  358,  358,  359,    0,    0,    0,  359,
      359,  360,  360,  360,    0,  360,  360,    0,  360,  360,
      360,  361,  361,  361,  361,  361,  361,  361,    0,  361,

      361,  361,  362,  362,    0,  362,  362,  362,  362,  362,
      362,  362,  362,  363,  363,  363,  363,  363,    0,  363,
      363,  363,  363,  363,  364,    0,    0,    0,    0,  364,
      365,  365,  365,  365,  365,  365,  365,  365,  365,  365,
      365,  366,    0,    0,    0,  366,  366,  367,  367,    0,
        0,  367,  367,  367,  367,  367,  367,  367,  368,  368,
      368,  368,    0,    0,    0,    0,    0,  368,  369,    0,
        0,    0,  369,  369,  370,  370,  370,  370,    0,    0,
        0,    0,    0,  370,  371,  371,  371,  371,  371,  371,
      371,  371,  371,  371,  371,  372,  372,  372,    0,  372,

      372,    0,  372,  372,  372,  373,  373,  373,  373,  373,
      373,  373,  373,  373,  373,  373,  374,  374,  374,    0,
      374,  374,    0,  374,  374,  374,  375,  375,  375,  375,
        0,    0,    0,    0,    0,  375,  376,  376,  376,  376,
        0,    0,    0,    0,    0,  376,  377,  377,  377,  377,
      377,  377,  377,  377,  377,  377,  377,  378,  378,  378,
        0,  378,  378,    0,    0,  378,  378,  379,  379,  379,
      379,  379,  379,  379,  379,  379,  379,  379,  380,  380,
      380,    0,  380,  380,    0,    0,  380,  380,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,

      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354,  354,  354,  354,  354,  354,  354,  354,  354,
      354,  354
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int plpgsql_base_yy_flex_debug;
int plpgsql_base_yy_flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *plpgsql_base_yytext;
#line 1 "scan.l"
#line 2 "scan.l"
/**********************************************************************
 * scan.l		- Scanner for the PL/pgSQL
 *			  procedural language
 *
 * IDENTIFICATION
 *    $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.42.2.1 2006/08/14 00:46:59 tgl Exp $
 *
 *    This software is copyrighted by Jan Wieck - Hamburg.
 *
 *    The author hereby grants permission  to  use,  copy,  modify,
 *    distribute,  and  license this software and its documentation
 *    for any purpose, provided that existing copyright notices are
 *    retained  in  all  copies  and  that  this notice is included
 *    verbatim in any distributions. No written agreement, license,
 *    or  royalty  fee  is required for any of the authorized uses.
 *    Modifications to this software may be  copyrighted  by  their
 *    author  and  need  not  follow  the licensing terms described
 *    here, provided that the new terms are  clearly  indicated  on
 *    the first page of each file where they apply.
 *
 *    IN NO EVENT SHALL THE AUTHOR OR DISTRIBUTORS BE LIABLE TO ANY
 *    PARTY  FOR  DIRECT,   INDIRECT,   SPECIAL,   INCIDENTAL,   OR
 *    CONSEQUENTIAL   DAMAGES  ARISING  OUT  OF  THE  USE  OF  THIS
 *    SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN
 *    IF  THE  AUTHOR  HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
 *    DAMAGE.
 *
 *    THE  AUTHOR  AND  DISTRIBUTORS  SPECIFICALLY   DISCLAIM   ANY
 *    WARRANTIES,  INCLUDING,  BUT  NOT  LIMITED  TO,  THE  IMPLIED
 *    WARRANTIES  OF  MERCHANTABILITY,  FITNESS  FOR  A  PARTICULAR
 *    PURPOSE,  AND NON-INFRINGEMENT.  THIS SOFTWARE IS PROVIDED ON
 *    AN "AS IS" BASIS, AND THE AUTHOR  AND  DISTRIBUTORS  HAVE  NO
 *    OBLIGATION   TO   PROVIDE   MAINTENANCE,   SUPPORT,  UPDATES,
 *    ENHANCEMENTS, OR MODIFICATIONS.
 *
 **********************************************************************/

#include "plpgsql.h"

#include "mb/pg_wchar.h"


/* No reason to constrain amount of data slurped */
#define YY_READ_BUF_SIZE 16777216

/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#undef fprintf
#define fprintf(file, fmt, msg)  ereport(ERROR, (errmsg_internal("%s", msg)))

/* Handles to the buffer that the lexer uses internally */
static YY_BUFFER_STATE scanbufhandle;
static char *scanbuf;

static const char *scanstr;		/* original input string */

static int	scanner_functype;
static bool	scanner_typereported;
static int	pushback_token;
static bool have_pushback_token;
static const char *cur_line_start;
static int	cur_line_num;
static char    *dolqstart;      /* current $foo$ quote start string */
static int	dolqlen;			/* signal to plpgsql_get_string_value */

bool plpgsql_SpaceScanned = false;



/* $foo$ style quotes ("dollar quoting")
 * copied straight from the backend SQL parser
 */
#line 1184 "pl_scan.c"

#define INITIAL 0
#define IN_STRING 1
#define IN_COMMENT 2
#define IN_DOLLARQUOTE 3

#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.
 */
#include <unistd.h>
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

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

int plpgsql_base_yylex_destroy (void );

int plpgsql_base_yyget_debug (void );

void plpgsql_base_yyset_debug (int debug_flag  );

YY_EXTRA_TYPE plpgsql_base_yyget_extra (void );

void plpgsql_base_yyset_extra (YY_EXTRA_TYPE user_defined  );

FILE *plpgsql_base_yyget_in (void );

void plpgsql_base_yyset_in  (FILE * in_str  );

FILE *plpgsql_base_yyget_out (void );

void plpgsql_base_yyset_out  (FILE * out_str  );

int plpgsql_base_yyget_leng (void );

char *plpgsql_base_yyget_text (void );

int plpgsql_base_yyget_lineno (void );

void plpgsql_base_yyset_lineno (int line_number  );

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

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

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

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

#ifndef YY_NO_INPUT

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

#endif

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

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO fwrite( plpgsql_base_yytext, plpgsql_base_yyleng, 1, plpgsql_base_yyout )
#endif

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

#endif

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

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

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

/* end tables serialization structures and prototypes */

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

extern int plpgsql_base_yylex (void);

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

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

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

#define YY_RULE_SETUP \
	if ( plpgsql_base_yyleng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(plpgsql_base_yytext[plpgsql_base_yyleng - 1] == '\n'); \
	YY_USER_ACTION

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

    /* ----------
     * Local variables in scanner to remember where
     * a string or comment started
     * ----------
     */
    int	start_lineno = 0;
	char *start_charpos = NULL;

    /* ----------
     * Reset the state when entering the scanner
     * ----------
     */
    BEGIN(INITIAL);
    plpgsql_SpaceScanned = false;

    /* ----------
     * On the first call to a new source report the
     * function's type (T_FUNCTION or T_TRIGGER)
     * ----------
     */
	if (!scanner_typereported)
	{
		scanner_typereported = true;
		return scanner_functype;
	}

    /* ----------
     * The keyword rules
     * ----------
     */
#line 1402 "pl_scan.c"

	if ( !(yy_init) )
		{
		(yy_init) = 1;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! plpgsql_base_yyin )
			plpgsql_base_yyin = stdin;

		if ( ! plpgsql_base_yyout )
			plpgsql_base_yyout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			plpgsql_base_yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				plpgsql_base_yy_create_buffer(plpgsql_base_yyin,YY_BUF_SIZE );
		}

		plpgsql_base_yy_load_buffer_state( );
		}

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

		/* Support of plpgsql_base_yytext. */
		*yy_cp = (yy_hold_char);

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

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

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

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

		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = (yy_hold_char);
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
			goto yy_find_action;

case 1:
YY_RULE_SETUP
#line 133 "scan.l"
{ return K_ASSIGN;			}
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 134 "scan.l"
{ return K_ASSIGN;			}
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 135 "scan.l"
{ return K_DOTDOT;			}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 136 "scan.l"
{ return K_ALIAS;			}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 137 "scan.l"
{ return K_BEGIN;			}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 138 "scan.l"
{ return K_CLOSE;			}
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 139 "scan.l"
{ return K_CONSTANT;		}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 140 "scan.l"
{ return K_CONTINUE;		}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 141 "scan.l"
{ return K_CURSOR;			}
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 142 "scan.l"
{ return K_DEBUG;			}
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 143 "scan.l"
{ return K_DECLARE;			}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 144 "scan.l"
{ return K_DEFAULT;			}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 145 "scan.l"
{ return K_DIAGNOSTICS;		}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 146 "scan.l"
{ return K_ELSE;			}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 147 "scan.l"
{ return K_ELSIF;           }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 148 "scan.l"
{ return K_ELSIF;           }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 149 "scan.l"
{ return K_END;				}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 150 "scan.l"
{ return K_EXCEPTION;		}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 151 "scan.l"
{ return K_EXECUTE;			}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 152 "scan.l"
{ return K_EXIT;			}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 153 "scan.l"
{ return K_FETCH;			}
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 154 "scan.l"
{ return K_FOR;				}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 155 "scan.l"
{ return K_FROM;			}
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 156 "scan.l"
{ return K_GET;				}
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 157 "scan.l"
{ return K_IF;				}
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 158 "scan.l"
{ return K_IN;				}
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 159 "scan.l"
{ return K_INFO;			}
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 160 "scan.l"
{ return K_INTO;			}
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 161 "scan.l"
{ return K_IS;				}
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 162 "scan.l"
{ return K_LOG;				}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 163 "scan.l"
{ return K_LOOP;			}
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 164 "scan.l"
{ return K_NEXT;			}
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 165 "scan.l"
{ return K_NOT;				}
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 166 "scan.l"
{ return K_NOTICE;			}
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 167 "scan.l"
{ return K_NULL;			}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 168 "scan.l"
{ return K_OPEN;			}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 169 "scan.l"
{ return K_OR;				}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 170 "scan.l"
{ return K_PERFORM;			}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 171 "scan.l"
{ return K_RAISE;			}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 172 "scan.l"
{ return K_RENAME;			}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 173 "scan.l"
{ return K_RESULT_OID;		}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 174 "scan.l"
{ return K_RETURN;			}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 175 "scan.l"
{ return K_REVERSE;			}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 176 "scan.l"
{ return K_ROW_COUNT;		}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 177 "scan.l"
{ return K_SELECT;			}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 178 "scan.l"
{ return K_THEN;			}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 179 "scan.l"
{ return K_TO;				}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 180 "scan.l"
{ return K_TYPE;			}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 181 "scan.l"
{ return K_WARNING;			}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 182 "scan.l"
{ return K_WHEN;			}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 183 "scan.l"
{ return K_WHILE;			}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 185 "scan.l"
{ return O_OPTION;			}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 186 "scan.l"
{ return O_DUMP;			}
	YY_BREAK
/* ----------
     * Special word rules
	 *
	 * We set plpgsql_error_lineno in each rule so that errors reported
	 * in the pl_comp.c subroutines will point to the right place.
     * ----------
     */
case 54:
/* rule 54 can match eol */
YY_RULE_SETUP
#line 196 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 55:
/* rule 55 can match eol */
YY_RULE_SETUP
#line 199 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
#line 202 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
#line 205 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
#line 208 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
#line 211 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
#line 214 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
#line 217 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 220 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
#line 223 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
#line 226 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 65:
/* rule 65 can match eol */
YY_RULE_SETUP
#line 229 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 66:
/* rule 66 can match eol */
YY_RULE_SETUP
#line 232 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
#line 235 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 68:
/* rule 68 can match eol */
YY_RULE_SETUP
#line 238 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
#line 241 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 245 "scan.l"
{ return T_NUMBER;			}
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 247 "scan.l"
{
				plpgsql_error_lineno = plpgsql_scanner_lineno();
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated quoted identifier")));
			}
	YY_BREAK
/* ----------
     * Ignore whitespaces but remember this happened
     * ----------
     */
case 72:
/* rule 72 can match eol */
YY_RULE_SETUP
#line 258 "scan.l"
{ plpgsql_SpaceScanned = true;		}
	YY_BREAK
/* ----------
     * Eat up comments
     * ----------
     */
case 73:
YY_RULE_SETUP
#line 264 "scan.l"
;
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 266 "scan.l"
{ start_lineno = plpgsql_scanner_lineno();
			  BEGIN(IN_COMMENT);
			}
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 269 "scan.l"
{ BEGIN(INITIAL); plpgsql_SpaceScanned = true; }
	YY_BREAK
case 76:
/* rule 76 can match eol */
YY_RULE_SETUP
#line 270 "scan.l"
;
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 271 "scan.l"
;
	YY_BREAK
case YY_STATE_EOF(IN_COMMENT):
#line 272 "scan.l"
{
				plpgsql_error_lineno = start_lineno;
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated comment")));
			}
	YY_BREAK
/* ----------
     * Collect anything inside of ''s and return one STRING token
	 *
	 * Hacking plpgsql_base_yytext/plpgsql_base_yyleng here lets us avoid using yymore(), which is
	 * a win for performance.  It's safe because we know the underlying
	 * input buffer is not changing.
     * ----------
     */
case 78:
YY_RULE_SETUP
#line 287 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  BEGIN(IN_STRING);
			}
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 292 "scan.l"
{
			  /* for now, treat the same as a regular literal */
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  BEGIN(IN_STRING);
			}
	YY_BREAK
case 80:
YY_RULE_SETUP
#line 298 "scan.l"
{ }
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 299 "scan.l"
{ /* can only happen with \ at EOF */ }
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 300 "scan.l"
{ }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 301 "scan.l"
{
			  /* tell plpgsql_get_string_value it's not a dollar quote */
			  dolqlen = 0;
			  /* adjust plpgsql_base_yytext/plpgsql_base_yyleng to describe whole string token */
			  plpgsql_base_yyleng += (plpgsql_base_yytext - start_charpos);
			  plpgsql_base_yytext = start_charpos;
			  BEGIN(INITIAL);
			  return T_STRING;
			}
	YY_BREAK
case 84:
/* rule 84 can match eol */
YY_RULE_SETUP
#line 310 "scan.l"
{ }
	YY_BREAK
case YY_STATE_EOF(IN_STRING):
#line 311 "scan.l"
{
				plpgsql_error_lineno = start_lineno;
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated string")));
			}
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 318 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  dolqstart = pstrdup(plpgsql_base_yytext);
			  BEGIN(IN_DOLLARQUOTE);
			}
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 324 "scan.l"
{
			  if (strcmp(plpgsql_base_yytext, dolqstart) == 0)
			  {
					pfree(dolqstart);
					/* tell plpgsql_get_string_value it is a dollar quote */
					dolqlen = plpgsql_base_yyleng;
					/* adjust plpgsql_base_yytext/plpgsql_base_yyleng to describe whole string token */
					plpgsql_base_yyleng += (plpgsql_base_yytext - start_charpos);
					plpgsql_base_yytext = start_charpos;
					BEGIN(INITIAL);
					return T_STRING;
			  }
			  else
			  {
					/*
					 * When we fail to match $...$ to dolqstart, transfer
					 * the $... part to the output, but put back the final
					 * $ for rescanning.  Consider $delim$...$junk$delim$
					 */
					yyless(plpgsql_base_yyleng-1);
			  }
			}
	YY_BREAK
case 87:
/* rule 87 can match eol */
YY_RULE_SETUP
#line 346 "scan.l"
{ }
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 347 "scan.l"
{ /* needed for $ inside the quoted text */ }
	YY_BREAK
case YY_STATE_EOF(IN_DOLLARQUOTE):
#line 348 "scan.l"
{ 
				plpgsql_error_lineno = start_lineno;
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated dollar-quoted string")));
			}
	YY_BREAK
/* ----------
     * Any unmatched character is returned as is
     * ----------
     */
case 89:
YY_RULE_SETUP
#line 359 "scan.l"
{ return plpgsql_base_yytext[0];			}
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 361 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 2087 "pl_scan.c"
case YY_STATE_EOF(INITIAL):
	yyterminate();

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

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

		if ( YY_CURRENT_BUFFER_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 plpgsql_base_yyin at a new source and called
			 * plpgsql_base_yylex().  If so, then we have to assure
			 * consistency between YY_CURRENT_BUFFER and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = plpgsql_base_yyin;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

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

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

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

			else
				{
				yy_cp = (yy_last_accepting_cpos);
				yy_current_state = (yy_last_accepting_state);
				goto yy_find_action;
				}
			}

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

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

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

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

			case EOB_ACT_CONTINUE_SCAN:
				(yy_c_buf_p) =
					(yytext_ptr) + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state(  );

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

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

				yy_current_state = yy_get_previous_state(  );

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

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

/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */
static int yy_get_next_buffer (void)
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = (yytext_ptr);
	register int number_to_move, i;
	int ret_val;

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

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

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

	/* Try to read more data. */

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

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

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

	else
		{
			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) ((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. */
					plpgsql_base_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

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

			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	if ( (yy_n_chars) == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			plpgsql_base_yyrestart(plpgsql_base_yyin  );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	if ((yy_size_t) ((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 = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) plpgsql_base_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
	}

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

	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];

	return ret_val;
}

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

    static yy_state_type yy_get_previous_state (void)
{
	register yy_state_type yy_current_state;
	register char *yy_cp;
    
	yy_current_state = (yy_start);
	yy_current_state += YY_AT_BOL();

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

	return yy_current_state;
}

/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	register int yy_is_jam;
    	register char *yy_cp = (yy_c_buf_p);

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

	return yy_is_jam ? 0 : yy_current_state;
}

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

{
	int c;
    
	*(yy_c_buf_p) = (yy_hold_char);

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

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

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

					/* Reset buffer status. */
					plpgsql_base_yyrestart(plpgsql_base_yyin );

					/*FALLTHROUGH*/

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

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

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

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

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

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

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

	plpgsql_base_yy_init_buffer(YY_CURRENT_BUFFER,input_file );
	plpgsql_base_yy_load_buffer_state( );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void plpgsql_base_yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		plpgsql_base_yypop_buffer_state();
	 *		plpgsql_base_yypush_buffer_state(new_buffer);
     */
	plpgsql_base_yyensure_buffer_stack ();
	if ( YY_CURRENT_BUFFER == new_buffer )
		return;

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

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	plpgsql_base_yy_load_buffer_state( );

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

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

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * 
 * @return the allocated buffer state.
 */
    YY_BUFFER_STATE plpgsql_base_yy_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) plpgsql_base_yyalloc(sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in plpgsql_base_yy_create_buffer()" );

	b->yy_buf_size = size;

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

	b->yy_is_our_buffer = 1;

	plpgsql_base_yy_init_buffer(b,file );

	return b;
}

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

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

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

	plpgsql_base_yyfree((void *) b  );
}

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a plpgsql_base_yyrestart() or at EOF.
 */
    static void plpgsql_base_yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	plpgsql_base_yy_flush_buffer(b );

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

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

        b->yy_is_interactive = 0;
    
	errno = oerrno;
}

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * 
 */
    void plpgsql_base_yy_flush_buffer (YY_BUFFER_STATE  b )
{
    	if ( ! b )
		return;

	b->yy_n_chars = 0;

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

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

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

	if ( b == YY_CURRENT_BUFFER )
		plpgsql_base_yy_load_buffer_state( );
}

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

	plpgsql_base_yyensure_buffer_stack();

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

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

	/* copied from plpgsql_base_yy_switch_to_buffer. */
	plpgsql_base_yy_load_buffer_state( );
	(yy_did_buffer_switch_on_eof) = 1;
}

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

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

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

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

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

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

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

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)plpgsql_base_yyrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in plpgsql_base_yyensure_buffer_stack()" );

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

/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * 
 * @return the newly allocated buffer state object. 
 */
YY_BUFFER_STATE plpgsql_base_yy_scan_buffer  (char * base, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return 0;

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

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

	plpgsql_base_yy_switch_to_buffer(b  );

	return b;
}

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

/** Setup the input buffer state to scan the given bytes. The next call to plpgsql_base_yylex() will
 * scan from a @e copy of @a bytes.
 * @param bytes the byte buffer to scan
 * @param len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE plpgsql_base_yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = _yybytes_len + 2;
	buf = (char *) plpgsql_base_yyalloc(n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in plpgsql_base_yy_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 = plpgsql_base_yy_scan_buffer(buf,n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in plpgsql_base_yy_scan_bytes()" );

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

	return b;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

static void yy_fatal_error (yyconst char* msg )
{
    	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}

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

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

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

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

/** Get the input stream.
 * 
 */
FILE *plpgsql_base_yyget_in  (void)
{
        return plpgsql_base_yyin;
}

/** Get the output stream.
 * 
 */
FILE *plpgsql_base_yyget_out  (void)
{
        return plpgsql_base_yyout;
}

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

/** Get the current token.
 * 
 */

char *plpgsql_base_yyget_text  (void)
{
        return plpgsql_base_yytext;
}

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

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

void plpgsql_base_yyset_out (FILE *  out_str )
{
        plpgsql_base_yyout = out_str ;
}

int plpgsql_base_yyget_debug  (void)
{
        return plpgsql_base_yy_flex_debug;
}

void plpgsql_base_yyset_debug (int  bdebug )
{
        plpgsql_base_yy_flex_debug = bdebug ;
}

static int yy_init_globals (void)
{
        /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from plpgsql_base_yylex_destroy(), so don't allocate here.
     */

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

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

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

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

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

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

    return 0;
}

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

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

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

void plpgsql_base_yyfree (void * ptr )
{
	free( (char *) ptr );	/* see plpgsql_base_yyrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 361 "scan.l"




/*
 * This is the plpgsql_base_yylex routine called from outside. It exists to provide
 * a one-token pushback facility.  Beware of trying to make it do more:
 * for the most part, plpgsql's gram.y assumes that plpgsql_base_yytext is in step
 * with the "current token".
 */
int
plpgsql_yylex(void)
{
	if (have_pushback_token)
	{
		have_pushback_token = false;
		return pushback_token;
	}
	return plpgsql_base_yylex();
}

/*
 * Push back a single token to be re-read by next plpgsql_yylex() call.
 *
 * NOTE: this does not cause plpgsql_base_yytext to "back up".
 */
void
plpgsql_push_back_token(int token)
{
	if (have_pushback_token)
		elog(ERROR, "cannot push back multiple tokens");
	pushback_token = token;
	have_pushback_token = true;
}

/*
 * Report a syntax error.
 */
void
plpgsql_yyerror(const char *message)
{
	const char *loc = plpgsql_base_yytext;
	int			cursorpos;

	plpgsql_error_lineno = plpgsql_scanner_lineno();

	/* in multibyte encodings, return index in characters not bytes */
	cursorpos = pg_mbstrlen_with_len(scanbuf, loc - scanbuf) + 1;

	if (*loc == YY_END_OF_BUFFER_CHAR)
	{
		ereport(ERROR,
				(errcode(ERRCODE_SYNTAX_ERROR),
				 /* translator: %s is typically "syntax error" */
				 errmsg("%s at end of input", message),
				 internalerrposition(cursorpos),
				 internalerrquery(scanstr)));
	}
	else
	{
		ereport(ERROR,
				(errcode(ERRCODE_SYNTAX_ERROR),
				 /* translator: first %s is typically "syntax error" */
				 errmsg("%s at or near \"%s\"", message, loc),
				 internalerrposition(cursorpos),
				 internalerrquery(scanstr)));
	}
}

/*
 * Get the line number at which the current token ends.  This substitutes
 * for flex's very poorly implemented plpgsql_base_yylineno facility.
 *
 * We assume that flex has written a '\0' over the character following the
 * current token in scanbuf.  So, we just have to count the '\n' characters
 * before that.  We optimize this a little by keeping track of the last
 * '\n' seen so far.
 */
int
plpgsql_scanner_lineno(void)
{
	const char *c;

	while ((c = strchr(cur_line_start, '\n')) != NULL)
	{
		cur_line_start = c + 1;
		cur_line_num++;
	}
	return cur_line_num;
}

/*
 * Called before any actual parsing is done
 *
 * Note: the passed "str" must remain valid until plpgsql_scanner_finish().
 * Although it is not fed directly to flex, we need the original string
 * to cite in error messages.
 */
void
plpgsql_scanner_init(const char *str, int functype)
{
	Size	slen;

	slen = strlen(str);

	/*
	 * Might be left over after ereport()
	 */
	if (YY_CURRENT_BUFFER)
		plpgsql_base_yy_delete_buffer(YY_CURRENT_BUFFER);

	/*
	 * Make a scan buffer with special termination needed by flex.
	 */
	scanbuf = palloc(slen + 2);
	memcpy(scanbuf, str, slen);
	scanbuf[slen] = scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
	scanbufhandle = plpgsql_base_yy_scan_buffer(scanbuf,slen + 2);

	/* Other setup */
	scanstr = str;

    scanner_functype = functype;
    scanner_typereported = false;

	have_pushback_token = false;

	cur_line_start = scanbuf;
	cur_line_num = 1;

	/*----------
	 * Hack: skip any initial newline, so that in the common coding layout
	 *		CREATE FUNCTION ... AS '
	 *			code body
	 *		' LANGUAGE 'plpgsql';
	 * we will think "line 1" is what the programmer thinks of as line 1.
	 *----------
	 */
    if (*cur_line_start == '\r')
        cur_line_start++;
    if (*cur_line_start == '\n')
        cur_line_start++;

	BEGIN(INITIAL);
}

/*
 * Called after parsing is done to clean up after plpgsql_scanner_init()
 */
void
plpgsql_scanner_finish(void)
{
	plpgsql_base_yy_delete_buffer(scanbufhandle);
	pfree(scanbuf);
}

/*
 * Called after a T_STRING token is read to get the string literal's value
 * as a palloc'd string.  (We make this a separate call because in many
 * scenarios there's no need to get the decoded value.)
 *
 * Note: we expect the literal to be the most recently lexed token.  This
 * would not work well if we supported multiple-token pushback or if 
 * plpgsql_yylex() wanted to read ahead beyond a T_STRING token.
 */
char *
plpgsql_get_string_value(void)
{
	char	   *result;
	const char *cp;
	int			len;

	if (dolqlen > 0)
	{
		/* Token is a $foo$...$foo$ string */
		len = plpgsql_base_yyleng - 2 * dolqlen;
		Assert(len >= 0);
		result = (char *) palloc(len + 1);
		memcpy(result, plpgsql_base_yytext + dolqlen, len);
		result[len] = '\0';
	}
	else if (*plpgsql_base_yytext == 'E' || *plpgsql_base_yytext == 'e')
	{
		/* Token is an E'...' string */
		result = (char *) palloc(plpgsql_base_yyleng + 1);	/* more than enough room */
		len = 0;
		for (cp = plpgsql_base_yytext + 2; *cp; cp++)
		{
			if (*cp == '\'')
			{
				if (cp[1] == '\'')
					result[len++] = *cp++;
				/* else it must be string end quote */
			}
			else if (*cp == '\\')
			{
				if (cp[1] != '\0')	/* just a paranoid check */
					result[len++] = *(++cp);
			}
			else
				result[len++] = *cp;
		}
		result[len] = '\0';
	}
	else
	{
		/* Token is a '...' string */
		result = (char *) palloc(plpgsql_base_yyleng + 1);	/* more than enough room */
		len = 0;
		for (cp = plpgsql_base_yytext + 1; *cp; cp++)
		{
			if (*cp == '\'')
			{
				if (cp[1] == '\'')
					result[len++] = *cp++;
				/* else it must be string end quote */
			}
			else if (*cp == '\\')
			{
				if (cp[1] != '\0')	/* just a paranoid check */
					result[len++] = *(++cp);
			}
			else
				result[len++] = *cp;
		}
		result[len] = '\0';
	}
	return result;
}

