#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 92
#define YY_END_OF_BUFFER 93
/* 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[360] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   93,   91,
       74,   74,   91,   91,   80,   91,   91,   91,   72,   91,
        2,   56,   56,   56,   56,   56,   56,   56,   56,   56,
       56,   56,   56,   56,   56,   56,   56,   56,   91,   86,
       85,   83,   79,   78,   79,   89,   89,   90,   74,   73,
        0,   56,   87,   64,    0,   75,    3,   76,   72,    1,
        0,   56,    0,    0,   56,   56,    6,   56,   56,   56,
       56,   56,   56,   81,   56,   56,   56,   56,   56,   56,
       56,   26,   27,   31,   56,   56,   56,   56,   56,   39,
       56,   56,   56,   56,   56,   56,   49,   56,   56,   56,

        0,   86,   84,   82,   77,   89,   88,    0,   56,    0,
        0,    0,    0,    0,   75,    0,    0,    0,    0,   57,
       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
       56,   18,   56,   56,   56,   56,   23,   56,   25,   56,
       56,   56,   32,   56,   56,   35,   56,   56,   56,   56,
       56,   56,   56,   56,   56,   56,   56,   56,   56,   56,
       56,    0,    0,    0,    0,    0,    0,   65,    0,    0,
        0,   57,    0,   57,    0,    0,   56,   56,   56,   56,
       56,   56,   56,   56,   56,   56,   55,   15,   56,   56,
       56,   21,   56,   24,   28,   56,   30,   33,   34,   56,

       37,   38,   56,   56,   56,   56,   56,   56,   56,   56,
       48,   50,   56,   52,   56,    0,    0,    0,    0,   65,
        0,   65,    0,    0,    0,    0,    0,    0,    0,    0,
       58,    4,    5,    7,   56,   56,   56,   11,   56,   56,
       56,   56,   17,   56,   56,   22,   56,   56,   56,   41,
       56,   56,   56,   56,   56,   56,   56,   53,    0,    0,
        0,    0,    0,    0,    0,   66,    0,   59,    0,    0,
        0,   58,    0,   58,    0,   56,   56,   10,   56,   56,
       56,   16,   56,   56,   29,   36,   56,   42,   56,   44,
       56,   56,   47,   56,    0,    0,   67,    0,    0,    0,

       66,    0,   66,    0,    0,    0,    0,    0,   56,   56,
       12,   13,   56,   56,   20,   40,   56,   45,   56,   51,
       54,    0,    0,    0,    0,    0,    0,   60,    0,    8,
        9,   56,   56,   56,   56,    0,    0,   68,    0,   62,
        0,    0,   56,   19,   56,   46,   70,    0,    0,    0,
       61,   56,   43,    0,   69,   63,   14,   71,    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[386] =
    {   0,
        0,  347,   55,   56,   63,   64,   65,   68,  315, 2397,
       74,   77,   79,   76, 2397,  303,  283,  275,  262,  256,
     2397,   85,   96,  158,  197,  248,  290,   99,  111,  348,
       95,   97,  165,  179,  389,  172,  425,  211,   40,    0,
      249,    0, 2397, 2397,  241,    0,    0,  219,  135,  194,
      193,  199, 2397,  238,  188,    0, 2397, 2397,  180, 2397,
      259,  262,   94,  234,  288,  285,  327,  289,  325,  359,
      471,  371,  390, 2397,  375,  442,  527,  463,  504,  382,
      530,  541,  525,  553,  539,  577,  592,  426,  473,  599,
      606,  598,  641,  628,  625,  622,  652,  683,  700,  671,

       54,    0, 2397, 2397, 2397,    0, 2397,  183,  721,  184,
      732,   97,  277,  172,    0,   56,   53,  301,  173,  739,
      746,  734,  738,  739,  754,  451,  739,  800,  811,  818,
      806,  833,  819,  832,  858,  856,  881,  893,  905,  864,
      903,  884,  928,  948,  955,  947,  947,  947,  963,  985,
     1019,  998,  999,  965, 1043, 1016, 1034, 1049, 1043, 1056,
     1053,   99,  165,  104,  101,  382,  158, 1112,  104,  116,
      139, 1123, 1130, 1137,  469, 1148, 1114, 1115, 1073, 1152,
     1138, 1139, 1173, 1197, 1143, 1184, 1216, 1204, 1205, 1241,
     1181, 1253, 1265, 1272, 1279, 1290, 1297, 1304, 1315, 1305,

     1329, 1332, 1312, 1329, 1356, 1326, 1379, 1386, 1351, 1381,
     1401, 1412, 1407, 1435, 1415,  183,  149,  161,  116, 1464,
     1442, 1471,  854, 1482,  171,  213,  201,  205, 1486,  101,
      324, 1490, 1493, 1504, 1507, 1498, 1526, 1538, 1557, 1517,
     1527, 1541, 1588, 1599, 1602, 1613, 1616, 1618, 1643, 1668,
     1619, 1675, 1601, 1659, 1659, 1693, 1678, 1718,  215,  215,
      263,  264,  282, 1734,  100,  455,  303, 2397,  328,  345,
       86, 1738,  676,  703,  356, 1723, 1720, 1755, 1741, 1780,
     1764, 1792, 1780, 1787, 1832, 1839, 1846, 1853, 1860, 1867,
     1859, 1856, 1885, 1909,  367,  360, 2397,  366,  441,   64,

     1920, 1700, 1892,  479,  495,  517,  277,  528, 1927, 1919,
     1939, 1946, 1964, 1929, 1987, 1998, 1957, 2001, 1985, 2017,
     2397,  537,  563,  291,  583,  313,  586, 2397,  603, 2031,
     2042, 2005, 2019, 2037, 2057,  334,  596, 2397,  614, 2397,
      621,  405, 2049, 2076, 2094, 2101, 2397,  642,  449,  578,
     2397, 2078, 2114,  672, 2397, 2397, 2125, 2397, 2397, 2139,
     2150, 2161, 2172, 2178, 2188, 2199, 2210, 2221, 2227, 2238,
     2244, 2255, 2265, 2271, 2281, 2292, 2302, 2313, 2323, 2333,
     2343, 2354, 2364, 2375, 2385
    } ;

static yyconst flex_int16_t yy_def[386] =
    {   0,
      359,    1,  360,  360,  361,  361,  362,  362,  359,  359,
      359,  359,  363,  364,  359,  359,  359,  359,  359,  359,
      359,  365,  365,  365,   24,   24,   24,  365,  365,  365,
       24,   24,  365,  365,   24,  365,   24,  365,  359,  366,
      359,  367,  359,  359,  359,  368,  368,  369,  359,  370,
      370,  359,  359,  359,  371,  372,  359,  359,  359,  359,
      359,  365,  359,  373,  365,  365,  365,   24,   30,  365,
       30,  365,  365,  359,   30,  365,  365,  365,  365,   24,
      365,  365,   30,  365,   24,  365,  365,   24,   77,  365,
      365,   77,   30,  365,  365,   77,  365,  365,  365,   77,

      359,  366,  359,  359,  359,  368,  359,  374,  359,  370,
      359,  359,  375,  371,  372,  359,  359,  373,  376,  377,
      365,   77,   30,   30,   30,   24,   24,  365,  365,  365,
       77,  365,   77,   77,  365,   77,  365,  365,  365,   24,
       77,   24,  365,  365,  365,   77,   24,   30,   30,   30,
      365,   24,   24,   77,  365,   77,   30,   77,   30,   30,
       24,  359,  374,  359,  359,  375,  378,  379,  359,  359,
      376,  359,  359,  377,  359,  380,   30,   30,   77,  365,
       77,   24,  365,  365,   24,   30,  365,   77,   30,  365,
       24,  365,  365,  365,  365,  365,  365,  365,  365,   77,

      365,  365,   24,   77,  365,   24,  365,  365,   77,   77,
      365,  365,   77,  365,   77,  359,  359,  359,  378,  359,
      359,  379,  359,  381,  359,  359,  359,  359,  380,  382,
      383,  365,  365,  365,  365,   30,  365,  365,  365,   24,
       24,   30,  365,  365,  365,  365,  365,   77,  365,  365,
       77,  365,   30,   30,   24,  365,   30,  365,  359,  359,
      359,  359,  359,  381,  384,  385,  359,  359,  359,  359,
      382,  359,  359,  383,  359,   30,   24,  365,   77,  365,
       30,  365,   77,   77,  365,  365,  365,  365,  365,  365,
       77,   24,  365,  365,  359,  359,  359,  359,  359,  384,

      359,  359,  385,  359,  359,  359,  359,  359,  365,   77,
      365,  365,  365,   24,  365,  365,   24,  365,   30,  365,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  365,
      365,   77,   30,   77,  365,  359,  359,  359,  359,  359,
      359,  359,   77,  365,  365,  365,  359,  359,  359,  359,
      359,   30,  365,  359,  359,  359,  365,  359,    0,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359
    } ;

static yyconst flex_int16_t yy_nxt[2461] =
    {   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,  301,  101,
       47,   48,   45,   45,   48,   49,   49,   49,   49,   49,
       49,   51,   53,   52,  162,  169,   61,   61,   61,   54,
      272,  170,   63,  101,   42,   42,   64,   61,   61,   61,

       61,   61,   61,   63,  301,  272,   63,   64,  162,  169,
       64,   65,   61,   61,   61,  170,   66,   86,   63,   81,
      220,   62,   64,   62,   85,  116,   87,  117,  164,   62,
      165,   88,  216,  217,   67,   65,   49,   49,   49,  218,
      225,   66,   86,  172,   81,   62,  226,   62,   85,  116,
       87,  117,  164,   62,  165,   88,  216,  217,   67,   61,
       61,   61,  220,  218,  225,   63,   61,   61,   61,   64,
      226,  107,   63,   61,   61,   61,   64,  172,   53,   63,
       61,   61,   61,   64,   68,  260,   63,   69,  109,  107,
       64,  261,   70,   59,   53,   89,   90,  109,  109,   91,

       61,   61,   61,  110,  267,   95,   63,  259,   68,  260,
       64,   69,   61,   61,   61,  261,   70,   71,   63,   89,
       90,   72,   64,   62,   91,  107,   62,   99,  267,   95,
      269,   73,  259,  268,  100,  118,  118,  118,  119,  111,
      111,  111,   71,  270,  295,  112,   72,   62,  296,  113,
       62,   54,   99,  105,  269,   73,   74,  103,  268,  100,
       61,   61,   61,   61,   61,   61,   63,  270,  295,   63,
       64,   60,  296,   64,   75,   59,   76,   62,  166,  166,
      166,  167,   62,  297,   58,   77,   61,   61,   61,   61,
       61,   61,   63,  298,   57,   63,   64,  328,   75,   64,

       76,   62,  118,  118,  118,  119,   62,  122,  297,   77,
       78,  338,  121,   56,  359,   62,   62,  298,  123,   79,
      299,   80,  328,   62,   62,  273,  273,  273,   61,   61,
       61,  275,  122,  340,   63,   78,  338,  121,   64,   62,
       62,  305,  123,   79,  299,   80,   62,   62,   62,   61,
       61,   61,   39,  124,  347,   63,  359,   62,  340,   64,
       61,   61,   61,  359,  306,  305,   63,  359,  359,   82,
       64,   62,   61,   61,   61,  307,   83,  124,   63,  347,
       84,   62,   64,  166,  166,  166,  167,  129,  306,  308,
      125,   61,   61,   61,   82,  321,   62,   63,  322,  307,

       83,   64,  323,   62,   84,   92,  359,  131,   62,   93,
      359,  138,  129,  308,  125,   62,   62,  130,   94,  321,
      359,   62,  322,   62,  359,  351,  323,   62,  359,  359,
       92,  131,   62,  359,   93,  138,  359,  359,  359,   62,
       62,  130,   94,   61,   61,   61,  359,   62,   96,   63,
      351,   62,  147,   64,   97,   62,  302,  302,  302,   62,
       62,  132,  304,   98,   61,   61,   61,  359,  359,  355,
       63,  324,  359,   96,   64,   62,  147,   62,   97,   62,
       62,  359,  359,   62,   62,  183,  132,   98,  126,  127,
      359,   62,  128,  148,  355,  324,  136,   62,  359,   62,

      227,   62,  228,   62,   62,   61,   61,   61,  359,  183,
      359,   63,  325,  126,  127,   64,   62,  128,  148,  359,
      136,  359,   62,   62,  227,  326,  228,   62,   61,   61,
       61,   61,   61,   61,   63,  137,  325,   63,   64,  359,
      359,   64,   61,   61,   61,  133,  140,  134,   63,  326,
      327,  135,   64,   62,   61,   61,   61,  141,  142,  137,
       63,  143,  359,  139,   64,   62,  329,  336,  144,  359,
      133,  140,  134,   62,  327,  359,  135,   62,   61,   61,
       61,  141,  142,  359,   63,  359,  143,  139,   64,   62,
      329,  336,  144,   61,   61,   61,  337,   62,  356,   63,

       61,   61,   61,   64,  359,  359,   63,   61,   61,   61,
       64,  359,  359,   63,  145,  359,   62,   64,   62,  359,
      337,  339,  150,  356,  341,  146,   61,   61,   61,   61,
       61,   61,   63,  342,  348,   63,   64,  149,  145,   64,
       62,   62,  157,   62,  349,  339,   62,  150,  341,  146,
      359,  350,  359,   61,   61,   61,  156,  342,  348,   63,
      359,  149,   62,   64,  155,   62,  359,  157,  349,  151,
      359,   62,  354,  152,  153,  350,  154,  273,  273,  273,
      156,  359,  359,  275,   61,   61,   61,   62,  155,   62,
       63,  160,  358,  151,   64,  161,  354,  152,  153,  359,

      154,   61,   61,   61,  273,  273,  273,   63,  359,  359,
      275,   64,  359,  158,   62,  359,  160,  358,  359,  359,
      161,  359,   61,   61,   61,  110,  359,  359,   63,  359,
      359,  159,   64,  111,  111,  111,  359,  158,  359,  112,
      173,  173,  173,  113,  359,  359,  175,   61,   61,   61,
      176,  359,   62,   63,   62,  159,  359,   64,  178,   62,
       62,  359,  177,  359,  359,  184,   62,   62,   62,  359,
      179,  180,  181,   62,  359,   62,  359,   62,  359,   62,
      359,  359,   62,  178,   62,   62,  182,  177,  359,  184,
       62,   62,   62,  359,  179,  180,  181,   62,  359,  359,

       62,   61,   61,   61,  359,  359,   62,   63,  359,  359,
      182,   64,   61,   61,   61,  359,  185,  359,   63,   61,
       61,   61,   64,  359,   62,   63,  188,  359,  359,   64,
      189,  359,  359,  186,   61,   61,   61,   62,  359,  190,
       63,  185,  359,   62,   64,  359,  359,  359,  187,   62,
      191,  188,   62,  359,  359,  189,   62,  359,  186,   61,
       61,   61,   62,  359,  190,   63,  359,  359,   62,   64,
      359,  359,  187,  359,  193,  191,   62,   62,  359,  359,
       62,   62,   61,   61,   61,  262,  359,  263,   63,  359,
       62,  192,   64,  195,   61,   61,   61,  359,   62,  193,

       63,   62,  359,  359,   64,   62,   61,   61,   61,  262,
       62,  263,   63,  197,   62,  192,   64,  195,   62,  359,
      194,   62,   62,  196,  359,  359,  359,   62,  359,   61,
       61,   61,  359,  359,   62,   63,  359,  197,  359,   64,
      359,  359,   62,  359,  194,  359,   62,  359,  196,   61,
       61,   61,   62,  359,  359,   63,   61,   61,   61,   64,
      359,  359,   63,  359,  359,   62,   64,   62,   62,  359,
      359,  200,  359,  201,  359,  202,   62,  359,  198,   62,
      359,   62,  359,   62,  203,  208,  359,  359,  199,   62,
       62,   62,   62,   62,  359,   62,  200,  201,  359,  202,

       62,  359,  198,   62,  359,   62,   62,  359,   62,  203,
      208,  359,  199,   62,   62,   62,  359,  204,  359,   62,
       61,   61,   61,  359,   62,   62,   63,   62,   62,  359,
       64,   62,  206,  207,   62,  205,   62,   62,  359,  359,
      210,  204,  359,  359,   61,   61,   61,  359,   62,   62,
       63,   62,   62,  359,   64,   62,  206,  207,  359,   62,
      205,   62,  211,  359,   62,  210,   62,   62,  359,  212,
      359,  213,  359,   62,  359,   62,  359,   62,  359,  215,
       62,  359,   62,  209,  214,  359,  211,   62,   62,   62,
       62,   62,   62,  234,  212,  213,  359,   62,   62,   62,

      359,  359,   62,  215,  359,  359,   62,  359,  214,  359,
      359,   62,   62,  221,  221,  221,   62,  359,  234,  223,
      359,  359,   62,  224,  173,  173,  173,  119,  359,  359,
      175,  173,  173,  173,  176,   62,   62,  175,  173,  173,
      173,  176,   62,  233,  175,  359,  232,   62,  176,  229,
      229,  229,  230,   61,   61,   61,   62,  359,   62,   63,
       62,   62,  236,   64,  359,   62,   62,  233,  237,   62,
      232,   62,   62,   62,   61,   61,   61,  240,  359,  359,
       63,   62,  359,   62,   64,  235,  359,  236,  359,   62,
      359,  359,  237,   62,  359,  238,   62,   62,   61,   61,

       61,  240,  359,  359,   63,   62,  359,   62,   64,  235,
       62,  359,  241,  239,  359,  245,   62,   61,   61,   61,
      238,  359,   62,   63,   62,  359,  243,   64,  242,  359,
       62,   62,  359,   62,   62,  359,  241,   62,  239,  245,
       62,  359,   61,   61,   61,  359,  359,   62,   63,   62,
      359,  243,   64,  242,   61,   61,   61,   62,  359,  359,
       63,   62,  359,  359,   64,  359,   61,   61,   61,  359,
      359,  244,   63,   61,   61,   61,   64,  359,  359,   63,
       61,   61,   61,   64,  359,  359,   63,  359,  246,  359,
       64,   61,   61,   61,  359,  244,  359,   63,   61,   61,

       61,   64,  359,  359,   63,   61,   61,   61,   64,  359,
      359,   63,  359,  246,  359,   64,   61,   61,   61,  359,
      359,  247,   63,  248,  359,   62,   64,  359,  359,   62,
       61,   61,   61,   61,   61,   61,   63,  359,   62,   63,
       64,  249,  359,   64,  359,  247,   62,   62,  248,  250,
       62,  359,  252,   62,   62,   62,  359,   61,   61,   61,
       62,  359,   62,   63,  359,  249,  359,   64,  359,  255,
       62,   62,   62,  359,  250,   62,  252,  359,   62,   62,
       61,   61,   61,  251,   62,  359,   63,   61,   61,   61,
       64,  359,  359,   63,  255,  359,   62,   64,  359,  256,

       62,   62,   61,   61,   61,   62,  359,  251,   63,  359,
      253,  359,   64,   61,   61,   61,  359,  254,  359,   63,
      359,  359,  359,   64,  256,   62,   62,   62,  359,  359,
       62,  257,  359,   62,  253,  258,   61,   61,   61,   62,
      359,  254,   63,  221,  221,  221,   64,  359,  359,  223,
       62,  359,   62,  224,  359,  359,  257,  359,   62,  359,
      258,  359,  359,  359,   62,  221,  221,  221,  167,  359,
      359,  223,  221,  221,  221,  224,  359,  359,  223,  359,
      359,  359,  224,  264,  264,  264,  265,  229,  229,  229,
      230,   61,   61,   61,   61,   61,   61,   63,  359,  359,

       63,   64,  359,  359,   64,   61,   61,   61,   61,   61,
       61,   63,  359,  359,   63,   64,  359,  359,   64,   62,
      359,  359,  359,  276,  359,  359,  277,   61,   61,   61,
       62,  359,  359,   63,  359,  359,  359,   64,  359,   61,
       61,   61,  359,  280,   62,   63,   62,  359,  276,   64,
      277,   62,  359,   62,   62,  359,  281,  278,   61,   61,
       61,   62,  282,  359,   63,  359,  359,  280,   64,   62,
       62,  359,  359,   62,  359,   62,  359,   62,  359,  359,
      281,  278,  359,  359,  359,   62,  359,  282,  279,   61,
       61,   61,  359,   62,  359,   63,  359,   62,  359,   64,

       61,   61,   61,   61,   61,   61,   63,  359,  359,   63,
       64,  359,  279,   64,   61,   61,   61,   61,   61,   61,
       63,  359,   62,   63,   64,  359,  359,   64,  359,  290,
      359,  359,  283,   62,  359,  284,   62,   62,  286,  288,
      359,  359,   62,   62,   61,   61,   61,   62,  359,  285,
       63,  359,  359,  290,   64,  359,  283,   62,  359,  284,
      359,   62,   62,  286,  288,  359,  359,   62,   62,   61,
       61,   61,  359,  285,  287,   63,   61,   61,   61,   64,
       62,  359,   63,  359,  359,   62,   64,   62,  292,  359,
      359,  291,  359,   62,   61,   61,   61,  359,  287,   62,

       63,  302,  302,  302,   64,   62,  294,  304,  289,   62,
       62,   62,  292,  359,  359,  291,  359,   62,  359,   61,
       61,   61,  359,  359,   62,   63,  293,  359,  359,   64,
      294,  359,  289,  359,   62,  264,  264,  264,  265,  273,
      273,  273,  230,  359,   62,  275,   62,  359,  359,   62,
      293,  309,  359,  359,  310,   62,   61,   61,   61,   62,
      359,  311,   63,  359,  359,   62,   64,  359,  359,   62,
       62,  359,  359,   62,  359,  309,  359,  359,  310,   62,
      359,   61,   61,   61,   62,   62,  311,   63,  359,  359,
       62,   64,   62,   61,   61,   61,  313,  359,   62,   63,

       62,  359,  359,   64,  314,   62,  359,  315,  359,  359,
       62,   62,  359,  312,  359,  359,   62,  359,  359,  359,
      313,  359,  359,   62,  359,   62,  359,  359,  359,  314,
       62,  359,  315,   61,   61,   61,   62,  312,  359,   63,
       61,   61,   61,   64,  359,  359,   63,   61,   61,   61,
       64,  359,  359,   63,   61,   61,   61,   64,  359,  359,
       63,   61,   61,   61,   64,  359,  359,   63,   61,   61,
       61,   64,  359,  316,   63,  359,  359,   62,   64,  318,
      359,  359,   62,   62,  359,   62,   61,   61,   61,  359,
      319,  359,   63,  302,  302,  302,   64,  316,  359,  304,

      317,  359,   62,  359,  318,  359,   62,  359,   62,   62,
       61,   61,   61,  359,  319,  359,   63,  359,  359,  359,
       64,  302,  302,  302,  265,  359,  359,  304,   61,   61,
       61,  320,  359,  359,   63,  359,  359,   62,   64,  331,
       61,   61,   61,   62,  359,  359,   63,   61,   61,   61,
       64,  359,  359,   63,  359,   62,  320,   64,  333,  359,
      330,  359,   62,   62,  331,   61,   61,   61,   62,  359,
      359,   63,  359,  359,  359,   64,  359,  359,  359,   62,
      359,  359,  333,   62,  330,  359,  334,   62,   61,   61,
       61,   62,  359,  359,   63,  359,  359,  332,   64,   61,

       61,   61,   61,   61,   61,   63,   62,   62,   63,   64,
      334,  359,   64,  335,  359,   62,  359,   62,   61,   61,
       61,  332,  359,   62,   63,   62,  359,  359,   64,  343,
      359,   62,   61,   61,   61,  359,  359,  335,   63,  359,
       62,   62,   64,   61,   61,   61,  359,  344,   62,   63,
       62,   62,  359,   64,  343,   62,  359,   62,   61,   61,
       61,  345,  359,  359,   63,   62,  359,  352,   64,   62,
      359,  344,  359,   62,  359,   62,  359,   61,   61,   61,
       62,  359,   62,   63,  359,  359,  345,   64,  359,  359,
      346,  359,  352,  359,   62,   61,   61,   61,   62,   62,

      359,   63,   61,   61,   61,   64,   62,  359,   63,  359,
      357,  359,   64,  353,  346,   61,   61,   61,  359,  359,
      359,   63,  359,  359,   62,   64,   61,   61,   61,  359,
       62,  359,   63,  359,  357,  359,   64,  359,  353,   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,  359,  359,  359,   55,   55,   62,
       62,   62,  359,   62,   62,  359,   62,   62,   62,  102,

      102,  102,  102,  102,  102,  102,  359,  102,  102,  102,
      104,  104,  359,  104,  104,  104,  104,  104,  104,  104,
      104,  106,  106,  106,  106,  106,  359,  106,  106,  106,
      106,  106,  108,  359,  359,  359,  359,  108,   51,   51,
       51,   51,   51,   51,   51,   51,   51,   51,   51,  114,
      359,  359,  359,  114,  114,  115,  115,  359,  359,  115,
      115,  115,  115,  115,  115,  115,  120,  120,  120,  120,
      359,  359,  359,  359,  359,  120,  163,  359,  359,  359,
      163,  163,  168,  168,  168,  168,  359,  359,  359,  359,
      359,  168,  171,  171,  171,  171,  171,  171,  171,  171,

      171,  171,  171,  174,  174,  174,  359,  174,  174,  359,
      174,  174,  174,  219,  219,  219,  219,  219,  219,  219,
      219,  219,  219,  219,  222,  222,  222,  359,  222,  222,
      359,  222,  222,  222,  231,  231,  231,  231,  359,  359,
      359,  359,  359,  231,  266,  266,  266,  266,  359,  359,
      359,  359,  359,  266,  271,  271,  271,  271,  271,  271,
      271,  271,  271,  271,  271,  274,  274,  274,  359,  274,
      274,  359,  359,  274,  274,  300,  300,  300,  300,  300,
      300,  300,  300,  300,  300,  300,  303,  303,  303,  359,
      303,  303,  359,  359,  303,  303,    9,  359,  359,  359,

      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359
    } ;

static yyconst flex_int16_t yy_chk[2461] =
    {   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,  300,   39,
        8,    7,    5,    6,    8,   11,   11,   11,   12,   12,
       12,   13,   14,   13,  101,  116,   22,   22,   22,   14,
      271,  117,   22,   39,    3,    4,   22,   23,   23,   23,

       28,   28,   28,   23,  265,  230,   28,   23,  101,  116,
       28,   22,   29,   29,   29,  117,   23,   32,   29,   28,
      219,   31,   29,   32,   31,   63,   32,   63,  112,   31,
      112,   32,  162,  164,   23,   22,   49,   49,   49,  165,
      169,   23,   32,  171,   28,   31,  170,   32,   31,   63,
       32,   63,  112,   31,  112,   32,  162,  164,   23,   24,
       24,   24,  167,  165,  169,   24,   33,   33,   33,   24,
      170,  163,   33,   36,   36,   36,   33,  119,  114,   36,
       34,   34,   34,   36,   24,  217,   34,   24,  110,  108,
       34,  218,   24,   59,   55,   33,   33,   51,   50,   34,

       52,   52,   52,   52,  225,   36,   52,  216,   24,  217,
       52,   24,   38,   38,   38,  218,   24,   25,   38,   33,
       33,   25,   38,   25,   34,   48,   25,   38,  225,   36,
      227,   25,  216,  226,   38,   64,   64,   64,   64,   54,
       54,   54,   25,  228,  259,   54,   25,   25,  260,   54,
       25,   54,   38,   45,  227,   25,   26,   41,  226,   38,
       61,   61,   61,   62,   62,   62,   61,  228,  259,   62,
       61,   20,  260,   62,   26,   19,   26,   26,  113,  113,
      113,  113,   26,  261,   18,   26,   66,   66,   66,   65,
       65,   65,   66,  262,   17,   65,   66,  307,   26,   65,

       26,   26,  118,  118,  118,  118,   26,   66,  261,   26,
       27,  324,   65,   16,    9,   68,   27,  262,   68,   27,
      263,   27,  307,   68,   27,  231,  231,  231,   67,   67,
       67,  231,   66,  326,   67,   27,  324,   65,   67,   68,
       27,  267,   68,   27,  263,   27,   69,   68,   27,   30,
       30,   30,    2,   69,  336,   30,    0,   69,  326,   30,
       70,   70,   70,    0,  269,  267,   70,    0,    0,   30,
       70,   69,   72,   72,   72,  270,   30,   69,   72,  336,
       30,   69,   72,  166,  166,  166,  166,   72,  269,  275,
       70,   73,   73,   73,   30,  295,   75,   73,  296,  270,

       30,   73,  298,   75,   30,   35,    0,   75,   80,   35,
        0,   80,   72,  275,   70,   35,   80,   73,   35,  295,
        0,   75,  296,   35,    0,  342,  298,   75,    0,    0,
       35,   75,   80,    0,   35,   80,    0,    0,    0,   35,
       80,   73,   35,   76,   76,   76,    0,   35,   37,   76,
      342,   37,   88,   76,   37,   88,  266,  266,  266,   37,
       88,   76,  266,   37,   78,   78,   78,    0,    0,  349,
       78,  299,    0,   37,   78,   37,   88,  126,   37,   88,
      126,    0,    0,   37,   88,  126,   76,   37,   71,   71,
        0,   89,   71,   89,  349,  299,   78,   89,    0,   71,

      175,  126,  175,   71,  126,   79,   79,   79,    0,  126,
        0,   79,  304,   71,   71,   79,   89,   71,   89,    0,
       78,    0,   89,   71,  175,  305,  175,   71,   77,   77,
       77,   81,   81,   81,   77,   79,  304,   81,   77,    0,
        0,   81,   82,   82,   82,   77,   83,   77,   82,  305,
      306,   77,   82,   83,   84,   84,   84,   83,   83,   79,
       84,   85,    0,   81,   84,   85,  308,  322,   85,    0,
       77,   83,   77,   85,  306,    0,   77,   83,   86,   86,
       86,   83,   83,    0,   86,    0,   85,   81,   86,   85,
      308,  322,   85,   87,   87,   87,  323,   85,  350,   87,

       90,   90,   90,   87,    0,    0,   90,   91,   91,   91,
       90,    0,    0,   91,   86,    0,   92,   91,   92,    0,
      323,  325,   92,  350,  327,   87,   95,   95,   95,   94,
       94,   94,   95,  329,  337,   94,   95,   91,   86,   94,
       96,   92,   96,   92,  339,  325,   96,   92,  327,   87,
        0,  341,    0,   97,   97,   97,   95,  329,  337,   97,
        0,   91,   93,   97,   94,   96,    0,   96,  339,   93,
        0,   96,  348,   93,   93,  341,   93,  273,  273,  273,
       95,    0,    0,  273,   98,   98,   98,   93,   94,  100,
       98,  100,  354,   93,   98,  100,  348,   93,   93,    0,

       93,   99,   99,   99,  274,  274,  274,   99,    0,    0,
      274,   99,    0,   98,  100,    0,  100,  354,    0,    0,
      100,    0,  109,  109,  109,  109,    0,    0,  109,    0,
        0,   99,  109,  111,  111,  111,    0,   98,    0,  111,
      120,  120,  120,  111,    0,    0,  120,  121,  121,  121,
      120,    0,  122,  121,  122,   99,    0,  121,  122,  123,
      124,    0,  121,    0,    0,  127,  123,  124,  127,    0,
      123,  124,  124,  127,    0,  125,    0,  122,    0,  122,
        0,    0,  125,  122,  123,  124,  125,  121,    0,  127,
      123,  124,  127,    0,  123,  124,  124,  127,    0,    0,

      125,  128,  128,  128,    0,    0,  125,  128,    0,    0,
      125,  128,  129,  129,  129,    0,  128,    0,  129,  130,
      130,  130,  129,    0,  131,  130,  131,    0,    0,  130,
      131,    0,    0,  129,  132,  132,  132,  133,    0,  133,
      132,  128,    0,  133,  132,    0,    0,    0,  130,  131,
      134,  131,  134,    0,    0,  131,  134,    0,  129,  135,
      135,  135,  133,    0,  133,  135,    0,    0,  133,  135,
        0,    0,  130,    0,  136,  134,  136,  134,    0,    0,
      136,  134,  137,  137,  137,  223,    0,  223,  137,    0,
      140,  135,  137,  140,  138,  138,  138,    0,  140,  136,

      138,  136,    0,    0,  138,  136,  139,  139,  139,  223,
      142,  223,  139,  142,  140,  135,  139,  140,  142,    0,
      138,  141,  140,  141,    0,    0,    0,  141,    0,  143,
      143,  143,    0,    0,  142,  143,    0,  142,    0,  143,
        0,    0,  142,    0,  138,    0,  141,    0,  141,  144,
      144,  144,  141,    0,    0,  144,  145,  145,  145,  144,
        0,    0,  145,    0,    0,  146,  145,  146,  148,    0,
        0,  146,    0,  147,    0,  148,  147,    0,  144,  148,
        0,  147,    0,  154,  149,  154,    0,    0,  145,  154,
      146,  149,  146,  148,    0,  149,  146,  147,    0,  148,

      147,    0,  144,  148,    0,  147,  150,    0,  154,  149,
      154,    0,  145,  150,  154,  149,    0,  150,    0,  149,
      151,  151,  151,    0,  152,  153,  151,  152,  153,    0,
      151,  150,  152,  153,  156,  151,  156,  150,    0,    0,
      156,  150,    0,    0,  155,  155,  155,    0,  152,  153,
      155,  152,  153,    0,  155,  157,  152,  153,    0,  156,
      151,  156,  157,    0,  159,  156,  157,  158,    0,  158,
        0,  159,    0,  158,    0,  159,    0,  160,    0,  161,
      157,    0,  161,  155,  160,    0,  157,  161,  160,  159,
      157,  179,  158,  179,  158,  159,    0,  179,  158,  159,

        0,    0,  160,  161,    0,    0,  161,    0,  160,    0,
        0,  161,  160,  168,  168,  168,  179,    0,  179,  168,
        0,    0,  179,  168,  172,  172,  172,  172,    0,    0,
      172,  173,  173,  173,  172,  177,  178,  173,  174,  174,
      174,  173,  177,  178,  174,    0,  177,  178,  174,  176,
      176,  176,  176,  180,  180,  180,  181,    0,  181,  180,
      177,  178,  181,  180,    0,  182,  177,  178,  182,  185,
      177,  178,  185,  182,  183,  183,  183,  185,    0,    0,
      183,  181,    0,  181,  183,  180,    0,  181,    0,  182,
        0,    0,  182,  185,    0,  183,  185,  182,  184,  184,

      184,  185,    0,    0,  184,  186,    0,  191,  184,  180,
      191,    0,  186,  184,    0,  191,  186,  187,  187,  187,
      183,    0,  188,  187,  188,    0,  189,  187,  188,    0,
      186,  191,    0,  189,  191,    0,  186,  189,  184,  191,
      186,    0,  190,  190,  190,    0,    0,  188,  190,  188,
        0,  189,  190,  188,  192,  192,  192,  189,    0,    0,
      192,  189,    0,    0,  192,    0,  193,  193,  193,    0,
        0,  190,  193,  194,  194,  194,  193,    0,    0,  194,
      195,  195,  195,  194,    0,    0,  195,    0,  193,    0,
      195,  196,  196,  196,    0,  190,    0,  196,  197,  197,

      197,  196,    0,    0,  197,  198,  198,  198,  197,    0,
        0,  198,    0,  193,    0,  198,  199,  199,  199,    0,
        0,  196,  199,  200,    0,  200,  199,    0,    0,  200,
      201,  201,  201,  202,  202,  202,  201,    0,  203,  202,
      201,  203,    0,  202,    0,  196,  203,  204,  200,  204,
      200,    0,  206,  204,  200,  206,    0,  205,  205,  205,
      206,    0,  203,  205,    0,  203,    0,  205,    0,  209,
      203,  209,  204,    0,  204,  209,  206,    0,  204,  206,
      207,  207,  207,  205,  206,    0,  207,  208,  208,  208,
      207,    0,    0,  208,  209,    0,  209,  208,    0,  210,

      209,  210,  211,  211,  211,  210,    0,  205,  211,    0,
      207,    0,  211,  212,  212,  212,    0,  208,    0,  212,
        0,    0,    0,  212,  210,  213,  210,  213,    0,    0,
      210,  213,    0,  215,  207,  215,  214,  214,  214,  215,
        0,  208,  214,  221,  221,  221,  214,    0,    0,  221,
      213,    0,  213,  221,    0,    0,  213,    0,  215,    0,
      215,    0,    0,    0,  215,  220,  220,  220,  220,    0,
        0,  220,  222,  222,  222,  220,    0,    0,  222,    0,
        0,    0,  222,  224,  224,  224,  224,  229,  229,  229,
      229,  232,  232,  232,  233,  233,  233,  232,    0,    0,

      233,  232,    0,    0,  233,  234,  234,  234,  235,  235,
      235,  234,    0,    0,  235,  234,    0,    0,  235,  236,
        0,    0,    0,  235,    0,    0,  236,  237,  237,  237,
      236,    0,    0,  237,    0,    0,    0,  237,    0,  238,
      238,  238,    0,  240,  236,  238,  240,    0,  235,  238,
      236,  240,    0,  241,  236,    0,  241,  237,  239,  239,
      239,  241,  242,    0,  239,    0,    0,  240,  239,  242,
      240,    0,    0,  242,    0,  240,    0,  241,    0,    0,
      241,  237,    0,    0,    0,  241,    0,  242,  239,  243,
      243,  243,    0,  242,    0,  243,    0,  242,    0,  243,

      244,  244,  244,  245,  245,  245,  244,    0,    0,  245,
      244,    0,  239,  245,  246,  246,  246,  247,  247,  247,
      246,    0,  253,  247,  246,    0,    0,  247,    0,  253,
        0,    0,  244,  253,    0,  245,  248,  251,  248,  251,
        0,    0,  248,  251,  249,  249,  249,  253,    0,  247,
      249,    0,    0,  253,  249,    0,  244,  253,    0,  245,
        0,  248,  251,  248,  251,    0,    0,  248,  251,  250,
      250,  250,    0,  247,  249,  250,  252,  252,  252,  250,
      254,    0,  252,    0,    0,  255,  252,  254,  255,    0,
        0,  254,    0,  255,  256,  256,  256,    0,  249,  257,

      256,  302,  302,  302,  256,  254,  257,  302,  252,  255,
      257,  254,  255,    0,    0,  254,    0,  255,    0,  258,
      258,  258,    0,    0,  257,  258,  256,    0,    0,  258,
      257,    0,  252,    0,  257,  264,  264,  264,  264,  272,
      272,  272,  272,    0,  276,  272,  277,    0,    0,  277,
      256,  276,    0,    0,  277,  276,  278,  278,  278,  279,
        0,  279,  278,    0,    0,  279,  278,    0,    0,  276,
      277,    0,    0,  277,    0,  276,    0,    0,  277,  276,
        0,  280,  280,  280,  279,  281,  279,  280,    0,    0,
      279,  280,  281,  282,  282,  282,  281,    0,  283,  282,

      283,    0,    0,  282,  283,  284,    0,  284,    0,    0,
      281,  284,    0,  280,    0,    0,  281,    0,    0,    0,
      281,    0,    0,  283,    0,  283,    0,    0,    0,  283,
      284,    0,  284,  285,  285,  285,  284,  280,    0,  285,
      286,  286,  286,  285,    0,    0,  286,  287,  287,  287,
      286,    0,    0,  287,  288,  288,  288,  287,    0,    0,
      288,  289,  289,  289,  288,    0,    0,  289,  290,  290,
      290,  289,    0,  287,  290,    0,    0,  291,  290,  291,
        0,    0,  292,  291,    0,  292,  293,  293,  293,    0,
      292,    0,  293,  303,  303,  303,  293,  287,    0,  303,

      289,    0,  291,    0,  291,    0,  292,    0,  291,  292,
      294,  294,  294,    0,  292,    0,  294,    0,    0,    0,
      294,  301,  301,  301,  301,    0,    0,  301,  309,  309,
      309,  294,    0,    0,  309,    0,    0,  310,  309,  310,
      311,  311,  311,  310,    0,    0,  311,  312,  312,  312,
      311,    0,    0,  312,    0,  314,  294,  312,  314,    0,
      309,    0,  310,  314,  310,  313,  313,  313,  310,    0,
        0,  313,    0,    0,    0,  313,    0,    0,    0,  314,
        0,    0,  314,  317,  309,    0,  317,  314,  315,  315,
      315,  317,    0,    0,  315,    0,    0,  313,  315,  316,

      316,  316,  318,  318,  318,  316,  319,  317,  318,  316,
      317,    0,  318,  319,    0,  317,    0,  319,  320,  320,
      320,  313,    0,  332,  320,  332,    0,    0,  320,  332,
        0,  319,  330,  330,  330,    0,    0,  319,  330,    0,
      333,  319,  330,  331,  331,  331,    0,  333,  332,  331,
      332,  333,    0,  331,  332,  334,    0,  334,  335,  335,
      335,  334,    0,    0,  335,  333,    0,  343,  335,  343,
        0,  333,    0,  343,    0,  333,    0,  344,  344,  344,
      334,    0,  334,  344,    0,    0,  334,  344,    0,    0,
      335,    0,  343,    0,  343,  345,  345,  345,  343,  352,

        0,  345,  346,  346,  346,  345,  352,    0,  346,    0,
      352,    0,  346,  345,  335,  353,  353,  353,    0,    0,
        0,  353,    0,    0,  352,  353,  357,  357,  357,    0,
      352,    0,  357,    0,  352,    0,  357,    0,  345,  360,
      360,  360,  360,  360,  360,  360,  360,  360,  360,  360,
      361,  361,  361,  361,  361,  361,  361,  361,  361,  361,
      361,  362,  362,  362,  362,  362,  362,  362,  362,  362,
      362,  362,  363,  363,  363,  363,  363,  363,  363,  363,
      363,  363,  363,  364,    0,    0,    0,  364,  364,  365,
      365,  365,    0,  365,  365,    0,  365,  365,  365,  366,

      366,  366,  366,  366,  366,  366,    0,  366,  366,  366,
      367,  367,    0,  367,  367,  367,  367,  367,  367,  367,
      367,  368,  368,  368,  368,  368,    0,  368,  368,  368,
      368,  368,  369,    0,    0,    0,    0,  369,  370,  370,
      370,  370,  370,  370,  370,  370,  370,  370,  370,  371,
        0,    0,    0,  371,  371,  372,  372,    0,    0,  372,
      372,  372,  372,  372,  372,  372,  373,  373,  373,  373,
        0,    0,    0,    0,    0,  373,  374,    0,    0,    0,
      374,  374,  375,  375,  375,  375,    0,    0,    0,    0,
        0,  375,  376,  376,  376,  376,  376,  376,  376,  376,

      376,  376,  376,  377,  377,  377,    0,  377,  377,    0,
      377,  377,  377,  378,  378,  378,  378,  378,  378,  378,
      378,  378,  378,  378,  379,  379,  379,    0,  379,  379,
        0,  379,  379,  379,  380,  380,  380,  380,    0,    0,
        0,    0,    0,  380,  381,  381,  381,  381,    0,    0,
        0,    0,    0,  381,  382,  382,  382,  382,  382,  382,
      382,  382,  382,  382,  382,  383,  383,  383,    0,  383,
      383,    0,    0,  383,  383,  384,  384,  384,  384,  384,
      384,  384,  384,  384,  384,  384,  385,  385,  385,    0,
      385,  385,    0,    0,  385,  385,  359,  359,  359,  359,

      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359,
      359,  359,  359,  359,  359,  359,  359,  359,  359,  359
    } ;

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
 *
 * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 *
 * IDENTIFICATION
 *	  $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.54 2006/08/14 21:14:42 tgl Exp $
 *
 *-------------------------------------------------------------------------
 */

#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 1186 "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 81 "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 1404 "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 >= 360 )
					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 != 359 );
		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 112 "scan.l"
{ return K_ASSIGN;			}
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 113 "scan.l"
{ return K_ASSIGN;			}
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 114 "scan.l"
{ return K_DOTDOT;			}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 115 "scan.l"
{ return K_ALIAS;			}
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 116 "scan.l"
{ return K_BEGIN;			}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 117 "scan.l"
{ return K_BY;   			}
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 118 "scan.l"
{ return K_CLOSE;			}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 119 "scan.l"
{ return K_CONSTANT;		}
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 120 "scan.l"
{ return K_CONTINUE;		}
	YY_BREAK
case 10:
YY_RULE_SETUP
#line 121 "scan.l"
{ return K_CURSOR;			}
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 122 "scan.l"
{ return K_DEBUG;			}
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 123 "scan.l"
{ return K_DECLARE;			}
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 124 "scan.l"
{ return K_DEFAULT;			}
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 125 "scan.l"
{ return K_DIAGNOSTICS;		}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 126 "scan.l"
{ return K_ELSE;			}
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 127 "scan.l"
{ return K_ELSIF;           }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 128 "scan.l"
{ return K_ELSIF;           }
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 129 "scan.l"
{ return K_END;				}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 130 "scan.l"
{ return K_EXCEPTION;		}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 131 "scan.l"
{ return K_EXECUTE;			}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 132 "scan.l"
{ return K_EXIT;			}
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 133 "scan.l"
{ return K_FETCH;			}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 134 "scan.l"
{ return K_FOR;				}
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 135 "scan.l"
{ return K_FROM;			}
	YY_BREAK
case 25:
YY_RULE_SETUP
#line 136 "scan.l"
{ return K_GET;				}
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 137 "scan.l"
{ return K_IF;				}
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 138 "scan.l"
{ return K_IN;				}
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 139 "scan.l"
{ return K_INFO;			}
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 140 "scan.l"
{ return K_INSERT;			}
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 141 "scan.l"
{ return K_INTO;			}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 142 "scan.l"
{ return K_IS;				}
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 143 "scan.l"
{ return K_LOG;				}
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 144 "scan.l"
{ return K_LOOP;			}
	YY_BREAK
case 34:
YY_RULE_SETUP
#line 145 "scan.l"
{ return K_NEXT;			}
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 146 "scan.l"
{ return K_NOT;				}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 147 "scan.l"
{ return K_NOTICE;			}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 148 "scan.l"
{ return K_NULL;			}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 149 "scan.l"
{ return K_OPEN;			}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 150 "scan.l"
{ return K_OR;				}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 151 "scan.l"
{ return K_PERFORM;			}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 152 "scan.l"
{ return K_RAISE;			}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 153 "scan.l"
{ return K_RENAME;			}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 154 "scan.l"
{ return K_RESULT_OID;		}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 155 "scan.l"
{ return K_RETURN;			}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 156 "scan.l"
{ return K_REVERSE;			}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 157 "scan.l"
{ return K_ROW_COUNT;		}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 158 "scan.l"
{ return K_STRICT;	    	}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 159 "scan.l"
{ return K_THEN;			}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 160 "scan.l"
{ return K_TO;				}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 161 "scan.l"
{ return K_TYPE;			}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 162 "scan.l"
{ return K_WARNING;			}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 163 "scan.l"
{ return K_WHEN;			}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 164 "scan.l"
{ return K_WHILE;			}
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 166 "scan.l"
{ return O_OPTION;			}
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 167 "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 56:
/* rule 56 can match eol */
YY_RULE_SETUP
#line 177 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 57:
/* rule 57 can match eol */
YY_RULE_SETUP
#line 180 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
#line 183 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
#line 186 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
#line 189 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
#line 192 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
#line 195 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
#line 198 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 201 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 65:
/* rule 65 can match eol */
YY_RULE_SETUP
#line 204 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 66:
/* rule 66 can match eol */
YY_RULE_SETUP
#line 207 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
#line 210 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 68:
/* rule 68 can match eol */
YY_RULE_SETUP
#line 213 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
#line 216 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 70:
/* rule 70 can match eol */
YY_RULE_SETUP
#line 219 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
#line 222 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 226 "scan.l"
{ return T_NUMBER;			}
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 228 "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 74:
/* rule 74 can match eol */
YY_RULE_SETUP
#line 239 "scan.l"
{ plpgsql_SpaceScanned = true;		}
	YY_BREAK
/* ----------
     * Eat up comments
     * ----------
     */
case 75:
YY_RULE_SETUP
#line 245 "scan.l"
;
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 247 "scan.l"
{ start_lineno = plpgsql_scanner_lineno();
			  BEGIN(IN_COMMENT);
			}
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 250 "scan.l"
{ BEGIN(INITIAL); plpgsql_SpaceScanned = true; }
	YY_BREAK
case 78:
/* rule 78 can match eol */
YY_RULE_SETUP
#line 251 "scan.l"
;
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 252 "scan.l"
;
	YY_BREAK
case YY_STATE_EOF(IN_COMMENT):
#line 253 "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 80:
YY_RULE_SETUP
#line 268 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  BEGIN(IN_STRING);
			}
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 273 "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 82:
YY_RULE_SETUP
#line 279 "scan.l"
{ }
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 280 "scan.l"
{ /* can only happen with \ at EOF */ }
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 281 "scan.l"
{ }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 282 "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 86:
/* rule 86 can match eol */
YY_RULE_SETUP
#line 291 "scan.l"
{ }
	YY_BREAK
case YY_STATE_EOF(IN_STRING):
#line 292 "scan.l"
{
				plpgsql_error_lineno = start_lineno;
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated string")));
			}
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 299 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  dolqstart = pstrdup(plpgsql_base_yytext);
			  BEGIN(IN_DOLLARQUOTE);
			}
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 305 "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 89:
/* rule 89 can match eol */
YY_RULE_SETUP
#line 327 "scan.l"
{ }
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 328 "scan.l"
{ /* needed for $ inside the quoted text */ }
	YY_BREAK
case YY_STATE_EOF(IN_DOLLARQUOTE):
#line 329 "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 91:
YY_RULE_SETUP
#line 340 "scan.l"
{ return plpgsql_base_yytext[0];			}
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 342 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 2099 "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 >= 360 )
				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 >= 360 )
			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 == 359);

	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 342 "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;
}

