#define yy_create_buffer plpgsql_base_yy_create_buffer
#define yy_delete_buffer plpgsql_base_yy_delete_buffer
#define yy_scan_buffer plpgsql_base_yy_scan_buffer
#define yy_scan_string plpgsql_base_yy_scan_string
#define yy_scan_bytes plpgsql_base_yy_scan_bytes
#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 yyout plpgsql_base_yyout
#define yyrestart plpgsql_base_yyrestart
#define yytext plpgsql_base_yytext

#line 19 "pl_scan.c"
/* A lexical scanner generated by flex */

/* Scanner skeleton version:
 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
 */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>
#include <unistd.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

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

#else	/* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif	/* __STDC__ */
#endif	/* ! __cplusplus */

#ifdef __TURBOC__
 #pragma warn -rch
 #pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

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


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#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 yyrestart( yyin )

#define YY_END_OF_BUFFER_CHAR 0

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

typedef struct yy_buffer_state *YY_BUFFER_STATE;

extern int yyleng;
extern FILE *yyin, *yyout;

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

/* The funky do-while in the following #define is used to turn the definition
 * int a single C statement (which needs a semi-colon terminator).  This
 * avoids problems with code like:
 *
 * 	if ( condition_holds )
 *		yyless( 5 );
 *	else
 *		do_something_else();
 *
 * Prior to using the do-while the compiler would get upset at the
 * "else" because it interpreted the "if" statement as being all
 * done when it reached the ';' after the yyless() call.
 */

/* Return all but the first 'n' matched characters back to the input stream. */

#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
		*yy_cp = yy_hold_char; \
		YY_RESTORE_YY_MORE_OFFSET \
		yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

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

/* The following is because we cannot portably get our hands on size_t
 * (without autoconf's help, which isn't available because we want
 * flex-generated scanners to compile on their own).
 */
typedef unsigned int yy_size_t;


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;

	/* 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 yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2
	};

static YY_BUFFER_STATE yy_current_buffer = 0;

/* 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".
 */
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;

static int yy_n_chars;		/* number of characters read into yy_ch_buf */


int yyleng;

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

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

void yyrestart YY_PROTO(( FILE *input_file ));

void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_is_interactive = is_interactive; \
	}

#define yy_set_bol(at_bol) \
	{ \
	if ( ! yy_current_buffer ) \
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
	yy_current_buffer->yy_at_bol = at_bol; \
	}

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)


#define yywrap() 1
#define YY_SKIP_YYWRAP
typedef unsigned char YY_CHAR;
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext

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

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	yytext_ptr = yy_bp; \
	yyleng = (int) (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
static yyconst short int 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 int 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,   19,   20,   21,   22,   23,   24,
       25,   26,   27,   28,   28,   29,   30,   31,   32,   33,
       28,   34,   35,   36,   37,   38,   39,   40,   41,   28,
        1,   17,    1,    1,   18,    1,   19,   20,   21,   22,

       23,   24,   25,   26,   27,   28,   28,   29,   30,   31,
       32,   33,   28,   34,   35,   36,   37,   38,   39,   40,
       41,   28,    1,    1,    1,    1,    1,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,

       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28,   28,   28,   28,   28,   28,
       28,   28,   28,   28,   28
    } ;

static yyconst int yy_meta[42] =
    {   0,
        1,    2,    3,    4,    5,    1,    6,    7,    8,    1,
        1,    9,    1,   10,    1,    1,    8,   11,   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 short int yy_base[399] =
    {   0,
        0,  993,   33,   34,   42,   43,   41,   51,  998, 1137,
       53,   57,   44,   55, 1137,  982,  980,  981,  963,  960,
     1137,   62,   69,   97,   53,   52,   83,   63,   55,   84,
       90,   94,   95,  106,   61,  111,  121,  122,  127,  943,
        0,  965,    0, 1137, 1137,  954,    0,    0,  946,  156,
      942,  931,  162, 1137,  169,  926,    0, 1137, 1137,  913,
     1137,  176,   80,  115,  187,  114,  162,   87,  163,  170,
      171,  176,  179,  183, 1137,  184,  186,  195,  187,  192,
      198,  206,  191,  214,  211,  221,  218,  261,  225,  217,
      220,  234,  244,  251,  237,  247,  249,  228,  250,  270,

      271,  272,  893,    0, 1137, 1137, 1137,    0, 1137,  918,
      312,  870,  319,  243,  304,  867,    0,  838,  828,  330,
      861,  334,  277,  302,  316,  317,  321,  318,  325,  326,
      338,  327,  342,  257,  278,  349,  341,  350,  287,  351,
      352,  353,  355,  357,  361,  364,  363,  404,  372,  380,
      387,  391,  388,  401,  394,  396,  399,  407,  404,  411,
      418,  403,  420,  423,  424,  828,  822,  792,  752,  453,
      786,  464,  751,  756,  781,  475,  482,  489,  426,  500,
      440,  465,  448,  459,  484,  476,  487,  490,  492,  491,
      475,  496,  497,  501,  503,  495,  504,  512,  516,  518,

      520,  523,  524,  745,  527,  526,  528,  531,  532,  547,
      533,  537,  552,  558,  553,  562,  543,  557,  564,  566,
      567,  693,  680,  685,  711,  607,  614,  621,  561,  632,
      678,  686,  674,  664,  636,  699,  598,  573,  590,  604,
      609,  620,  619,  607,  621,  623,  624,  634,  626,  636,
      640,  643,  646,  646,  645,  651,  647,  648,  655,  667,
      660,  670,  671,  674,  676,  680,  647,  637,  631,  589,
      579,  720,  599,  724,  551, 1137,  519,  441,  468,  731,
      738,  741,  434,  706,  715,  690,  707,  727,  730,  728,
      731,  732,  734,  437,  736,  737,  738,  758,  739,  741,

      747,  751,  760,  762,  419,  360, 1137,  361,  355,  342,
      792,  802,  805,  294,  293,  268,  222,  194,  775,  779,
      789,  791,  792,  794,  795,  202,  796,  799,  798,  811,
      800, 1137,  149,  140,  152,  128,  138,  115, 1137,  100,
      802,  804,  821,  815,   87,  824,  827,   88,   50, 1137,
       55, 1137,   54,   60,  832,  826, 1137,  835,  831, 1137,
       47,   45,   44, 1137,  836,  837,   40, 1137, 1137,  838,
     1137, 1137,  879,  890,  901,  912,  918,  928,  939,  950,
      961,  967,  978,  984,  995, 1005, 1011, 1021, 1032, 1042,
     1053, 1063, 1073, 1083, 1094, 1104, 1115, 1125

    } ;

static yyconst short int 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,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,  372,
      379,  372,  380,  372,  372,  372,  381,  381,  382,  372,
      383,  383,  372,  372,  372,  384,  385,  372,  372,  372,
      372,  372,   24,  372,  386,   24,   24,   24,   24,   24,
       24,   24,   24,   24,  372,   24,   24,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,

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

       24,   24,   24,  372,   24,   24,   24,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
       24,  372,  372,  372,  391,  372,  372,  392,  372,  394,
      372,  372,  372,  372,  393,  395,  396,   24,   24,   24,
       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
       24,   24,   24,  372,   24,   24,   24,   24,   24,   24,
       24,   24,   24,   24,   24,   24,  372,  372,  372,  372,
      372,  394,  397,  398,  372,  372,  372,  372,  395,  372,
      372,  396,  372,   24,   24,   24,   24,   24,   24,   24,
       24,   24,   24,  372,   24,   24,   24,   24,   24,   24,

       24,   24,   24,   24,  372,  372,  372,  372,  372,  397,
      372,  372,  398,  372,  372,  372,  372,  372,   24,   24,
       24,   24,   24,   24,   24,  372,   24,   24,   24,   24,
       24,  372,  372,  372,  372,  372,  372,  372,  372,  372,
       24,   24,   24,   24,  372,   24,   24,  372,  372,  372,
      372,  372,  372,  372,   24,   24,  372,   24,   24,  372,
      372,  372,  372,  372,   24,   24,  372,  372,  372,   24,
      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 short int yy_nxt[1179] =
    {   0,
       10,   11,   12,   11,   13,   10,   14,   10,   15,   10,
       16,   17,   18,   19,   20,   21,   10,   22,   23,   24,
       25,   26,   27,   28,   29,   22,   30,   22,   31,   32,
       33,   34,   35,   36,   37,   38,   22,   22,   39,   22,
       22,   42,   42,   48,   45,   45,   52,   49,   53,   43,
       43,   46,   46,   48,   50,   50,   50,   49,   50,   50,
       50,   54,  371,   62,   62,   62,  369,  368,   55,   64,
       62,   62,   62,   65,   72,   63,   64,   82,   73,  367,
       65,   69,  364,   92,   70,   79,  363,  362,   74,   71,
      361,   75,   63,   63,   80,   63,   81,   66,   62,   62,

       62,   63,   63,   63,   64,   63,   63,   83,   65,   63,
      360,   76,   63,   77,   84,  357,   63,   63,   85,   67,
       63,   86,   78,   63,   63,   87,   88,   63,   63,   93,
       63,   89,  354,   94,   63,   63,   63,   68,   90,   91,
      123,   96,   95,   63,   63,  101,   63,   98,  118,   63,
      119,   63,  102,   99,   63,  353,   97,   50,   50,   50,
      352,   63,  100,   62,   62,   62,  112,   63,  351,   64,
      113,  113,  113,   65,  350,  349,  114,   62,   62,   62,
      115,  348,   55,   64,   63,   63,  124,   65,  120,  120,
      120,  121,   63,   63,  125,  128,  129,  131,   63,  130,

      126,   63,   63,   63,  127,   63,   63,  134,   63,   63,
       63,   63,  132,   63,   63,  135,   63,  136,  133,   63,
       63,  137,  138,   63,   63,  139,   63,   63,   63,  140,
      345,   63,   63,   63,  340,   63,   63,  142,   63,  151,
       63,  141,   63,   63,  339,  145,   63,   63,  143,  144,
      161,   63,  146,  150,   63,  147,   63,   63,   63,   63,
       63,   63,  148,  148,  148,   63,   63,  152,   63,   63,
      153,   63,   63,   63,   63,  158,  168,   63,  169,   63,
      159,  154,  160,   63,   63,  155,  156,   63,  157,   63,
       63,   63,   63,   63,  164,  181,  149,   63,  165,   63,

      194,   63,  162,  338,  163,  170,  170,  170,  171,   63,
       63,   63,   63,   62,   62,   62,  112,   63,   63,   64,
      113,  113,  113,   65,   63,  337,  114,   63,  182,  336,
      115,  120,  120,  120,  121,  177,  177,  177,   63,   63,
       63,  179,   63,   63,  189,  180,  311,   63,   63,   63,
      183,  184,  185,  188,  187,  186,   63,   63,   63,  191,
       63,   63,  190,   63,  192,   63,   63,   63,  193,  195,
      197,   63,   63,   63,   63,   63,  196,  200,   63,   63,
      198,   63,   63,   63,  199,  203,   63,  335,  201,   63,
       63,   63,   63,   63,   63,   63,  202,   63,  205,  334,

      333,   63,   63,   63,   63,  148,  148,  148,  206,   63,
       63,   64,   63,   63,  208,   65,   63,  207,   63,  210,
       63,  213,  209,   63,  214,  218,   63,   63,   63,   63,
      211,   63,  212,   63,   63,  215,   63,  216,  204,   63,
       63,   63,   63,   63,   63,   63,   63,   63,  217,  332,
      219,   63,  221,  220,  170,  170,  170,  171,   63,  233,
       63,  234,   63,   63,   63,  227,  227,  227,  326,  318,
      240,  229,  280,  317,  238,  230,  177,  177,  177,  121,
       63,   63,  179,  177,  177,  177,  180,   63,   63,  179,
      177,  177,  177,  180,  241,  239,  179,   63,   63,   63,

      180,  235,  235,  235,  236,   63,   63,  243,  245,   63,
      242,  244,   63,   63,   63,   63,   63,   63,   63,   63,
      249,  247,  248,   63,   63,   63,   63,   63,  246,  252,
       63,   63,   63,  250,   63,   63,   63,   63,   63,  251,
       63,   63,   63,   63,   63,   63,   63,  255,   63,   63,
       63,  253,   63,   63,  257,   63,   63,  316,   63,   63,
       63,  259,  256,   63,   63,   63,   63,   63,   63,   63,
      260,   63,   63,   63,   63,   63,  258,   63,  262,   63,
       63,  263,  264,   63,   63,  261,   63,   63,   63,  266,
      265,  315,   63,   63,  270,   63,  271,   63,   63,  281,

      281,  281,   63,  311,   63,  283,   63,   63,  227,  227,
      227,  171,   63,   63,  229,  227,  227,  227,  230,  309,
      308,  229,  227,  227,  227,  230,   63,  284,  229,   63,
       63,   63,  230,  272,  272,  272,  273,  235,  235,  235,
      236,   63,   63,   63,   63,   63,   63,   63,   63,   63,
      285,  288,  286,  307,  287,  289,   63,  290,   63,   63,
       63,   63,   63,   63,   63,   63,   63,  295,   63,   63,
      297,  291,  306,   63,   63,  292,   63,   63,  305,  294,
       63,  293,   63,   63,  296,   63,   63,   63,   63,   63,
      298,   63,   63,   63,  300,   63,   63,  299,   63,  302,

       63,  301,   63,  280,  278,  277,  304,   63,  276,  303,
       63,   63,   63,  275,   63,  226,   63,  269,  268,  267,
       63,  272,  272,  272,  273,  312,  312,  312,   63,  321,
       63,  314,  281,  281,  281,  236,  319,   63,  283,  281,
      281,  281,  281,  281,  281,  283,   63,   63,  283,   63,
       63,  320,   63,   63,  325,   63,   63,  324,   63,   63,
       63,   63,  322,  329,  323,  254,  327,   63,   63,   63,
       63,   63,   63,   63,   63,  328,   63,   63,   63,   63,
       63,   63,   63,  330,   63,  176,  331,   63,  232,  231,
      226,   63,  224,  312,  312,  312,  273,   63,   63,  314,

       63,  342,   63,  312,  312,  312,  312,  312,  312,  314,
      341,   63,  314,   63,   63,   63,   63,   63,   63,   63,
       63,   63,   63,  223,   63,  344,   63,  343,  109,   63,
      346,   63,   63,   63,   63,   63,   63,   63,   63,   63,
       63,  347,   63,   63,   63,  356,   63,  355,   63,   63,
      358,   63,  365,   63,   63,   63,  366,   63,   63,   63,
       63,   63,  359,  222,   63,  176,   63,   63,  174,  173,
      370,   63,   63,   54,  111,   63,   63,   63,   63,   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,  109,  166,   60,   56,   56,   63,
       63,   63,   54,   63,   63,  111,   63,   63,   63,  104,
      104,  104,  104,  104,  104,  104,  111,  104,  104,  104,
      106,  106,  109,  106,  106,  106,  106,  106,  106,  106,
      106,  108,  108,  108,  108,  108,  107,  108,  108,  108,
      108,  108,  110,  105,  103,   61,   60,  110,   52,   52,
       52,   52,   52,   52,   52,   52,   52,   52,   52,  116,
       59,   58,   57,  116,  116,  117,  117,  372,   40,  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
    } ;

static yyconst short int yy_chk[1179] =
    {   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,    3,    4,    7,    5,    6,   13,    7,   13,    3,
        4,    5,    6,    8,   11,   11,   11,    8,   12,   12,
       12,   14,  367,   22,   22,   22,  363,  362,   14,   22,
       23,   23,   23,   22,   26,   25,   23,   29,   26,  361,
       23,   25,  354,   35,   25,   28,  353,  351,   26,   25,
      349,   27,   26,   25,   28,   29,   28,   23,   24,   24,

       24,   35,   63,   28,   24,   27,   30,   30,   24,   68,
      348,   27,   31,   27,   30,  345,   32,   33,   30,   24,
       63,   31,   27,   27,   30,   32,   33,   68,   34,   36,
       31,   33,  340,   36,   32,   33,   66,   24,   34,   34,
       66,   37,   36,   37,   38,   39,   34,   38,   64,   39,
       64,   36,   39,   38,   66,  338,   37,   50,   50,   50,
      337,   37,   38,   53,   53,   53,   53,   39,  336,   53,
       55,   55,   55,   53,  335,  334,   55,   62,   62,   62,
       55,  333,   55,   62,   67,   69,   67,   62,   65,   65,
       65,   65,   70,   71,   69,   72,   72,   73,   72,   72,

       70,   73,   67,   69,   71,   74,   76,   77,   77,   79,
       70,   71,   74,   83,   80,   78,   72,   78,   76,   73,
       81,   78,   79,   74,   76,   80,   77,   79,   82,   81,
      326,   83,   80,   85,  318,   78,   84,   84,   81,   90,
       87,   82,   91,   86,  317,   86,   82,   89,   84,   84,
       98,   85,   86,   89,   84,   87,   92,   90,   87,   95,
       91,   86,   88,   88,   88,   89,   93,   92,   98,   96,
       93,   97,   99,   94,   92,   95,  114,   95,  114,  134,
       96,   94,   97,   88,   93,   94,   94,   96,   94,   97,
       99,   94,  100,  101,  102,  123,   88,  134,  102,  123,

      135,   88,  100,  316,  101,  115,  115,  115,  115,  139,
      100,  101,  102,  111,  111,  111,  111,  123,  135,  111,
      113,  113,  113,  111,  124,  315,  113,  139,  124,  314,
      113,  120,  120,  120,  120,  122,  122,  122,  125,  126,
      128,  122,  124,  127,  130,  122,  310,  129,  130,  132,
      125,  126,  126,  129,  128,  127,  125,  126,  128,  132,
      131,  127,  131,  137,  133,  129,  130,  132,  133,  136,
      138,  136,  138,  140,  141,  142,  137,  143,  131,  144,
      140,  137,  133,  145,  142,  147,  146,  309,  144,  136,
      138,  140,  141,  142,  149,  143,  146,  144,  149,  308,

      306,  145,  150,  147,  146,  148,  148,  148,  150,  151,
      153,  148,  149,  152,  152,  148,  155,  151,  156,  154,
      150,  157,  153,  154,  158,  162,  159,  151,  153,  158,
      155,  152,  156,  160,  155,  159,  156,  160,  148,  157,
      161,  154,  163,  162,  159,  164,  165,  158,  161,  305,
      163,  160,  165,  164,  170,  170,  170,  170,  161,  179,
      163,  179,  181,  164,  165,  172,  172,  172,  294,  283,
      183,  172,  279,  278,  181,  172,  176,  176,  176,  176,
      181,  184,  176,  177,  177,  177,  176,  182,  183,  177,
      178,  178,  178,  177,  184,  182,  178,  191,  186,  184,

      178,  180,  180,  180,  180,  182,  185,  186,  188,  187,
      185,  187,  188,  190,  189,  191,  186,  196,  192,  193,
      193,  190,  192,  194,  185,  195,  197,  187,  189,  197,
      188,  190,  189,  194,  198,  196,  192,  193,  199,  195,
      200,  194,  201,  195,  197,  202,  203,  205,  206,  205,
      207,  200,  198,  208,  209,  211,  199,  277,  200,  212,
      201,  211,  208,  202,  203,  217,  206,  205,  207,  210,
      212,  208,  209,  211,  213,  215,  210,  212,  214,  218,
      214,  215,  216,  217,  216,  213,  219,  210,  220,  221,
      219,  275,  213,  215,  229,  238,  229,  218,  214,  237,

      237,  237,  216,  273,  219,  237,  220,  221,  226,  226,
      226,  226,  239,  238,  226,  227,  227,  227,  226,  271,
      270,  227,  228,  228,  228,  227,  240,  241,  228,  244,
      239,  241,  228,  230,  230,  230,  230,  235,  235,  235,
      235,  243,  242,  245,  240,  246,  247,  244,  249,  241,
      242,  246,  243,  269,  245,  247,  248,  248,  250,  243,
      242,  245,  251,  246,  247,  252,  249,  255,  253,  257,
      258,  250,  268,  256,  248,  251,  250,  259,  267,  254,
      251,  253,  261,  252,  256,  255,  253,  257,  258,  260,
      259,  256,  262,  263,  261,  259,  264,  260,  265,  263,

      261,  262,  266,  236,  234,  233,  265,  260,  232,  264,
      262,  263,  286,  231,  264,  225,  265,  224,  223,  222,
      266,  272,  272,  272,  272,  274,  274,  274,  284,  287,
      286,  274,  280,  280,  280,  280,  284,  285,  280,  281,
      281,  281,  282,  282,  282,  281,  284,  287,  282,  288,
      290,  285,  289,  291,  292,  285,  293,  291,  295,  296,
      297,  299,  288,  300,  289,  204,  296,  288,  290,  301,
      289,  291,  292,  302,  293,  298,  295,  296,  297,  299,
      298,  300,  303,  301,  304,  175,  304,  301,  174,  173,
      171,  302,  169,  311,  311,  311,  311,  319,  298,  311,

      303,  320,  304,  312,  312,  312,  313,  313,  313,  312,
      319,  321,  313,  322,  323,  319,  324,  325,  327,  320,
      329,  328,  331,  168,  341,  324,  342,  323,  167,  321,
      328,  322,  323,  330,  324,  325,  327,  344,  329,  328,
      331,  330,  341,  343,  342,  344,  346,  343,  356,  347,
      346,  330,  355,  359,  355,  344,  358,  358,  365,  366,
      370,  343,  347,  166,  346,  121,  356,  347,  119,  118,
      365,  359,  355,  116,  112,  358,  365,  366,  370,  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,  110,  103,   60,  377,  377,  378,
      378,  378,   56,  378,  378,   52,  378,  378,  378,  379,
      379,  379,  379,  379,  379,  379,   51,  379,  379,  379,
      380,  380,   49,  380,  380,  380,  380,  380,  380,  380,
      380,  381,  381,  381,  381,  381,   46,  381,  381,  381,
      381,  381,  382,   42,   40,   20,   19,  382,  383,  383,
      383,  383,  383,  383,  383,  383,  383,  383,  383,  384,
       18,   17,   16,  384,  384,  385,  385,    9,    2,  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
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

/* 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 *yytext;
#line 1 "scan.l"
#define INITIAL 0
#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;
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_UNPUT 1
#define IN_STRING 1

#define IN_COMMENT 2

#define IN_DOLLARQUOTE 3

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

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

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

#ifndef YY_NO_UNPUT
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
#endif

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

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

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

#if YY_STACK_USED
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
#ifndef YY_NO_PUSH_STATE
static void yy_push_state YY_PROTO(( int new_state ));
#endif
#ifndef YY_NO_POP_STATE
static void yy_pop_state YY_PROTO(( void ));
#endif
#ifndef YY_NO_TOP_STATE
static int yy_top_state YY_PROTO(( void ));
#endif

#else
#define YY_NO_PUSH_STATE 1
#define YY_NO_POP_STATE 1
#define YY_NO_TOP_STATE 1
#endif

#ifdef YY_MALLOC_DECL
YY_MALLOC_DECL
#else
#if __STDC__
#ifndef __cplusplus
#include <stdlib.h>
#endif
#else
/* Just try to get by without declaring the routines.  This will fail
 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
 * or sizeof(void*) != sizeof(int).
 */
#endif
#endif

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

/* Copy whatever the last rule matched to the standard output. */

#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
#endif

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

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL int yylex YY_PROTO(( void ))
#endif

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

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

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		yy_current_buffer->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

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 1011 "pl_scan.c"

	if ( yy_init )
		{
		yy_init = 0;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! yy_current_buffer )
			yy_current_buffer =
				yy_create_buffer( yyin, YY_BUF_SIZE );

		yy_load_buffer_state();
		}

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

		/* Support of 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_base[yy_current_state] != 1137 );

yy_find_action:
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
			yy_cp = yy_last_accepting_cpos;
			yy_current_state = yy_last_accepting_state;
			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:
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:
YY_RULE_SETUP
#line 179 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(yytext); }
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 182 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(yytext); }
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 185 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(yytext); }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 188 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(yytext); }
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 191 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(yytext); }
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 194 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(yytext); }
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 197 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(yytext); }
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 200 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(yytext); }
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 203 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_word(yytext); }
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 206 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblword(yytext); }
	YY_BREAK
case 68:
YY_RULE_SETUP
#line 209 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripword(yytext); }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 212 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordtype(yytext); }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 215 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordtype(yytext); }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 218 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_tripwordtype(yytext); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 221 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_wordrowtype(yytext); }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 224 "scan.l"
{
	plpgsql_error_lineno = plpgsql_scanner_lineno();
	return plpgsql_parse_dblwordrowtype(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:
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:
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 yytext/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 = 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 = 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 yytext/yyleng to describe whole string token */
			  yyleng += (yytext - start_charpos);
			  yytext = start_charpos;
			  BEGIN(INITIAL);
			  return T_STRING;
			}
	YY_BREAK
case 88:
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 = yytext;
			  dolqstart = pstrdup(yytext);
			  BEGIN(IN_DOLLARQUOTE);
			}
	YY_BREAK
case 90:
YY_RULE_SETUP
#line 307 "scan.l"
{
			  if (strcmp(yytext, dolqstart) == 0)
			  {
					pfree(dolqstart);
					/* tell plpgsql_get_string_value it is a dollar quote */
					dolqlen = yyleng;
					/* adjust yytext/yyleng to describe whole string token */
					yyleng += (yytext - start_charpos);
					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(yyleng-1);
			  }
			}
	YY_BREAK
case 91:
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 yytext[0];			}
	YY_BREAK
case 94:
YY_RULE_SETUP
#line 344 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 1701 "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->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * 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->yy_n_chars;
			yy_current_buffer->yy_input_file = yyin;
			yy_current_buffer->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->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_c_buf_p;
				goto yy_find_action;
				}
			}

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

				if ( yywrap() )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					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->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 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()
	{
	register char *dest = yy_current_buffer->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->yy_ch_buf[yy_n_chars + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0;

	else
		{
		int num_to_read =
			yy_current_buffer->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */
#ifdef YY_USES_REJECT
			YY_FATAL_ERROR(
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
#else

			/* 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. */
					yy_flex_realloc( (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->yy_buf_size -
						number_to_move - 1;
#endif
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		yy_current_buffer->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;
			yyrestart( yyin );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

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

	yytext_ptr = &yy_current_buffer->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()
	{
	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 );
 */

#ifdef YY_USE_PROTOS
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
#else
static yy_state_type yy_try_NUL_trans( yy_current_state )
yy_state_type yy_current_state;
#endif
	{
	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_UNPUT
#ifdef YY_USE_PROTOS
static void yyunput( int c, register char *yy_bp )
#else
static void yyunput( c, yy_bp )
int c;
register char *yy_bp;
#endif
	{
	register char *yy_cp = yy_c_buf_p;

	/* undo effects of setting up yytext */
	*yy_cp = yy_hold_char;

	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
		register int number_to_move = yy_n_chars + 2;
		register char *dest = &yy_current_buffer->yy_ch_buf[
					yy_current_buffer->yy_buf_size + 2];
		register char *source =
				&yy_current_buffer->yy_ch_buf[number_to_move];

		while ( source > yy_current_buffer->yy_ch_buf )
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
		yy_current_buffer->yy_n_chars =
			yy_n_chars = yy_current_buffer->yy_buf_size;

		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--yy_cp = (char) c;


	yytext_ptr = yy_bp;
	yy_hold_char = *yy_cp;
	yy_c_buf_p = yy_cp;
	}
#endif	/* ifndef YY_NO_UNPUT */


#ifdef __cplusplus
static int yyinput()
#else
static int input()
#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->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. */
					yyrestart( yyin );

					/* fall through */

				case EOB_ACT_END_OF_FILE:
					{
					if ( 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 yytext */
	yy_hold_char = *++yy_c_buf_p;

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

	return c;
	}


#ifdef YY_USE_PROTOS
void yyrestart( FILE *input_file )
#else
void yyrestart( input_file )
FILE *input_file;
#endif
	{
	if ( ! yy_current_buffer )
		yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );

	yy_init_buffer( yy_current_buffer, input_file );
	yy_load_buffer_state();
	}


#ifdef YY_USE_PROTOS
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
#else
void yy_switch_to_buffer( new_buffer )
YY_BUFFER_STATE new_buffer;
#endif
	{
	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->yy_buf_pos = yy_c_buf_p;
		yy_current_buffer->yy_n_chars = yy_n_chars;
		}

	yy_current_buffer = new_buffer;
	yy_load_buffer_state();

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


#ifdef YY_USE_PROTOS
void yy_load_buffer_state( void )
#else
void yy_load_buffer_state()
#endif
	{
	yy_n_chars = yy_current_buffer->yy_n_chars;
	yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
	yyin = yy_current_buffer->yy_input_file;
	yy_hold_char = *yy_c_buf_p;
	}


#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
#else
YY_BUFFER_STATE yy_create_buffer( file, size )
FILE *file;
int size;
#endif
	{
	YY_BUFFER_STATE b;

	b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in 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 *) yy_flex_alloc( b->yy_buf_size + 2 );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
	}


#ifdef YY_USE_PROTOS
void yy_delete_buffer( YY_BUFFER_STATE b )
#else
void yy_delete_buffer( b )
YY_BUFFER_STATE b;
#endif
	{
	if ( ! b )
		return;

	if ( b == yy_current_buffer )
		yy_current_buffer = (YY_BUFFER_STATE) 0;

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

	yy_flex_free( (void *) b );
	}


#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
extern int isatty YY_PROTO(( int ));
#endif
#endif

#ifdef YY_USE_PROTOS
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
#else
void yy_init_buffer( b, file )
YY_BUFFER_STATE b;
FILE *file;
#endif


	{
	yy_flush_buffer( b );

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

#if YY_ALWAYS_INTERACTIVE
	b->yy_is_interactive = 1;
#else
#if YY_NEVER_INTERACTIVE
	b->yy_is_interactive = 0;
#else
	b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
#endif
#endif
	}


#ifdef YY_USE_PROTOS
void yy_flush_buffer( YY_BUFFER_STATE b )
#else
void yy_flush_buffer( b )
YY_BUFFER_STATE b;
#endif

	{
	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 )
		yy_load_buffer_state();
	}


#ifndef YY_NO_SCAN_BUFFER
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
#else
YY_BUFFER_STATE yy_scan_buffer( base, size )
char *base;
yy_size_t size;
#endif
	{
	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) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in 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;

	yy_switch_to_buffer( b );

	return b;
	}
#endif


#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
	{
	int len;
	for ( len = 0; yy_str[len]; ++len )
		;

	return yy_scan_bytes( yy_str, len );
	}
#endif


#ifndef YY_NO_SCAN_BYTES
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
#else
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
yyconst char *bytes;
int len;
#endif
	{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;

	/* Get memory for full buffer, including space for trailing EOB's. */
	n = len + 2;
	buf = (char *) yy_flex_alloc( n );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < len; ++i )
		buf[i] = bytes[i];

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

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in 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;
	}
#endif


#ifndef YY_NO_PUSH_STATE
#ifdef YY_USE_PROTOS
static void yy_push_state( int new_state )
#else
static void yy_push_state( new_state )
int new_state;
#endif
	{
	if ( yy_start_stack_ptr >= yy_start_stack_depth )
		{
		yy_size_t new_size;

		yy_start_stack_depth += YY_START_STACK_INCR;
		new_size = yy_start_stack_depth * sizeof( int );

		if ( ! yy_start_stack )
			yy_start_stack = (int *) yy_flex_alloc( new_size );

		else
			yy_start_stack = (int *) yy_flex_realloc(
					(void *) yy_start_stack, new_size );

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

	yy_start_stack[yy_start_stack_ptr++] = YY_START;

	BEGIN(new_state);
	}
#endif


#ifndef YY_NO_POP_STATE
static void yy_pop_state()
	{
	if ( --yy_start_stack_ptr < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN(yy_start_stack[yy_start_stack_ptr]);
	}
#endif


#ifndef YY_NO_TOP_STATE
static int yy_top_state()
	{
	return yy_start_stack[yy_start_stack_ptr - 1];
	}
#endif

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

#ifdef YY_USE_PROTOS
static void yy_fatal_error( yyconst char msg[] )
#else
static void yy_fatal_error( msg )
char msg[];
#endif
	{
	(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 yytext. */ \
		yytext[yyleng] = yy_hold_char; \
		yy_c_buf_p = yytext + n; \
		yy_hold_char = *yy_c_buf_p; \
		*yy_c_buf_p = '\0'; \
		yyleng = n; \
		} \
	while ( 0 )


/* Internal utility routines. */

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

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

	return n;
	}
#endif


#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
#else
static void *yy_flex_alloc( size )
yy_size_t size;
#endif
	{
	return (void *) malloc( size );
	}

#ifdef YY_USE_PROTOS
static void *yy_flex_realloc( void *ptr, yy_size_t size )
#else
static void *yy_flex_realloc( ptr, size )
void *ptr;
yy_size_t size;
#endif
	{
	/* 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 );
	}

#ifdef YY_USE_PROTOS
static void yy_flex_free( void *ptr )
#else
static void yy_flex_free( ptr )
void *ptr;
#endif
	{
	free( ptr );
	}

#if YY_MAIN
int main()
	{
	yylex();
	return 0;
	}
#endif
#line 344 "scan.l"



/*
 * This is the 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 yytext is in step
 * with the "current token".
 */
int
plpgsql_yylex(void)
{
	if (have_pushback_token)
	{
		have_pushback_token = false;
		return pushback_token;
	}
	return yylex();
}

/*
 * Push back a single token to be re-read by next plpgsql_yylex() call.
 *
 * NOTE: this does not cause 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 = 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 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)
		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 = 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)
{
	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 = yyleng - 2 * dolqlen;
		Assert(len >= 0);
		result = (char *) palloc(len + 1);
		memcpy(result, yytext + dolqlen, len);
		result[len] = '\0';
	}
	else if (*yytext == 'E' || *yytext == 'e')
	{
		/* Token is an E'...' string */
		result = (char *) palloc(yyleng + 1);	/* more than enough room */
		len = 0;
		for (cp = 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(yyleng + 1);	/* more than enough room */
		len = 0;
		for (cp = 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;
}
