#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;

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

#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
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 * Ditto for the __ia64__ case accordingly.
 */
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#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 94
#define YY_END_OF_BUFFER 95
/* 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[373] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   95,   93,
       76,   76,   93,   93,   82,   93,   93,   93,   74,   93,
        2,   58,   58,   58,   58,   58,   58,   58,   58,   58,
       58,   58,   58,   58,   58,   58,   58,   58,   58,   93,
       88,   87,   85,   81,   80,   81,   91,   91,   92,   76,
       75,    0,   58,   89,   66,    0,   77,    3,   78,   74,
        1,    0,   58,    0,    0,   58,   58,    6,   58,   58,
       58,   58,   58,   58,   83,   58,   58,   58,   58,   58,
       58,   58,   26,   27,   31,   58,   58,   58,   58,   58,
       40,   58,   58,   58,   58,   58,   58,   58,   51,   58,

       58,   58,    0,   88,   86,   84,   79,   91,   90,    0,
       58,    0,    0,    0,    0,    0,   77,    0,    0,    0,
        0,   59,   58,   58,   58,   58,   58,   58,   58,   58,
       58,   58,   58,   18,   58,   58,   58,   58,   23,   58,
       25,   58,   58,   58,   32,   58,   58,    0,   36,   58,
       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
       58,   58,   58,   58,   58,    0,    0,    0,    0,    0,
        0,   67,    0,    0,    0,   59,    0,   59,    0,    0,
       58,   58,   58,   58,   58,   58,   58,   58,   58,   58,
       57,   15,   58,   58,   58,   21,   58,   24,   28,   58,

       30,   33,   34,    0,   58,   38,   39,   58,   58,   58,
       58,   58,   58,   58,   58,   58,   50,   52,   58,   54,
       58,    0,    0,    0,    0,   67,    0,   67,    0,    0,
        0,    0,    0,    0,    0,    0,   60,    4,    5,    7,
       58,   58,   58,   11,   58,   58,   58,   58,   17,   58,
       58,   22,   58,    0,   58,   58,   42,   58,   58,   58,
       58,   58,   58,   58,   58,   55,    0,    0,    0,    0,
        0,    0,    0,   68,    0,   61,    0,    0,    0,   60,
        0,   60,    0,   58,   58,   10,   58,   58,   58,   16,
       58,   58,   29,    0,   37,   58,   43,   58,   45,   58,

       58,   48,   49,   58,    0,    0,   69,    0,    0,    0,
       68,    0,   68,    0,    0,    0,    0,    0,   58,   58,
       12,   13,   58,   58,   20,    0,   41,   58,   46,   58,
       53,   56,    0,    0,    0,    0,    0,    0,   62,    0,
        8,    9,   58,   58,    0,   58,   58,    0,    0,   70,
        0,   64,    0,    0,   58,   19,   35,   58,   47,   72,
        0,    0,    0,   63,   58,   44,    0,   71,   65,   14,
       73,    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[399] =
    {   0,
        0,  307,   55,   56,   63,   64,   65,   68,  281, 2417,
       74,   77,   79,   76, 2417,  265,  260,  244,  239,  223,
     2417,   85,   96,  158,  197,  248,  290,   99,  111,  348,
       95,   97,   99,  165,  179,  389,  211,  425,  256,   40,
        0,  229,    0, 2417, 2417,  224,    0,    0,  203,  135,
      194,  193,  199, 2417,  172,  188,    0, 2417, 2417,  180,
     2417,  232,  259,   99,  285,  330,  292,  327,  331,  290,
      361,  471,  395,  418, 2417,  412,  384,  527,  469,  454,
      388,  504,  493,  503,  539,  540,  577,  593,  539,  473,
      600,  607,  597,  642,  621,  628,  642,  647,  653,  684,

      701,  691,   54,    0, 2417, 2417, 2417,    0, 2417,  183,
      715,  184,  722,  194,  740,  172,    0,   56,   53,  744,
      173,  748,  751,  745,  511,  743,  620,  748,  752,  806,
      813,  825,  748,  837,  813,  825,  850,  845,  870,  884,
      895,  874,  894,  875,  919,  939,  927,  951,  937,  934,
      943,  945,  977, 1001,  985,  987, 1004, 1049, 1005, 1041,
     1036, 1051, 1045, 1053, 1069,   94,  165,  110,  102, 1109,
      158, 1113,  110,  161,  139, 1127, 1134, 1141,  250, 1152,
     1118, 1119, 1139, 1165, 1159, 1160, 1189, 1213, 1197, 1141,
     1231, 1217, 1224, 1256, 1235, 1270, 1288, 1295, 1302, 1313,

     1316, 1327, 1330,   99, 1322, 1346, 1349, 1329, 1346, 1373,
     1343, 1396, 1403, 1368, 1386, 1398, 1452, 1459, 1422, 1471,
     1432,  181,  168,  210,  116, 1482, 1489, 1496,  344, 1427,
      208,  187,  216,  240, 1507,  101,  289, 1511, 1514, 1525,
     1528, 1519, 1547, 1559, 1578, 1538, 1548, 1562, 1609, 1620,
     1623, 1634, 1637,  253, 1639, 1664, 1689, 1640, 1696, 1622,
     1680, 1680, 1684, 1714, 1699, 1747,  291,  290,  228,  329,
      328, 1758,  100,  518,  345, 2417,  352,  378,   86, 1762,
      551,  677,  380, 1746, 1746, 1780, 1766, 1805, 1773, 1819,
     1815, 1816, 1840,  397, 1843, 1865, 1868, 1879, 1882, 1877,

     1865, 1901, 1926, 1929,  415,  415, 2417,  424,  432,   64,
     1940, 1721, 1904,  433,  444,  542,  307,  543, 1947, 1939,
     1959, 1966, 1984, 1949, 2007,  556, 2018, 1977, 2021, 2005,
     2037, 2417,  583,  594,  333,  596,  390,  631, 2417,  652,
     2051, 2062, 2025, 2039,  663, 2057, 2077,  404,  669, 2417,
      707, 2417,  730,  407, 2069, 2096, 2417, 2114, 2121, 2417,
      749,  488,  571, 2417, 2098, 2134,  685, 2417, 2417, 2145,
     2417, 2417, 2159, 2170, 2181, 2192, 2198, 2208, 2219, 2230,
     2241, 2247, 2258, 2264, 2275, 2285, 2291, 2301, 2312, 2322,
     2333, 2343, 2353, 2363, 2374, 2384, 2395, 2405

    } ;

static yyconst flex_int16_t yy_def[399] =
    {   0,
      372,    1,  373,  373,  374,  374,  375,  375,  372,  372,
      372,  372,  376,  377,  372,  372,  372,  372,  372,  372,
      372,  378,  378,  378,   24,   24,   24,  378,  378,  378,
       24,   24,   24,  378,  378,   24,  378,   24,  378,  372,
      379,  372,  380,  372,  372,  372,  381,  381,  382,  372,
      383,  383,  372,  372,  372,  384,  385,  372,  372,  372,
      372,  372,  378,  372,  386,  378,  378,  378,   24,   30,
      378,   30,  378,  378,  372,   30,  378,  378,  378,  378,
       24,  378,  378,   30,  378,   24,  378,  378,   24,   78,
      378,  378,   78,   30,  378,  378,  378,   78,  378,  378,

      378,   78,  372,  379,  372,  372,  372,  381,  372,  387,
      372,  383,  372,  372,  388,  384,  385,  372,  372,  386,
      389,  390,  378,   78,   30,   30,   30,   24,   24,  378,
      378,  378,   78,  378,   78,   78,  378,   78,  378,  378,
      378,   24,   78,   24,  378,  378,   78,  372,   78,   24,
       30,   30,   30,  378,   24,   24,   78,  378,   24,   78,
       30,   78,   30,   30,   24,  372,  387,  372,  372,  388,
      391,  392,  372,  372,  389,  372,  372,  390,  372,  393,
       30,   30,   78,  378,   78,   24,  378,  378,   24,   30,
      378,   78,   30,  378,   24,  378,  378,  378,  378,  378,

      378,  378,  378,  372,   78,  378,  378,   24,   78,  378,
       24,  378,  378,   78,   24,   78,  378,  378,   78,  378,
       78,  372,  372,  372,  391,  372,  372,  392,  372,  394,
      372,  372,  372,  372,  393,  395,  396,  378,  378,  378,
      378,   30,  378,  378,  378,   24,   24,   30,  378,  378,
      378,  378,  378,  372,   78,  378,  378,   78,  378,   30,
       30,   24,   24,  378,   30,  378,  372,  372,  372,  372,
      372,  394,  397,  398,  372,  372,  372,  372,  395,  372,
      372,  396,  372,   30,   24,  378,   78,  378,   30,  378,
       78,   78,  378,  372,  378,  378,  378,  378,  378,   78,

       24,  378,  378,  378,  372,  372,  372,  372,  372,  397,
      372,  372,  398,  372,  372,  372,  372,  372,  378,   78,
      378,  378,  378,   24,  378,  372,  378,   24,  378,   30,
      378,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      378,  378,   78,   30,  372,   78,  378,  372,  372,  372,
      372,  372,  372,  372,   78,  378,  372,  378,  378,  372,
      372,  372,  372,  372,   30,  378,  372,  372,  372,  378,
      372,    0,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372

    } ;

static yyconst flex_int16_t yy_nxt[2481] =
    {   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,   32,   33,   34,
       35,   36,   37,   38,   29,   29,   39,   29,   29,   10,
       29,   22,   23,   24,   25,   26,   27,   28,   29,   30,
       31,   32,   33,   34,   35,   36,   37,   38,   29,   29,
       39,   29,   29,   42,   42,   45,   45,   48,  311,  103,
       48,   49,   46,   46,   49,   50,   50,   50,   50,   50,
       50,   52,   54,   53,  166,  173,   62,   62,   62,   55,
      280,  174,   64,  103,   43,   43,   65,   62,   62,   62,

       62,   62,   62,   64,  311,  280,   64,   65,  166,  173,
       65,   66,   62,   62,   62,  174,   67,  254,   64,   82,
      226,   63,   65,   63,   86,   63,   87,  222,   88,   63,
      118,   63,  119,   89,   68,   66,   50,   50,   50,  223,
      224,   67,  254,  176,   82,   63,  231,   63,   86,   63,
       87,  222,   88,   63,  118,   63,  119,   89,   68,   62,
       62,   62,  226,  223,  224,   64,   62,   62,   62,   65,
      231,  109,   64,  113,  113,  113,   65,  176,   54,  114,
       62,   62,   62,  115,   69,   55,   64,   70,  111,  109,
       65,  232,   71,   60,   54,   90,   91,  111,  111,   92,

       62,   62,   62,  112,  268,  267,   64,  276,   69,  109,
       65,   70,   62,   62,   62,  232,   71,   72,   64,   90,
       91,   73,   65,   63,   92,  168,   63,  169,  268,   96,
      267,   74,  276,   62,   62,   62,  107,  105,   61,   64,
      269,  275,   72,   65,   97,  277,   73,   63,  307,  168,
       63,  169,   60,   59,   96,   74,   75,   62,   62,   62,
       62,   62,   62,   64,  269,  275,   64,   65,   97,  277,
       65,   58,  101,  307,   76,   57,   77,   63,  278,  102,
      372,  233,   63,  234,  294,   78,  120,  120,  120,  121,
      281,  281,  281,   62,   62,   62,  283,  101,   76,   64,

       77,   63,  278,   65,  102,  233,   63,  234,  294,   78,
       79,   63,   40,  372,  124,  372,   63,  372,  126,   80,
      305,   81,   63,  306,   63,  372,  372,  339,   62,   62,
       62,   62,   62,   62,   64,   79,   63,   64,   65,  124,
       63,   65,  126,   80,  305,   81,   63,  306,   63,   62,
       62,   62,  339,  350,  123,   64,  372,   63,  308,   65,
      125,  372,   62,   62,   62,   63,  309,  372,   64,   83,
      372,  372,   65,  372,  372,  270,   84,  271,  350,  123,
       85,   63,  308,  315,  125,   62,   62,   62,  316,   63,
      309,   64,  127,  372,   83,   65,   62,   62,   62,  270,

       84,  271,   64,  134,   85,   93,   65,  315,  317,   94,
      352,  131,  316,  318,   63,   63,  127,  140,   95,   62,
       62,   62,   63,   63,  360,   64,  326,  364,  134,   65,
       93,  372,  317,   63,   94,  352,  131,  318,   63,   63,
       63,  140,   95,  332,  133,  132,   63,   63,   98,  360,
      326,   63,  364,  333,   99,   62,   62,   62,   63,   63,
      334,   64,  335,  100,   63,   65,  336,  332,  133,  132,
       62,   62,   62,   98,  337,   63,   64,  333,   99,  372,
       65,  372,  372,   63,  334,  139,  335,  100,  128,  129,
      336,   63,  130,  151,   62,   62,   62,   63,  337,   63,

       64,  372,  138,   63,   65,   62,   62,   62,  368,  139,
      372,   64,  372,  128,  129,   65,   63,  130,  151,  312,
      312,  312,   63,   63,  142,  314,  138,   63,   62,   62,
       62,   63,   63,  368,   64,  143,  144,  141,   65,   63,
       62,   62,   62,  183,  372,  135,   64,  136,  372,  142,
       65,  137,  281,  281,  281,   63,  372,   63,  283,  143,
      144,  141,  145,   63,  372,  150,   63,  183,   63,  146,
      135,  372,  136,   63,   63,  338,  137,  372,   62,   62,
       62,  340,  345,  372,   64,  372,  372,  145,   65,  150,
       63,  369,   63,  146,  148,  148,  148,   63,   63,  338,

       64,   62,   62,   62,   65,  340,  345,   64,   62,   62,
       62,   65,  147,  348,   64,   63,  369,   63,   65,  372,
      372,  153,   62,   62,   62,  372,  149,  349,   64,   62,
       62,   62,   65,  372,  351,   64,  147,  348,  152,   65,
       63,   63,   63,   62,   62,   62,  153,  372,   63,   64,
      149,  349,  186,   65,   62,   62,   62,  158,  351,  159,
       64,  372,  152,   63,   65,   63,   63,  161,  372,  353,
      154,   63,   63,  160,  155,  156,  186,  157,  281,  281,
      281,  158,  354,  159,  283,   62,   62,   62,   63,  357,
       63,   64,  161,  353,  154,   65,   63,  160,  155,  156,

      372,  157,   62,   62,   62,  371,  354,  361,   64,   63,
      372,  164,   65,  357,  162,  165,   62,   62,   62,  112,
      372,  372,   64,  113,  113,  113,   65,  372,  372,  114,
      371,  361,  163,  115,   63,  372,  164,  362,  162,  372,
      165,  170,  170,  170,  171,  120,  120,  120,  121,  177,
      177,  177,   62,   62,   62,  179,  163,  372,   64,  180,
      363,  362,   65,   63,   63,   63,   63,  181,  192,  182,
      372,   63,  193,  372,   63,  184,  185,   63,  188,  367,
      372,   63,  187,  372,  363,  372,   63,  372,   63,   63,
       63,   63,  181,  192,  182,   63,  372,  193,   63,  184,

      185,   63,  188,  367,  372,   63,  187,   62,   62,   62,
       63,  372,  372,   64,   62,   62,   62,   65,  372,  372,
       64,  372,  189,  372,   65,  372,   62,   62,   62,  372,
      372,   63,   64,  194,  372,  190,   65,   63,   62,   62,
       62,  372,  372,  195,   64,   63,  372,  189,   65,   63,
      372,   62,   62,   62,  372,  191,   63,   64,  194,  372,
      190,   65,   63,  197,  372,   63,  372,  372,  195,   63,
       63,   62,   62,   62,   63,  372,  372,   64,  372,  191,
      372,   65,  372,  196,  372,   62,   62,   62,  197,  372,
       63,   64,  372,  372,   63,   65,   62,   62,   62,  372,

       63,   63,   64,  199,  201,  372,   65,  196,   63,   63,
      372,  198,   63,  372,  200,  372,  372,  372,   63,  372,
       62,   62,   62,  372,   63,   63,   64,  199,  201,  372,
       65,  372,   63,   63,  372,  198,  372,   63,  372,  200,
       62,   62,   62,   63,  372,   63,   64,  203,  372,  372,
       65,   63,  148,  148,  148,   63,  372,   63,   64,  372,
      206,  205,   65,   63,   63,  372,  208,  372,   63,  202,
       63,  207,  203,   63,  372,   63,   63,   63,  372,  372,
       63,  372,   63,  204,  206,  372,  205,   63,  372,   63,
      372,  208,   63,  202,  372,  207,  372,   63,   63,   63,

      372,   63,   62,   62,   62,   63,  372,  204,   64,  209,
      372,   63,   65,   63,   63,  372,   63,  210,  372,  211,
      372,  212,   63,   63,  213,  372,  372,  372,   63,   63,
      372,   63,  372,  209,  215,   63,  372,   63,   63,   63,
       63,  372,  210,  211,  372,  212,  372,   63,  372,  213,
       62,   62,   62,   63,  372,   63,   64,   63,  215,   63,
       65,   63,  372,   63,  217,  216,   63,  372,   63,   63,
      372,  218,  372,  219,   63,   63,  372,   63,  372,  372,
      372,  220,   63,  372,   63,   63,   63,  372,  217,  214,
      216,   63,   63,  372,   63,  221,  218,  219,   63,   63,

       63,   63,  372,   63,  372,  220,  372,  372,  372,   63,
      170,  170,  170,  171,  227,  227,  227,  372,  372,  221,
      229,  372,   63,  372,  230,  372,  372,   63,  177,  177,
      177,  121,  372,  372,  179,  177,  177,  177,  180,   63,
       63,  179,  177,  177,  177,  180,   63,  239,  179,  372,
      238,   63,  180,  235,  235,  235,  236,   63,  372,  240,
      372,  372,   63,   63,   63,   63,   62,   62,   62,  247,
       63,  239,   64,   63,  238,   63,   65,   63,  372,   63,
      372,  372,   63,  242,  240,  372,   63,   63,   63,  243,
       62,   62,   62,  247,   63,  372,   64,   63,  241,  372,

       65,  372,   63,  372,   63,  372,  372,  372,  242,  372,
       63,  244,  372,  243,   62,   62,   62,  372,   63,  372,
       64,  372,  241,   63,   65,  372,   63,  372,  372,  245,
      372,  246,   62,   62,   62,   63,  244,   63,   64,  372,
      372,  248,   65,  372,  372,  249,  372,   63,  372,  372,
       63,  372,   63,  372,  245,  246,   63,   62,   62,   62,
       63,   63,   63,   64,   63,  372,  248,   65,  372,  251,
      249,   62,   62,   62,  372,  372,   63,   64,  372,  372,
       63,   65,  372,  372,  372,   63,  250,  372,   63,   62,
       62,   62,  372,  251,  372,   64,   62,   62,   62,   65,

      372,  372,   64,   62,   62,   62,   65,  372,  372,   64,
      250,  252,  372,   65,   62,   62,   62,   62,   62,   62,
       64,  372,  372,   64,   65,  372,  372,   65,   62,   62,
       62,   62,   62,   62,   64,  372,  252,   64,   65,  372,
      255,   65,   63,  372,  253,  372,   63,   62,   62,   62,
       62,   62,   62,   64,  372,   63,   64,   65,  256,  372,
       65,  372,  372,   63,   63,  255,  257,   63,  253,  259,
       63,   63,   63,  372,   62,   62,   62,   63,  372,   63,
       64,  372,  256,  372,   65,  372,  262,   63,   63,   63,
      372,  257,   63,  259,  372,   63,   63,   62,   62,   62,

      258,   63,  372,   64,   62,   62,   62,   65,  372,  372,
       64,  262,  263,   63,   65,   63,  264,   63,   63,  372,
       63,  372,   63,  372,  258,  372,  372,  260,  272,  272,
      272,  273,  372,  372,  261,  372,  263,  372,  372,   63,
       63,  264,   63,   63,   63,  372,  265,   63,  372,  372,
       63,  260,  266,   62,   62,   62,   63,  372,  261,   64,
       62,   62,   62,   65,  372,   63,   64,   63,  372,  372,
       65,  265,   62,   62,   62,   63,  372,  266,   64,  372,
      372,   63,   65,  227,  227,  227,  171,  372,  372,  229,
      227,  227,  227,  230,  372,  372,  229,  227,  227,  227,

      230,  372,  372,  229,  372,  372,  372,  230,  235,  235,
      235,  236,   62,   62,   62,   62,   62,   62,   64,  372,
      372,   64,   65,  372,  372,   65,   62,   62,   62,   62,
       62,   62,   64,  372,  372,   64,   65,  372,  372,   65,
       63,  372,  372,  372,  284,  372,  372,  285,   62,   62,
       62,   63,  372,  372,   64,  372,  372,  372,   65,  372,
       62,   62,   62,  372,  288,   63,   64,   63,  372,  284,
       65,  285,   63,  372,   63,   63,  372,  289,  286,   62,
       62,   62,   63,  290,  372,   64,  372,  372,  288,   65,
       63,   63,  372,  372,   63,  372,   63,  372,   63,  372,

      372,  289,  286,  372,  372,  372,   63,  372,  290,  287,
       62,   62,   62,  372,   63,  372,   64,  372,   63,  372,
       65,   62,   62,   62,   62,   62,   62,   64,  372,  372,
       64,   65,  372,  287,   65,   62,   62,   62,   62,   62,
       62,   64,  372,   63,   64,   65,  372,  372,   65,  372,
      299,  372,  372,  291,   63,  372,  292,   63,   63,  295,
      297,  372,  372,   63,   63,   62,   62,   62,   63,  372,
      293,   64,  372,  372,  299,   65,  372,  291,   63,  372,
      292,  372,   63,   63,  295,  297,  372,  372,   63,   63,
       62,   62,   62,  372,  293,  296,   64,   62,   62,   62,

       65,   63,  372,   64,  372,  372,   63,   65,   63,  301,
      302,  372,  300,   63,   63,   62,   62,   62,   63,  296,
       63,   64,  312,  312,  312,   65,   63,  304,  314,  298,
       63,   63,   63,  301,  302,  372,  300,   63,   63,  372,
      372,  372,   63,  372,  372,   63,  372,  303,   62,   62,
       62,  304,  372,  298,   64,   63,  372,  372,   65,  272,
      272,  272,  273,  281,  281,  281,  236,   63,  372,  283,
      372,  303,   63,  372,  319,   63,  372,  372,   63,  372,
      320,   62,   62,   62,   63,  372,  321,   64,  372,  372,
       63,   65,   63,  372,   63,  372,   63,  372,  319,   63,

      372,   63,   63,  372,  320,  323,   62,   62,   62,   63,
      372,  321,   64,  372,  372,   63,   65,  372,  372,   63,
       62,   62,   62,  372,  372,   63,   64,  372,  372,  323,
       65,  372,  372,   63,   63,   63,  325,  372,  322,  324,
       63,   62,   62,   62,   62,   62,   62,   64,  372,  372,
       64,   65,  372,  372,   65,  372,  372,  372,   63,   63,
       63,  325,  322,  372,  324,   63,   62,   62,   62,   62,
       62,   62,   64,  372,  372,   64,   65,  372,  372,   65,
       62,   62,   62,   62,   62,   62,   64,  372,  372,   64,
       65,   63,  327,   65,   63,   63,  372,  329,  372,  330,

      372,   63,   62,   62,   62,  312,  312,  312,   64,  372,
      372,  314,   65,  372,  372,   63,  327,  372,   63,  328,
       63,  372,  329,  330,  372,  372,   63,   62,   62,   62,
       62,   62,   62,   64,  372,  372,   64,   65,  372,  372,
       65,  312,  312,  312,  273,  372,  372,  314,   62,   62,
       62,  331,  372,  372,   64,  372,  372,   63,   65,  342,
       62,   62,   62,   63,  372,  372,   64,   62,   62,   62,
       65,  372,  372,   64,  372,   63,  331,   65,  344,  372,
      341,  372,   63,   63,  342,   62,   62,   62,   63,  372,
      372,   64,  372,  372,  372,   65,  372,  372,  372,   63,

      372,  372,  344,   63,  341,  372,  346,   63,   62,   62,
       62,   63,  372,  372,   64,  372,  372,  343,   65,   62,
       62,   62,   62,   62,   62,   64,   63,   63,   64,   65,
      346,  372,   65,  347,  372,   63,  372,   63,   62,   62,
       62,  343,  372,   63,   64,   63,  372,  372,   65,  355,
      372,   63,   62,   62,   62,  372,  372,  347,   64,  372,
       63,   63,   65,   62,   62,   62,  372,  356,   63,   64,
       63,   63,  372,   65,  355,   63,  372,   63,   62,   62,
       62,  358,  372,  372,   64,   63,  372,  365,   65,   63,
      372,  356,  372,   63,  372,   63,  372,   62,   62,   62,

       63,  372,   63,   64,  372,  372,  358,   65,  372,  372,
      359,  372,  365,  372,   63,   62,   62,   62,   63,   63,
      372,   64,   62,   62,   62,   65,   63,  372,   64,  372,
      370,  372,   65,  366,  359,   62,   62,   62,  372,  372,
      372,   64,  372,  372,   63,   65,   62,   62,   62,  372,
       63,  372,   64,  372,  370,  372,   65,  372,  366,   41,
       41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
       44,   44,   44,   44,   44,   44,   44,   44,   44,   44,
       44,   47,   47,   47,   47,   47,   47,   47,   47,   47,
       47,   47,   51,   51,   51,   51,   51,   51,   51,   51,

       51,   51,   51,   56,  372,  372,  372,   56,   56,   63,
       63,   63,  372,   63,   63,  372,   63,   63,   63,  104,
      104,  104,  104,  104,  104,  104,  372,  104,  104,  104,
      106,  106,  372,  106,  106,  106,  106,  106,  106,  106,
      106,  108,  108,  108,  108,  108,  372,  108,  108,  108,
      108,  108,  110,  372,  372,  372,  372,  110,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,  116,
      372,  372,  372,  116,  116,  117,  117,  372,  372,  117,
      117,  117,  117,  117,  117,  117,  122,  122,  122,  122,
      372,  372,  372,  372,  372,  122,  167,  372,  372,  372,

      167,  167,  172,  172,  172,  172,  372,  372,  372,  372,
      372,  172,  175,  175,  175,  175,  175,  175,  175,  175,
      175,  175,  175,  178,  178,  178,  372,  178,  178,  372,
      178,  178,  178,  225,  225,  225,  225,  225,  225,  225,
      225,  225,  225,  225,  228,  228,  228,  372,  228,  228,
      372,  228,  228,  228,  237,  237,  237,  237,  372,  372,
      372,  372,  372,  237,  274,  274,  274,  274,  372,  372,
      372,  372,  372,  274,  279,  279,  279,  279,  279,  279,
      279,  279,  279,  279,  279,  282,  282,  282,  372,  282,
      282,  372,  372,  282,  282,  310,  310,  310,  310,  310,

      310,  310,  310,  310,  310,  310,  313,  313,  313,  372,
      313,  313,  372,  372,  313,  313,    9,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372
    } ;

static yyconst flex_int16_t yy_chk[2481] =
    {   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,  310,   40,
        8,    7,    5,    6,    8,   11,   11,   11,   12,   12,
       12,   13,   14,   13,  103,  118,   22,   22,   22,   14,
      279,  119,   22,   40,    3,    4,   22,   23,   23,   23,

       28,   28,   28,   23,  273,  236,   28,   23,  103,  118,
       28,   22,   29,   29,   29,  119,   23,  204,   29,   28,
      225,   31,   29,   32,   31,   33,   32,  166,   33,   31,
       64,   32,   64,   33,   23,   22,   50,   50,   50,  168,
      169,   23,  204,  175,   28,   31,  173,   32,   31,   33,
       32,  166,   33,   31,   64,   32,   64,   33,   23,   24,
       24,   24,  171,  168,  169,   24,   34,   34,   34,   24,
      173,  167,   34,   55,   55,   55,   34,  121,  116,   55,
       35,   35,   35,   55,   24,   55,   35,   24,  112,  110,
       35,  174,   24,   60,   56,   34,   34,   52,   51,   35,

       53,   53,   53,   53,  223,  222,   53,  232,   24,   49,
       53,   24,   37,   37,   37,  174,   24,   25,   37,   34,
       34,   25,   37,   25,   35,  114,   25,  114,  223,   37,
      222,   25,  232,   62,   62,   62,   46,   42,   20,   62,
      224,  231,   25,   62,   37,  233,   25,   25,  269,  114,
       25,  114,   19,   18,   37,   25,   26,   39,   39,   39,
       63,   63,   63,   39,  224,  231,   63,   39,   37,  233,
       63,   17,   39,  269,   26,   16,   26,   26,  234,   39,
        9,  179,   26,  179,  254,   26,   65,   65,   65,   65,
      237,  237,  237,   67,   67,   67,  237,   39,   26,   67,

       26,   26,  234,   67,   39,  179,   26,  179,  254,   26,
       27,   70,    2,    0,   67,    0,   27,    0,   70,   27,
      267,   27,   70,  268,   27,    0,    0,  317,   68,   68,
       68,   66,   66,   66,   68,   27,   70,   66,   68,   67,
       27,   66,   70,   27,  267,   27,   70,  268,   27,   30,
       30,   30,  317,  335,   66,   30,    0,   69,  270,   30,
       69,    0,   71,   71,   71,   69,  271,    0,   71,   30,
        0,    0,   71,    0,    0,  229,   30,  229,  335,   66,
       30,   69,  270,  275,   69,   77,   77,   77,  277,   69,
      271,   77,   71,    0,   30,   77,   73,   73,   73,  229,

       30,  229,   73,   77,   30,   36,   73,  275,  278,   36,
      337,   73,  277,  283,   81,   36,   71,   81,   36,   74,
       74,   74,   81,   36,  348,   74,  294,  354,   77,   74,
       36,    0,  278,   76,   36,  337,   73,  283,   81,   36,
       76,   81,   36,  305,   76,   74,   81,   36,   38,  348,
      294,   38,  354,  306,   38,   80,   80,   80,   76,   38,
      308,   80,  309,   38,   76,   80,  314,  305,   76,   74,
       79,   79,   79,   38,  315,   38,   79,  306,   38,    0,
       79,    0,    0,   38,  308,   80,  309,   38,   72,   72,
      314,   90,   72,   90,   83,   83,   83,   90,  315,   72,

       83,    0,   79,   72,   83,   82,   82,   82,  362,   80,
        0,   82,    0,   72,   72,   82,   90,   72,   90,  274,
      274,  274,   90,   72,   84,  274,   79,   72,   78,   78,
       78,   84,  125,  362,   78,   84,   84,   82,   78,  125,
       85,   85,   85,  125,    0,   78,   85,   78,    0,   84,
       85,   78,  281,  281,  281,   84,    0,  125,  281,   84,
       84,   82,   86,  125,    0,   89,   86,  125,   89,   86,
       78,    0,   78,   89,   86,  316,   78,    0,   87,   87,
       87,  318,  326,    0,   87,    0,    0,   86,   87,   89,
       86,  363,   89,   86,   88,   88,   88,   89,   86,  316,

       88,   91,   91,   91,   88,  318,  326,   91,   92,   92,
       92,   91,   87,  333,   92,   93,  363,   93,   92,    0,
        0,   93,   95,   95,   95,    0,   88,  334,   95,   96,
       96,   96,   95,    0,  336,   96,   87,  333,   92,   96,
       93,  127,   93,   97,   97,   97,   93,    0,  127,   97,
       88,  334,  127,   97,   99,   99,   99,   95,  336,   96,
       99,    0,   92,   94,   99,   98,  127,   98,    0,  338,
       94,   98,  127,   97,   94,   94,  127,   94,  282,  282,
      282,   95,  340,   96,  282,  100,  100,  100,   94,  345,
       98,  100,   98,  338,   94,  100,   98,   97,   94,   94,

        0,   94,  101,  101,  101,  367,  340,  349,  101,  102,
        0,  102,  101,  345,  100,  102,  111,  111,  111,  111,
        0,    0,  111,  113,  113,  113,  111,    0,    0,  113,
      367,  349,  101,  113,  102,    0,  102,  351,  100,    0,
      102,  115,  115,  115,  115,  120,  120,  120,  120,  122,
      122,  122,  123,  123,  123,  122,  101,    0,  123,  122,
      353,  351,  123,  124,  126,  124,  133,  123,  133,  124,
        0,  126,  133,    0,  128,  126,  126,  128,  129,  361,
        0,  129,  128,    0,  353,    0,  129,    0,  124,  126,
      124,  133,  123,  133,  124,  126,    0,  133,  128,  126,

      126,  128,  129,  361,    0,  129,  128,  130,  130,  130,
      129,    0,    0,  130,  131,  131,  131,  130,    0,    0,
      131,    0,  130,    0,  131,    0,  132,  132,  132,    0,
        0,  135,  132,  135,    0,  131,  132,  135,  134,  134,
      134,    0,    0,  136,  134,  136,    0,  130,  134,  136,
        0,  137,  137,  137,    0,  132,  135,  137,  135,    0,
      131,  137,  135,  138,    0,  138,    0,    0,  136,  138,
      136,  139,  139,  139,  136,    0,    0,  139,    0,  132,
        0,  139,    0,  137,    0,  140,  140,  140,  138,    0,
      138,  140,    0,    0,  138,  140,  141,  141,  141,    0,

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

        0,  152,  154,  154,  154,  153,    0,  148,  154,  153,
        0,  155,  154,  156,  155,    0,  156,  154,    0,  155,
        0,  156,  157,  153,  157,    0,    0,    0,  157,  153,
        0,  159,    0,  153,  159,  155,    0,  156,  155,  159,
      156,    0,  154,  155,    0,  156,    0,  157,    0,  157,
      158,  158,  158,  157,    0,  159,  158,  161,  159,  160,
      158,  160,    0,  159,  161,  160,  163,    0,  161,  162,
        0,  162,    0,  163,  164,  162,    0,  163,    0,    0,
        0,  164,  161,    0,  160,  164,  160,    0,  161,  158,
      160,  163,  161,    0,  162,  165,  162,  163,  165,  164,

      162,  163,    0,  165,    0,  164,    0,    0,    0,  164,
      170,  170,  170,  170,  172,  172,  172,    0,    0,  165,
      172,    0,  165,    0,  172,    0,    0,  165,  176,  176,
      176,  176,    0,    0,  176,  177,  177,  177,  176,  181,
      182,  177,  178,  178,  178,  177,  181,  182,  178,    0,
      181,  182,  178,  180,  180,  180,  180,  183,    0,  183,
        0,    0,  190,  183,  181,  182,  184,  184,  184,  190,
      181,  182,  184,  190,  181,  182,  184,  185,    0,  185,
        0,    0,  183,  185,  183,    0,  186,  190,  183,  186,
      187,  187,  187,  190,  186,    0,  187,  190,  184,    0,

      187,    0,  185,    0,  185,    0,    0,    0,  185,    0,
      186,  187,    0,  186,  188,  188,  188,    0,  186,    0,
      188,    0,  184,  189,  188,    0,  189,    0,    0,  188,
        0,  189,  191,  191,  191,  192,  187,  192,  191,    0,
        0,  192,  191,    0,    0,  193,    0,  189,    0,    0,
      189,    0,  193,    0,  188,  189,  193,  194,  194,  194,
      192,  195,  192,  194,  195,    0,  192,  194,    0,  195,
      193,  196,  196,  196,    0,    0,  193,  196,    0,    0,
      193,  196,    0,    0,    0,  195,  194,    0,  195,  197,
      197,  197,    0,  195,    0,  197,  198,  198,  198,  197,

        0,    0,  198,  199,  199,  199,  198,    0,    0,  199,
      194,  197,    0,  199,  200,  200,  200,  201,  201,  201,
      200,    0,    0,  201,  200,    0,    0,  201,  202,  202,
      202,  203,  203,  203,  202,    0,  197,  203,  202,    0,
      205,  203,  205,    0,  200,    0,  205,  206,  206,  206,
      207,  207,  207,  206,    0,  208,  207,  206,  208,    0,
      207,    0,    0,  208,  209,  205,  209,  205,  200,  211,
      209,  205,  211,    0,  210,  210,  210,  211,    0,  208,
      210,    0,  208,    0,  210,    0,  214,  208,  214,  209,
        0,  209,  214,  211,    0,  209,  211,  212,  212,  212,

      210,  211,    0,  212,  213,  213,  213,  212,    0,    0,
      213,  214,  215,  214,  213,  215,  216,  214,  216,    0,
      215,    0,  216,    0,  210,    0,    0,  212,  230,  230,
      230,  230,    0,    0,  213,    0,  215,    0,    0,  215,
      219,  216,  219,  216,  215,    0,  219,  216,    0,    0,
      221,  212,  221,  217,  217,  217,  221,    0,  213,  217,
      218,  218,  218,  217,    0,  219,  218,  219,    0,    0,
      218,  219,  220,  220,  220,  221,    0,  221,  220,    0,
        0,  221,  220,  226,  226,  226,  226,    0,    0,  226,
      227,  227,  227,  226,    0,    0,  227,  228,  228,  228,

      227,    0,    0,  228,    0,    0,    0,  228,  235,  235,
      235,  235,  238,  238,  238,  239,  239,  239,  238,    0,
        0,  239,  238,    0,    0,  239,  240,  240,  240,  241,
      241,  241,  240,    0,    0,  241,  240,    0,    0,  241,
      242,    0,    0,    0,  241,    0,    0,  242,  243,  243,
      243,  242,    0,    0,  243,    0,    0,    0,  243,    0,
      244,  244,  244,    0,  246,  242,  244,  246,    0,  241,
      244,  242,  246,    0,  247,  242,    0,  247,  243,  245,
      245,  245,  247,  248,    0,  245,    0,    0,  246,  245,
      248,  246,    0,    0,  248,    0,  246,    0,  247,    0,

        0,  247,  243,    0,    0,    0,  247,    0,  248,  245,
      249,  249,  249,    0,  248,    0,  249,    0,  248,    0,
      249,  250,  250,  250,  251,  251,  251,  250,    0,    0,
      251,  250,    0,  245,  251,  252,  252,  252,  253,  253,
      253,  252,    0,  260,  253,  252,    0,    0,  253,    0,
      260,    0,    0,  250,  260,    0,  251,  255,  258,  255,
      258,    0,    0,  255,  258,  256,  256,  256,  260,    0,
      253,  256,    0,    0,  260,  256,    0,  250,  260,    0,
      251,    0,  255,  258,  255,  258,    0,    0,  255,  258,
      257,  257,  257,    0,  253,  256,  257,  259,  259,  259,

      257,  261,    0,  259,    0,    0,  262,  259,  261,  262,
      263,    0,  261,  263,  262,  264,  264,  264,  263,  256,
      265,  264,  312,  312,  312,  264,  261,  265,  312,  259,
      262,  265,  261,  262,  263,    0,  261,  263,  262,    0,
        0,    0,  263,    0,    0,  265,    0,  264,  266,  266,
      266,  265,    0,  259,  266,  265,    0,    0,  266,  272,
      272,  272,  272,  280,  280,  280,  280,  284,    0,  280,
        0,  264,  285,    0,  284,  285,    0,    0,  284,    0,
      285,  286,  286,  286,  287,    0,  287,  286,    0,    0,
      287,  286,  284,    0,  289,    0,  285,    0,  284,  285,

        0,  289,  284,    0,  285,  289,  288,  288,  288,  287,
        0,  287,  288,    0,    0,  287,  288,    0,    0,  289,
      290,  290,  290,    0,    0,  289,  290,    0,    0,  289,
      290,    0,    0,  291,  292,  291,  292,    0,  288,  291,
      292,  293,  293,  293,  295,  295,  295,  293,    0,    0,
      295,  293,    0,    0,  295,    0,    0,    0,  291,  292,
      291,  292,  288,    0,  291,  292,  296,  296,  296,  297,
      297,  297,  296,    0,    0,  297,  296,    0,    0,  297,
      298,  298,  298,  299,  299,  299,  298,    0,    0,  299,
      298,  301,  296,  299,  301,  300,    0,  300,    0,  301,

        0,  300,  302,  302,  302,  313,  313,  313,  302,    0,
        0,  313,  302,    0,    0,  301,  296,    0,  301,  298,
      300,    0,  300,  301,    0,    0,  300,  303,  303,  303,
      304,  304,  304,  303,    0,    0,  304,  303,    0,    0,
      304,  311,  311,  311,  311,    0,    0,  311,  319,  319,
      319,  304,    0,    0,  319,    0,    0,  320,  319,  320,
      321,  321,  321,  320,    0,    0,  321,  322,  322,  322,
      321,    0,    0,  322,    0,  324,  304,  322,  324,    0,
      319,    0,  320,  324,  320,  323,  323,  323,  320,    0,
        0,  323,    0,    0,    0,  323,    0,    0,    0,  324,

        0,    0,  324,  328,  319,    0,  328,  324,  325,  325,
      325,  328,    0,    0,  325,    0,    0,  323,  325,  327,
      327,  327,  329,  329,  329,  327,  330,  328,  329,  327,
      328,    0,  329,  330,    0,  328,    0,  330,  331,  331,
      331,  323,    0,  343,  331,  343,    0,    0,  331,  343,
        0,  330,  341,  341,  341,    0,    0,  330,  341,    0,
      344,  330,  341,  342,  342,  342,    0,  344,  343,  342,
      343,  344,    0,  342,  343,  346,    0,  346,  347,  347,
      347,  346,    0,    0,  347,  344,    0,  355,  347,  355,
        0,  344,    0,  355,    0,  344,    0,  356,  356,  356,

      346,    0,  346,  356,    0,    0,  346,  356,    0,    0,
      347,    0,  355,    0,  355,  358,  358,  358,  355,  365,
        0,  358,  359,  359,  359,  358,  365,    0,  359,    0,
      365,    0,  359,  358,  347,  366,  366,  366,    0,    0,
        0,  366,    0,    0,  365,  366,  370,  370,  370,    0,
      365,    0,  370,    0,  365,    0,  370,    0,  358,  373,
      373,  373,  373,  373,  373,  373,  373,  373,  373,  373,
      374,  374,  374,  374,  374,  374,  374,  374,  374,  374,
      374,  375,  375,  375,  375,  375,  375,  375,  375,  375,
      375,  375,  376,  376,  376,  376,  376,  376,  376,  376,

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

      387,  387,  388,  388,  388,  388,    0,    0,    0,    0,
        0,  388,  389,  389,  389,  389,  389,  389,  389,  389,
      389,  389,  389,  390,  390,  390,    0,  390,  390,    0,
      390,  390,  390,  391,  391,  391,  391,  391,  391,  391,
      391,  391,  391,  391,  392,  392,  392,    0,  392,  392,
        0,  392,  392,  392,  393,  393,  393,  393,    0,    0,
        0,    0,    0,  393,  394,  394,  394,  394,    0,    0,
        0,    0,    0,  394,  395,  395,  395,  395,  395,  395,
      395,  395,  395,  395,  395,  396,  396,  396,    0,  396,
      396,    0,    0,  396,  396,  397,  397,  397,  397,  397,

      397,  397,  397,  397,  397,  397,  398,  398,  398,    0,
      398,  398,    0,    0,  398,  398,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372,
      372,  372,  372,  372,  372,  372,  372,  372,  372,  372
    } ;

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-2008, 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.60 2008/01/01 19:46:00 momjian 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 1205 "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
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#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 do { if (fwrite( plpgsql_base_yytext, plpgsql_base_yyleng, 1, plpgsql_base_yyout )) {} } while (0)
#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 = '*'; \
		size_t 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 1428 "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 >= 373 )
					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 != 372 );
		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_MOVE;			}
	YY_BREAK
case 35:
/* rule 35 can match eol */
YY_RULE_SETUP
#line 146 "scan.l"
{ return K_NOSCROLL;		}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 147 "scan.l"
{ return K_NOT;				}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 148 "scan.l"
{ return K_NOTICE;			}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 149 "scan.l"
{ return K_NULL;			}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 150 "scan.l"
{ return K_OPEN;			}
	YY_BREAK
case 40:
YY_RULE_SETUP
#line 151 "scan.l"
{ return K_OR;				}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 152 "scan.l"
{ return K_PERFORM;			}
	YY_BREAK
case 42:
YY_RULE_SETUP
#line 153 "scan.l"
{ return K_RAISE;			}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 154 "scan.l"
{ return K_RENAME;			}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 155 "scan.l"
{ return K_RESULT_OID;		}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 156 "scan.l"
{ return K_RETURN;			}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 157 "scan.l"
{ return K_REVERSE;			}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 158 "scan.l"
{ return K_ROW_COUNT;		}
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 159 "scan.l"
{ return K_SCROLL;			}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 160 "scan.l"
{ return K_STRICT;	    	}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 161 "scan.l"
{ return K_THEN;			}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 162 "scan.l"
{ return K_TO;				}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 163 "scan.l"
{ return K_TYPE;			}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 164 "scan.l"
{ return K_WARNING;			}
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 165 "scan.l"
{ return K_WHEN;			}
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 166 "scan.l"
{ return K_WHILE;			}
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 168 "scan.l"
{ return O_OPTION;			}
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 169 "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 58:
/* rule 58 can match eol */
YY_RULE_SETUP
#line 179 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 59:
/* rule 59 can match eol */
YY_RULE_SETUP
#line 182 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
#line 185 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
#line 188 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 62:
/* rule 62 can match eol */
YY_RULE_SETUP
#line 191 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 63:
/* rule 63 can match eol */
YY_RULE_SETUP
#line 194 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 64:
/* rule 64 can match eol */
YY_RULE_SETUP
#line 197 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 65:
/* rule 65 can match eol */
YY_RULE_SETUP
#line 200 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 203 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(plpgsql_base_yytext); }
	YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
#line 206 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(plpgsql_base_yytext); }
	YY_BREAK
case 68:
/* rule 68 can match eol */
YY_RULE_SETUP
#line 209 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(plpgsql_base_yytext); }
	YY_BREAK
case 69:
/* rule 69 can match eol */
YY_RULE_SETUP
#line 212 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(plpgsql_base_yytext); }
	YY_BREAK
case 70:
/* rule 70 can match eol */
YY_RULE_SETUP
#line 215 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
#line 218 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(plpgsql_base_yytext); }
	YY_BREAK
case 72:
/* rule 72 can match eol */
YY_RULE_SETUP
#line 221 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 73:
/* rule 73 can match eol */
YY_RULE_SETUP
#line 224 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(plpgsql_base_yytext); }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 228 "scan.l"
{ return T_NUMBER;			}
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 230 "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 76:
/* rule 76 can match eol */
YY_RULE_SETUP
#line 241 "scan.l"
{ plpgsql_SpaceScanned = true;		}
	YY_BREAK
/* ----------
     * Eat up comments
     * ----------
     */
case 77:
YY_RULE_SETUP
#line 247 "scan.l"
;
	YY_BREAK
case 78:
YY_RULE_SETUP
#line 249 "scan.l"
{ start_lineno = plpgsql_scanner_lineno();
			  BEGIN(IN_COMMENT);
			}
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 252 "scan.l"
{ BEGIN(INITIAL); plpgsql_SpaceScanned = true; }
	YY_BREAK
case 80:
/* rule 80 can match eol */
YY_RULE_SETUP
#line 253 "scan.l"
;
	YY_BREAK
case 81:
YY_RULE_SETUP
#line 254 "scan.l"
;
	YY_BREAK
case YY_STATE_EOF(IN_COMMENT):
#line 255 "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 82:
YY_RULE_SETUP
#line 270 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  BEGIN(IN_STRING);
			}
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 275 "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 84:
YY_RULE_SETUP
#line 281 "scan.l"
{ }
	YY_BREAK
case 85:
YY_RULE_SETUP
#line 282 "scan.l"
{ /* can only happen with \ at EOF */ }
	YY_BREAK
case 86:
YY_RULE_SETUP
#line 283 "scan.l"
{ }
	YY_BREAK
case 87:
YY_RULE_SETUP
#line 284 "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 88:
/* rule 88 can match eol */
YY_RULE_SETUP
#line 293 "scan.l"
{ }
	YY_BREAK
case YY_STATE_EOF(IN_STRING):
#line 294 "scan.l"
{
				plpgsql_error_lineno = start_lineno;
				ereport(ERROR,
						(errcode(ERRCODE_DATATYPE_MISMATCH),
						 errmsg("unterminated string")));
			}
	YY_BREAK
case 89:
YY_RULE_SETUP
#line 301 "scan.l"
{
			  start_lineno = plpgsql_scanner_lineno();
			  start_charpos = plpgsql_base_yytext;
			  dolqstart = pstrdup(plpgsql_base_yytext);
			  BEGIN(IN_DOLLARQUOTE);
			}
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 307 "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 91:
/* rule 91 can match eol */
YY_RULE_SETUP
#line 329 "scan.l"
{ }
	YY_BREAK
case 92:
YY_RULE_SETUP
#line 330 "scan.l"
{ /* needed for $ inside the quoted text */ }
	YY_BREAK
case YY_STATE_EOF(IN_DOLLARQUOTE):
#line 331 "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 93:
YY_RULE_SETUP
#line 342 "scan.l"
{ return plpgsql_base_yytext[0];			}
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 344 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 2134 "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 >= 373 )
				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 >= 373 )
			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 == 372);

	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 yybytes the byte buffer to scan
 * @param _yybytes_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 344 "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;
}

