Logo Search packages:      
Sourcecode: postgresql-8.4 version File versions

pl_scan.c

#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 97
#define YY_END_OF_BUFFER 98
static yyconst short int yy_accept[393] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
       98,   96,   73,   73,   96,   96,   80,   96,   96,   96,
       71,   96,    2,   55,   55,   55,   55,   55,   55,   55,
       55,   55,   55,   55,   55,   55,   55,   55,   55,   55,
       55,   55,   96,   77,   79,   78,   86,   86,   82,   89,
       85,   82,   93,   93,   95,   73,   72,    0,   55,   90,
       63,   91,   73,    3,   74,   71,    1,    0,   55,    0,
        0,   55,   55,    6,   55,   55,   55,   55,   55,   55,
       55,   81,   55,   55,   55,   55,   55,   55,   55,   26,
       27,   30,   55,   55,   55,   55,   55,   37,   55,   55,

       55,   55,   55,   55,   55,   48,   55,   55,   55,    0,
       77,   79,   76,   75,   78,   86,   82,   82,   84,   83,
       87,   85,   93,   92,   94,   55,    0,    0,    0,    0,
       91,   73,    0,    0,    0,    0,   56,   55,   55,   55,
       55,   55,   55,   55,   55,   55,   55,   55,   18,   55,
       55,   55,   55,   23,   55,   25,   55,   55,   55,   55,
        0,   34,   55,   55,   55,   55,   55,   55,   55,   55,
       55,   55,   55,   55,   55,   55,   55,   55,    0,   82,
       88,   83,   82,   94,    0,    0,    0,    0,   64,    0,
        0,    0,   56,    0,   56,    0,    0,   55,   55,    7,

       55,   55,   55,   55,   55,   55,   55,   54,   15,   55,
       55,   55,   21,   55,   24,   55,   29,   31,   32,    0,
       35,   36,   55,   55,   55,   55,   55,   55,   55,   55,
       55,   47,   49,   55,   51,   55,    0,   82,   82,   82,
       82,    0,    0,    0,   64,    0,   64,    0,    0,    0,
        0,    0,    0,    0,    0,   57,    4,    5,    8,   55,
       55,   55,   55,   55,   55,   55,   17,   55,   55,   22,
       55,    0,   55,   39,   55,   55,   55,   55,   55,   55,
       55,   50,   52,    0,   82,   82,   82,   82,   82,    0,
        0,    0,    0,    0,    0,   65,    0,   58,    0,    0,

        0,   57,    0,   57,    0,   55,   55,   11,   55,   55,
       55,   16,   55,   55,   28,    0,   55,   40,   55,   42,
       55,   55,   45,   46,    0,   82,    0,   66,    0,    0,
        0,   65,    0,   65,    0,    0,    0,    0,    0,   55,
       55,   12,   13,   55,   55,   20,    0,   38,   55,   43,
       55,   53,    0,    0,    0,    0,    0,    0,   59,    0,
        9,   10,   55,   55,    0,   55,   55,    0,    0,   67,
        0,   61,    0,    0,   55,   19,   33,   55,   44,   69,
        0,    0,    0,   60,   55,   41,    0,   68,   62,   14,
       70,    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,    9,
        1,   10,    9,   11,    1,    1,   12,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13,   13,   13,   13,   13,   13,   13,   13,   13,   13,
       13
    } ;

static yyconst short int yy_base[424] =
    {   0,
        0, 1014,   32,   33,   41,   44,  941,  938,   45,   48,
      946, 1328,   60,   63,   51,   61, 1328,  932,  930,  930,
      923,  920, 1328,   68,   75,  103,   62,   59,   79,   89,
       51,   93,   86,   90,  106,  112,   91,  117,  116,  128,
      127,  133,  877,    0,   47,   80,    0,    0,  161,    0,
        0,  173,    0,    0,  896,  176,  867,  863,  183, 1328,
      190,  855,    0, 1328, 1328,  844, 1328,  197,  125,   61,
      208,  180,  148,  167,  183,  191,  194,  192,  206,  197,
      211, 1328,  196,  217,  221,  213,  222,  223,  230,  220,
      234,  227,  242,  244,  274,  250,  249,  257,  258,  261,

      270,  273,  266,  286,  263,  272,  293,  294,  295,  823,
        0,   88, 1328, 1328,  842,    0,  321,  335, 1328,  795,
     1328,    0,    0, 1328,  792,  345,  793,  352,  147,  326,
      782,    0,  754,  732,  338,  760,  359,  346,  343,  310,
      345,  353,  350,  349,  356,  358,  359,  375,  336,  370,
      380,  372,  383,  373,  382,  384,  386,  387,  397,  392,
      432,  406,  408,  419,  422,  416,  429,  418,  431,  420,
      435,  433,  439,  446,  441,  448,  450,  455,  727,  490,
     1328,  740,  500,  723,  690,  654,  503,  688,  510,  652,
      636,  662,  521,  528,  535,  449,  546,  474,  504,  475,

      487,  518,  519,  521,  533,  532,  534,  535,  540,  547,
      545,  543,  538,  559,  549,  560,  554,  564,  566,  636,
      568,  569,  570,  573,  574,  583,  585,  593,  597,  594,
      607,  580,  590,  614,  599,  602,  629,  642,  647,  657,
      660,  603,  608,  628,  670,  677,  684,  452,  695,  596,
      576,  566,  523,  699,  529,  703,  606,  613,  629,  671,
      685,  642,  643,  686,  687,  690,  694,  697,  698,  695,
      701,  487,  706,  700,  702,  709,  721,  723,  725,  726,
      733,  730,  731,  488,  757,  773,  776,  779,  789,  483,
      494,  468,  454,  792,  485,  799,  434, 1328,  393,  393,

      417,  806,  813,  816,  382,  781,  790,  747,  782,  802,
      805,  803,  806,  807,  809,  385,  811,  812,  819,  813,
      816,  822,  826,  828,  343,  862,  317, 1328,  313,  312,
      314,  872,  879,  882,  267,  261,  251,  237,  218,  855,
      838,  847,  848,  869,  870,  871,  222,  872,  874,  875,
      876, 1328,  195,  186,  174,  155,  144,  120, 1328,  122,
      877,  878,  881,  897,  113,  898,  891,  118,   92, 1328,
       92, 1328,   56,   61,  903,  900, 1328,  907,  908, 1328,
       40,   46,   36, 1328,  910,  911,   26, 1328, 1328,  912,
     1328, 1328,  953,  966,  979,  992, 1005, 1013, 1025, 1038,

     1051, 1064, 1077, 1090, 1098, 1111, 1119, 1132, 1144, 1152,
     1164, 1177, 1189, 1202, 1215, 1227, 1239, 1252, 1264, 1277,
     1289, 1302, 1314
    } ;

static yyconst short int yy_def[424] =
    {   0,
      392,    1,  393,  393,  394,  394,  395,  395,  396,  396,
      392,  392,  392,  392,  397,  398,  392,  392,  392,  392,
      392,  392,  392,  399,  399,  399,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,  392,  400,  392,  392,  401,  401,  392,  402,
      403,  392,  404,  404,  405,  392,  406,  406,  392,  392,
      392,  407,  408,  392,  392,  392,  392,  392,   26,  392,
      409,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,  392,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,

       26,   26,   26,   26,   26,   26,   26,   26,   26,  392,
      400,  392,  392,  392,  392,  401,  392,  392,  392,  392,
      392,  403,  404,  392,  410,  392,  406,  392,  392,  411,
      407,  408,  392,  392,  409,  412,  413,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
      392,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,  392,  392,
      392,  392,  414,  410,  392,  392,  411,  415,  416,  392,
      392,  412,  392,  392,  413,  392,  417,   26,   26,   26,

       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,  392,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,  392,  418,  414,  414,
      414,  392,  392,  415,  392,  392,  416,  392,  419,  392,
      392,  392,  392,  417,  420,  421,   26,   26,   26,   26,
       26,   26,   26,   26,   26,   26,   26,   26,   26,   26,
       26,  392,   26,   26,   26,   26,   26,   26,   26,   26,
       26,   26,   26,  392,  418,  418,  392,  418,  414,  392,
      392,  392,  392,  419,  422,  423,  392,  392,  392,  392,

      420,  392,  392,  421,  392,   26,   26,   26,   26,   26,
       26,   26,   26,   26,   26,  392,   26,   26,   26,   26,
       26,   26,   26,   26,  392,  418,  392,  392,  392,  392,
      422,  392,  392,  423,  392,  392,  392,  392,  392,   26,
       26,   26,   26,   26,   26,   26,  392,   26,   26,   26,
       26,  392,  392,  392,  392,  392,  392,  392,  392,  392,
       26,   26,   26,   26,  392,   26,   26,  392,  392,  392,
      392,  392,  392,  392,   26,   26,  392,   26,   26,  392,
      392,  392,  392,  392,   26,   26,  392,  392,  392,   26,
      392,    0,  392,  392,  392,  392,  392,  392,  392,  392,

      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392
    } ;

static yyconst short int yy_nxt[1370] =
    {   0,
       12,   13,   14,   13,   15,   12,   16,   12,   17,   12,
       18,   19,   20,   21,   22,   23,   12,   24,   25,   26,
       27,   28,   29,   30,   31,   24,   32,   24,   33,   34,
       35,   36,   37,   38,   39,   40,   41,   24,   42,   24,
       24,   45,   45,   48,   46,   46,   48,   54,  391,   49,
       54,   55,   49,   58,   55,   59,  112,   50,  389,  113,
       50,   56,   56,   56,   56,   56,   56,   60,  388,   68,
       68,   68,  387,   89,   61,   70,   68,   68,   68,   71,
       75,   79,   70,  384,   69,   80,   71,   82,  383,  114,
       76,   69,  115,   77,  133,   81,  134,  112,   78,   69,

      113,   69,   69,   72,   68,   68,   68,   83,   69,   84,
       70,   86,   69,   99,   71,   69,   90,   93,   85,   69,
       87,   94,   88,   91,  382,   73,   69,   92,   69,   69,
       69,   69,  381,   69,   69,  100,  103,   95,   69,  101,
      380,  377,   96,   74,   97,   98,   69,   69,  102,   69,
       69,  104,   69,  105,  374,   69,   69,   69,  109,  106,
      373,  108,  117,  118,  118,   69,  372,   69,  107,  119,
       69,  120,  139,   69,  117,  118,  118,   56,   56,   56,
      185,  119,  186,  120,   68,   68,   68,  127,   69,   69,
       70,  128,  128,  128,   71,  371,  370,  129,   68,   68,

       68,  130,   69,   61,   70,   69,  138,   69,   71,  135,
      135,  135,  136,   69,   69,  146,   69,  140,   69,   69,
       69,  369,  141,   69,  142,  143,  144,  368,   69,  145,
      148,   69,   69,   69,   69,   69,   69,   69,  149,   69,
      147,  150,   69,  151,   69,   69,   69,  152,  153,   69,
      365,   69,   69,   69,  155,  154,   69,   69,  360,  359,
       69,   69,   69,   69,   69,  156,   69,   69,  157,  158,
       69,  164,   69,  159,   69,  161,  161,  161,  163,   69,
       69,  160,   69,   69,   69,  174,  358,  166,   69,   69,
       69,  165,   69,  357,   69,   69,   69,   69,   69,  172,

      167,   69,  356,   69,  168,  169,   69,  170,   69,  162,
       69,  171,   69,   69,   69,   69,   69,  177,  332,  173,
      176,  178,  117,  118,  118,  175,   69,  187,  187,  187,
      188,  120,  200,   69,   69,   69,  180,  180,  180,  135,
      135,  135,  136,  181,  355,  182,   68,   68,   68,  127,
       69,  354,   70,  128,  128,  128,   71,  353,   69,  129,
      194,  194,  194,  130,  198,   69,  196,   69,   69,  199,
      197,   69,   69,  352,  206,   69,   69,  205,   69,  201,
       69,   69,  207,   69,  204,   69,   69,  202,  203,   69,
       69,  208,  211,   69,   69,   69,   69,  209,   69,   69,

      212,  210,   69,  214,   69,   69,   69,  213,  216,   69,
       69,  215,   69,   69,  219,   69,  347,  339,  217,   69,
       69,  302,   69,   69,   69,  338,   69,   69,   69,  218,
       69,  337,   69,  161,  161,  161,  221,   69,   69,   70,
       69,   69,  228,   71,   69,  223,   69,  225,   69,  222,
      224,   69,  229,   69,  226,   69,   69,   69,   69,   69,
       69,   69,   69,  233,  230,  231,  220,  227,   69,   69,
       69,   69,   69,   69,  336,   69,  232,   69,  234,   69,
      235,   69,  252,  236,  253,  292,   69,  293,   69,  332,
       69,  180,  180,  180,  330,   69,   69,   69,  181,  329,

      182,  240,  118,  118,  187,  187,  187,  188,  257,  259,
      241,  246,  246,  246,   69,   69,  328,  248,  327,  325,
      316,  249,  194,  194,  194,  136,   69,   69,  196,  194,
      194,  194,  197,  302,  258,  196,  194,  194,  194,  197,
       69,   69,  196,   69,   69,  261,  197,  254,  254,  254,
      255,  263,  262,  260,   69,   69,   69,   69,   69,   69,
       69,   69,   69,  300,  265,   69,  266,   69,  264,   69,
      267,   69,   69,   69,   69,   69,   69,  268,   69,  269,
       69,   69,   69,   69,  270,   69,   69,   69,   69,   69,
       69,   69,   69,  271,   69,  274,   69,  299,  298,   69,

       69,  273,   69,  275,   69,   69,   69,   69,   69,   69,
       69,  276,   69,   69,   69,   69,   69,  279,  277,   69,
       69,   69,  280,   69,  283,   69,  278,  281,   69,   69,
       69,  297,  245,   69,   69,   69,   69,   69,  282,   69,
      291,  290,   69,  286,  287,  287,   69,   69,  240,  118,
      118,   69,  288,   69,   69,  284,  272,  241,  240,  118,
      118,  240,  118,  118,   69,   69,  193,  241,  251,   69,
      289,  246,  246,  246,  188,  308,  309,  248,  246,  246,
      246,  249,   69,   69,  248,  246,  246,  246,  249,  306,
      250,  248,  245,   69,  243,  249,  294,  294,  294,  295,

      254,  254,  254,  255,  303,  303,  303,   69,   69,   69,
      305,   69,   69,  312,  310,  307,   69,   69,  311,   69,
       69,  242,   69,   69,  318,   69,   69,   69,   69,  124,
       69,   69,  313,  314,   69,   69,  315,   69,   69,  317,
       69,   69,   69,   69,  319,   69,   69,   69,   69,   69,
      238,  320,   69,   69,  323,   69,  322,  321,  286,  287,
      287,   69,  237,   69,  193,   69,   69,  288,  324,   69,
       69,   69,  191,   69,  286,  287,  287,  180,  180,  180,
      286,  287,  287,  288,  181,  190,  182,   69,   60,  326,
      240,  118,  118,  294,  294,  294,  295,  126,  124,  289,

      333,  333,  333,   69,  342,  183,  335,  303,  303,  303,
      255,  340,   69,  305,  303,  303,  303,  303,  303,  303,
      305,   69,   69,  305,   69,   69,  341,   69,   69,  346,
       69,   69,  345,   69,   69,   69,  349,  343,  350,  344,
      348,   69,   69,   69,   69,   69,   69,   69,   69,   69,
       69,   69,   69,   69,  115,  179,   69,   66,  351,   69,
      362,   60,   69,  286,  287,  287,   69,  126,   69,   69,
       69,  126,  326,  333,  333,  333,  295,   69,   69,  335,
      333,  333,  333,  333,  333,  333,  335,   69,   69,  335,
      361,   69,   69,   69,   69,   69,   69,   69,   69,   69,

       69,  364,  124,   69,  363,  366,  367,  375,  110,   69,
       69,   69,   69,   69,   69,   69,   69,   69,   69,   69,
       69,   69,   69,  385,  378,   69,  379,  376,  386,   69,
       69,   69,   69,   69,   69,   67,   66,   69,   69,   65,
       69,   64,   63,   69,  390,  392,   52,   69,   69,   52,
       69,   69,   69,   44,   44,   44,   44,   44,   44,   44,
       44,   44,   44,   44,   44,   44,   47,   47,   47,   47,
       47,   47,   47,   47,   47,   47,   47,   47,   47,   51,
       51,   51,   51,   51,   51,   51,   51,   51,   51,   51,
       51,   51,   53,   53,   53,   53,   53,   53,   53,   53,

       53,   53,   53,   53,   53,   57,   57,   57,   57,   57,
       57,   57,   57,   57,   57,   57,   57,   57,   62,   43,
      392,  392,  392,   62,  392,   62,   69,   69,   69,  392,
       69,   69,  392,  392,   69,   69,  392,   69,  111,  111,
      111,  111,  111,  111,  111,  111,  392,  111,  111,  111,
      111,  116,  116,  116,  116,  116,  116,  116,  392,  116,
      116,  116,  392,  116,  121,  121,  392,  121,  121,  121,
      121,  121,  121,  121,  121,  121,  121,  122,  122,  122,
      122,  122,  122,  122,  392,  122,  122,  122,  122,  122,
      123,  123,  123,  123,  123,  392,  123,  123,  123,  123,

      123,  123,  123,  125,  392,  392,  392,  392,  392,  392,
      125,   58,   58,   58,   58,   58,   58,   58,   58,   58,
       58,   58,   58,   58,  131,  392,  392,  392,  392,  131,
      392,  131,  132,  132,  392,  392,  132,  132,  132,  132,
      132,  132,  132,  132,  132,  137,  137,  137,  137,  392,
      392,  392,  392,  392,  392,  392,  137,  184,  392,  392,
      392,  392,  184,  392,  184,  189,  189,  189,  189,  392,
      392,  392,  392,  392,  392,  392,  189,  192,  192,  192,
      192,  192,  192,  192,  192,  192,  192,  192,  192,  192,
      195,  195,  195,  392,  195,  195,  392,  392,  195,  195,

      392,  195,  239,  239,  239,  239,  239,  239,  239,  239,
      239,  239,  239,  239,  239,  244,  244,  244,  244,  244,
      244,  244,  244,  244,  244,  244,  244,  244,  247,  247,
      247,  392,  247,  247,  392,  392,  247,  247,  392,  247,
      256,  256,  256,  256,  392,  392,  392,  392,  392,  392,
      392,  256,  285,  285,  285,  285,  285,  285,  285,  285,
      285,  285,  285,  285,  285,  296,  296,  296,  296,  392,
      392,  392,  392,  392,  392,  392,  296,  301,  301,  301,
      301,  301,  301,  301,  301,  301,  301,  301,  301,  301,
      304,  304,  304,  392,  304,  304,  392,  392,  392,  304,

      392,  304,  331,  331,  331,  331,  331,  331,  331,  331,
      331,  331,  331,  331,  331,  334,  334,  334,  392,  334,
      334,  392,  392,  392,  334,  392,  334,   11,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392
    } ;

static yyconst short int yy_chk[1370] =
    {   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,    5,    3,    4,    6,    9,  387,    5,
       10,    9,    6,   15,   10,   15,   45,    5,  383,   45,
        6,   13,   13,   13,   14,   14,   14,   16,  382,   24,
       24,   24,  381,   31,   16,   24,   25,   25,   25,   24,
       27,   28,   25,  374,   27,   28,   25,   29,  373,   46,
       27,   31,   46,   27,   70,   28,   70,  112,   27,   28,

      112,   29,   27,   25,   26,   26,   26,   29,   33,   29,
       26,   30,   34,   37,   26,   32,   32,   33,   29,   29,
       30,   34,   30,   32,  371,   26,   33,   32,   35,   30,
       34,   37,  369,   32,   36,   38,   39,   35,   39,   38,
      368,  365,   35,   26,   36,   36,   35,   69,   38,   41,
       40,   39,   36,   40,  360,   42,   39,   38,   42,   40,
      358,   41,   49,   49,   49,   69,  357,   41,   40,   49,
       73,   49,   73,   42,   52,   52,   52,   56,   56,   56,
      129,   52,  129,   52,   59,   59,   59,   59,   73,   74,
       59,   61,   61,   61,   59,  356,  355,   61,   68,   68,

       68,   61,   72,   61,   68,   75,   72,   74,   68,   71,
       71,   71,   71,   76,   78,   80,   77,   75,   83,   80,
       72,  354,   76,   75,   77,   78,   79,  353,   79,   79,
       83,   76,   78,   81,   77,   86,   83,   80,   84,   84,
       81,   85,   90,   85,   87,   88,   79,   85,   86,   92,
      347,   81,   89,   86,   88,   87,   91,   84,  339,  338,
       90,   85,   87,   88,   93,   89,   94,   92,   91,   91,
       89,   97,   96,   93,   91,   95,   95,   95,   96,   98,
       99,   94,   93,  100,   94,  105,  337,  100,  103,   97,
       96,   99,  101,  336,  106,  102,   95,   98,   99,  103,

      101,  100,  335,  105,  101,  101,  103,  101,  104,   95,
      101,  102,  106,  102,   95,  107,  108,  109,  331,  104,
      108,  109,  117,  117,  117,  107,  104,  130,  130,  130,
      130,  117,  140,  107,  108,  109,  118,  118,  118,  135,
      135,  135,  135,  118,  330,  118,  126,  126,  126,  126,
      140,  329,  126,  128,  128,  128,  126,  327,  149,  128,
      137,  137,  137,  128,  138,  139,  137,  141,  138,  139,
      137,  144,  143,  325,  145,  142,  149,  144,  145,  141,
      146,  147,  146,  139,  143,  141,  138,  142,  142,  144,
      143,  147,  150,  142,  152,  154,  145,  148,  146,  147,

      151,  148,  151,  153,  155,  153,  156,  152,  157,  158,
      150,  155,  152,  154,  160,  148,  316,  305,  158,  159,
      151,  301,  155,  153,  156,  300,  157,  158,  162,  159,
      163,  299,  160,  161,  161,  161,  163,  159,  166,  161,
      168,  164,  170,  161,  165,  165,  162,  167,  163,  164,
      166,  167,  171,  169,  168,  172,  166,  171,  168,  164,
      170,  173,  165,  175,  172,  173,  161,  169,  174,  167,
      176,  169,  177,  172,  297,  171,  174,  178,  176,  173,
      177,  175,  196,  178,  196,  248,  174,  248,  176,  295,
      177,  180,  180,  180,  293,  178,  198,  200,  180,  292,

      180,  183,  183,  183,  187,  187,  187,  187,  198,  201,
      183,  189,  189,  189,  198,  200,  291,  189,  290,  284,
      272,  189,  193,  193,  193,  193,  199,  201,  193,  194,
      194,  194,  193,  255,  199,  194,  195,  195,  195,  194,
      202,  203,  195,  204,  199,  203,  195,  197,  197,  197,
      197,  205,  204,  202,  206,  205,  207,  208,  202,  203,
      213,  204,  209,  253,  207,  212,  209,  211,  206,  210,
      210,  215,  206,  205,  207,  208,  217,  211,  213,  212,
      209,  214,  216,  212,  214,  211,  218,  210,  219,  215,
      221,  222,  223,  216,  217,  224,  225,  252,  251,  214,

      216,  223,  232,  225,  218,  226,  219,  227,  221,  222,
      223,  226,  233,  224,  225,  228,  230,  229,  227,  229,
      232,  235,  230,  226,  236,  227,  228,  231,  257,  231,
      233,  250,  244,  228,  230,  258,  234,  229,  234,  235,
      243,  242,  236,  238,  238,  238,  257,  231,  239,  239,
      239,  259,  238,  258,  234,  237,  220,  239,  240,  240,
      240,  241,  241,  241,  262,  263,  192,  240,  191,  259,
      241,  245,  245,  245,  245,  262,  263,  245,  246,  246,
      246,  245,  262,  263,  246,  247,  247,  247,  246,  260,
      190,  247,  188,  260,  186,  247,  249,  249,  249,  249,

      254,  254,  254,  254,  256,  256,  256,  261,  264,  265,
      256,  260,  266,  266,  264,  261,  267,  270,  265,  268,
      269,  185,  274,  271,  275,  261,  264,  265,  273,  184,
      266,  276,  268,  269,  267,  270,  271,  268,  269,  273,
      274,  271,  275,  277,  276,  278,  273,  279,  280,  276,
      182,  277,  282,  283,  280,  281,  279,  278,  285,  285,
      285,  277,  179,  278,  136,  279,  280,  285,  281,  308,
      282,  283,  134,  281,  286,  286,  286,  287,  287,  287,
      288,  288,  288,  286,  287,  133,  287,  308,  131,  288,
      289,  289,  289,  294,  294,  294,  294,  127,  125,  289,

      296,  296,  296,  306,  309,  120,  296,  302,  302,  302,
      302,  306,  307,  302,  303,  303,  303,  304,  304,  304,
      303,  306,  309,  304,  310,  312,  307,  311,  313,  314,
      307,  315,  313,  317,  318,  320,  319,  310,  321,  311,
      317,  319,  310,  312,  322,  311,  313,  314,  323,  315,
      324,  317,  318,  320,  115,  110,  321,   66,  322,  319,
      341,   62,  322,  326,  326,  326,  323,   58,  324,  342,
      343,   57,  326,  332,  332,  332,  332,  340,  341,  332,
      333,  333,  333,  334,  334,  334,  333,  342,  343,  334,
      340,  344,  345,  346,  348,  340,  349,  350,  351,  361,

      362,  345,   55,  363,  344,  349,  351,  363,   43,  344,
      345,  346,  348,  367,  349,  350,  351,  361,  362,  364,
      366,  363,  376,  375,  366,  375,  367,  364,  378,  378,
      379,  367,  385,  386,  390,   22,   21,  364,  366,   20,
      376,   19,   18,  375,  385,   11,    8,  378,  379,    7,
      385,  386,  390,  393,  393,  393,  393,  393,  393,  393,
      393,  393,  393,  393,  393,  393,  394,  394,  394,  394,
      394,  394,  394,  394,  394,  394,  394,  394,  394,  395,
      395,  395,  395,  395,  395,  395,  395,  395,  395,  395,
      395,  395,  396,  396,  396,  396,  396,  396,  396,  396,

      396,  396,  396,  396,  396,  397,  397,  397,  397,  397,
      397,  397,  397,  397,  397,  397,  397,  397,  398,    2,
        0,    0,    0,  398,    0,  398,  399,  399,  399,    0,
      399,  399,    0,    0,  399,  399,    0,  399,  400,  400,
      400,  400,  400,  400,  400,  400,    0,  400,  400,  400,
      400,  401,  401,  401,  401,  401,  401,  401,    0,  401,
      401,  401,    0,  401,  402,  402,    0,  402,  402,  402,
      402,  402,  402,  402,  402,  402,  402,  403,  403,  403,
      403,  403,  403,  403,    0,  403,  403,  403,  403,  403,
      404,  404,  404,  404,  404,    0,  404,  404,  404,  404,

      404,  404,  404,  405,    0,    0,    0,    0,    0,    0,
      405,  406,  406,  406,  406,  406,  406,  406,  406,  406,
      406,  406,  406,  406,  407,    0,    0,    0,    0,  407,
        0,  407,  408,  408,    0,    0,  408,  408,  408,  408,
      408,  408,  408,  408,  408,  409,  409,  409,  409,    0,
        0,    0,    0,    0,    0,    0,  409,  410,    0,    0,
        0,    0,  410,    0,  410,  411,  411,  411,  411,    0,
        0,    0,    0,    0,    0,    0,  411,  412,  412,  412,
      412,  412,  412,  412,  412,  412,  412,  412,  412,  412,
      413,  413,  413,    0,  413,  413,    0,    0,  413,  413,

        0,  413,  414,  414,  414,  414,  414,  414,  414,  414,
      414,  414,  414,  414,  414,  415,  415,  415,  415,  415,
      415,  415,  415,  415,  415,  415,  415,  415,  416,  416,
      416,    0,  416,  416,    0,    0,  416,  416,    0,  416,
      417,  417,  417,  417,    0,    0,    0,    0,    0,    0,
        0,  417,  418,  418,  418,  418,  418,  418,  418,  418,
      418,  418,  418,  418,  418,  419,  419,  419,  419,    0,
        0,    0,    0,    0,    0,    0,  419,  420,  420,  420,
      420,  420,  420,  420,  420,  420,  420,  420,  420,  420,
      421,  421,  421,    0,  421,  421,    0,    0,    0,  421,

        0,  421,  422,  422,  422,  422,  422,  422,  422,  422,
      422,  422,  422,  422,  422,  423,  423,  423,    0,  423,
      423,    0,    0,    0,  423,    0,  423,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392,  392,
      392,  392,  392,  392,  392,  392,  392,  392,  392
    } ;

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-2009, 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.70 2009/06/10 22:34:11 petere Exp $
 *
 *-------------------------------------------------------------------------
 */

#include "plpgsql.h"

#include "mb/pg_wchar.h"


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

/*
 * When we parse a token that requires multiple lexer rules to process,
 * remember the token's starting position this way.
 */
#define SAVE_TOKEN_START()  \
      ( start_lineno = plpgsql_scanner_lineno(), start_charpos = yytext )

/* 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  pushback_token;
static bool have_pushback_token;
static const char *cur_line_start;
static int  cur_line_num;
static int        xcdepth = 0;      /* depth of nesting in slash-star comments */
static char    *dolqstart;      /* current $foo$ quote start string */

extern PGDLLIMPORT bool standard_conforming_strings;

bool plpgsql_SpaceScanned = false;
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1
#define YY_NO_UNPUT 1
/*
 * Exclusive states are a subset of the core lexer's:
 *  <xc> extended C-style comments
 *  <xq> standard quoted strings
 *  <xe> extended quoted strings (support backslash escape sequences)
 *  <xdolq> $foo$ quoted strings
 */
#define xc 1

#define xe 2

#define xq 3

#define xdolq 4

/*
 * Definitions --- these generally must match the core lexer, but in some
 * cases we can simplify, since we only care about identifying the token
 * boundaries and not about deriving the represented value.  Also, we
 * aren't trying to lex multicharacter operators so their interactions
 * with comments go away.
 */
/* This is a simpler treatment of quoted identifiers than the core uses */
#line 895 "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 128 "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;

    /* ----------
     * The keyword rules
     * ----------
     */
#line 1070 "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 >= 393 )
                              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] != 1328 );

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 148 "scan.l"
{ return K_ASSIGN;                  }
      YY_BREAK
case 2:
YY_RULE_SETUP
#line 149 "scan.l"
{ return K_ASSIGN;                  }
      YY_BREAK
case 3:
YY_RULE_SETUP
#line 150 "scan.l"
{ return K_DOTDOT;                  }
      YY_BREAK
case 4:
YY_RULE_SETUP
#line 151 "scan.l"
{ return K_ALIAS;             }
      YY_BREAK
case 5:
YY_RULE_SETUP
#line 152 "scan.l"
{ return K_BEGIN;             }
      YY_BREAK
case 6:
YY_RULE_SETUP
#line 153 "scan.l"
{ return K_BY;                }
      YY_BREAK
case 7:
YY_RULE_SETUP
#line 154 "scan.l"
{ return K_CASE;              }
      YY_BREAK
case 8:
YY_RULE_SETUP
#line 155 "scan.l"
{ return K_CLOSE;             }
      YY_BREAK
case 9:
YY_RULE_SETUP
#line 156 "scan.l"
{ return K_CONSTANT;          }
      YY_BREAK
case 10:
YY_RULE_SETUP
#line 157 "scan.l"
{ return K_CONTINUE;          }
      YY_BREAK
case 11:
YY_RULE_SETUP
#line 158 "scan.l"
{ return K_CURSOR;                  }
      YY_BREAK
case 12:
YY_RULE_SETUP
#line 159 "scan.l"
{ return K_DECLARE;                 }
      YY_BREAK
case 13:
YY_RULE_SETUP
#line 160 "scan.l"
{ return K_DEFAULT;                 }
      YY_BREAK
case 14:
YY_RULE_SETUP
#line 161 "scan.l"
{ return K_DIAGNOSTICS;       }
      YY_BREAK
case 15:
YY_RULE_SETUP
#line 162 "scan.l"
{ return K_ELSE;              }
      YY_BREAK
case 16:
YY_RULE_SETUP
#line 163 "scan.l"
{ return K_ELSIF;             }
      YY_BREAK
case 17:
YY_RULE_SETUP
#line 164 "scan.l"
{ return K_ELSIF;             }
      YY_BREAK
case 18:
YY_RULE_SETUP
#line 165 "scan.l"
{ return K_END;                     }
      YY_BREAK
case 19:
YY_RULE_SETUP
#line 166 "scan.l"
{ return K_EXCEPTION;         }
      YY_BREAK
case 20:
YY_RULE_SETUP
#line 167 "scan.l"
{ return K_EXECUTE;                 }
      YY_BREAK
case 21:
YY_RULE_SETUP
#line 168 "scan.l"
{ return K_EXIT;              }
      YY_BREAK
case 22:
YY_RULE_SETUP
#line 169 "scan.l"
{ return K_FETCH;             }
      YY_BREAK
case 23:
YY_RULE_SETUP
#line 170 "scan.l"
{ return K_FOR;                     }
      YY_BREAK
case 24:
YY_RULE_SETUP
#line 171 "scan.l"
{ return K_FROM;              }
      YY_BREAK
case 25:
YY_RULE_SETUP
#line 172 "scan.l"
{ return K_GET;                     }
      YY_BREAK
case 26:
YY_RULE_SETUP
#line 173 "scan.l"
{ return K_IF;                      }
      YY_BREAK
case 27:
YY_RULE_SETUP
#line 174 "scan.l"
{ return K_IN;                      }
      YY_BREAK
case 28:
YY_RULE_SETUP
#line 175 "scan.l"
{ return K_INSERT;                  }
      YY_BREAK
case 29:
YY_RULE_SETUP
#line 176 "scan.l"
{ return K_INTO;              }
      YY_BREAK
case 30:
YY_RULE_SETUP
#line 177 "scan.l"
{ return K_IS;                      }
      YY_BREAK
case 31:
YY_RULE_SETUP
#line 178 "scan.l"
{ return K_LOOP;              }
      YY_BREAK
case 32:
YY_RULE_SETUP
#line 179 "scan.l"
{ return K_MOVE;              }
      YY_BREAK
case 33:
YY_RULE_SETUP
#line 180 "scan.l"
{ return K_NOSCROLL;          }
      YY_BREAK
case 34:
YY_RULE_SETUP
#line 181 "scan.l"
{ return K_NOT;                     }
      YY_BREAK
case 35:
YY_RULE_SETUP
#line 182 "scan.l"
{ return K_NULL;              }
      YY_BREAK
case 36:
YY_RULE_SETUP
#line 183 "scan.l"
{ return K_OPEN;              }
      YY_BREAK
case 37:
YY_RULE_SETUP
#line 184 "scan.l"
{ return K_OR;                      }
      YY_BREAK
case 38:
YY_RULE_SETUP
#line 185 "scan.l"
{ return K_PERFORM;                 }
      YY_BREAK
case 39:
YY_RULE_SETUP
#line 186 "scan.l"
{ return K_RAISE;             }
      YY_BREAK
case 40:
YY_RULE_SETUP
#line 187 "scan.l"
{ return K_RENAME;                  }
      YY_BREAK
case 41:
YY_RULE_SETUP
#line 188 "scan.l"
{ return K_RESULT_OID;        }
      YY_BREAK
case 42:
YY_RULE_SETUP
#line 189 "scan.l"
{ return K_RETURN;                  }
      YY_BREAK
case 43:
YY_RULE_SETUP
#line 190 "scan.l"
{ return K_REVERSE;                 }
      YY_BREAK
case 44:
YY_RULE_SETUP
#line 191 "scan.l"
{ return K_ROW_COUNT;         }
      YY_BREAK
case 45:
YY_RULE_SETUP
#line 192 "scan.l"
{ return K_SCROLL;                  }
      YY_BREAK
case 46:
YY_RULE_SETUP
#line 193 "scan.l"
{ return K_STRICT;            }
      YY_BREAK
case 47:
YY_RULE_SETUP
#line 194 "scan.l"
{ return K_THEN;              }
      YY_BREAK
case 48:
YY_RULE_SETUP
#line 195 "scan.l"
{ return K_TO;                      }
      YY_BREAK
case 49:
YY_RULE_SETUP
#line 196 "scan.l"
{ return K_TYPE;              }
      YY_BREAK
case 50:
YY_RULE_SETUP
#line 197 "scan.l"
{ return K_USING;             }
      YY_BREAK
case 51:
YY_RULE_SETUP
#line 198 "scan.l"
{ return K_WHEN;              }
      YY_BREAK
case 52:
YY_RULE_SETUP
#line 199 "scan.l"
{ return K_WHILE;             }
      YY_BREAK
case 53:
YY_RULE_SETUP
#line 201 "scan.l"
{ return O_OPTION;                  }
      YY_BREAK
case 54:
YY_RULE_SETUP
#line 202 "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 55:
YY_RULE_SETUP
#line 212 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_word(yytext); }
      YY_BREAK
case 56:
YY_RULE_SETUP
#line 215 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblword(yytext); }
      YY_BREAK
case 57:
YY_RULE_SETUP
#line 218 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_tripword(yytext); }
      YY_BREAK
case 58:
YY_RULE_SETUP
#line 221 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_wordtype(yytext); }
      YY_BREAK
case 59:
YY_RULE_SETUP
#line 224 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblwordtype(yytext); }
      YY_BREAK
case 60:
YY_RULE_SETUP
#line 227 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_tripwordtype(yytext); }
      YY_BREAK
case 61:
YY_RULE_SETUP
#line 230 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_wordrowtype(yytext); }
      YY_BREAK
case 62:
YY_RULE_SETUP
#line 233 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblwordrowtype(yytext); }
      YY_BREAK
case 63:
YY_RULE_SETUP
#line 236 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_word(yytext); }
      YY_BREAK
case 64:
YY_RULE_SETUP
#line 239 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblword(yytext); }
      YY_BREAK
case 65:
YY_RULE_SETUP
#line 242 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_tripword(yytext); }
      YY_BREAK
case 66:
YY_RULE_SETUP
#line 245 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_wordtype(yytext); }
      YY_BREAK
case 67:
YY_RULE_SETUP
#line 248 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblwordtype(yytext); }
      YY_BREAK
case 68:
YY_RULE_SETUP
#line 251 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_tripwordtype(yytext); }
      YY_BREAK
case 69:
YY_RULE_SETUP
#line 254 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_wordrowtype(yytext); }
      YY_BREAK
case 70:
YY_RULE_SETUP
#line 257 "scan.l"
{
      plpgsql_error_lineno = plpgsql_scanner_lineno();
      return plpgsql_parse_dblwordrowtype(yytext); }
      YY_BREAK
case 71:
YY_RULE_SETUP
#line 261 "scan.l"
{ return T_NUMBER;                  }
      YY_BREAK
case 72:
YY_RULE_SETUP
#line 263 "scan.l"
{ yyerror("unterminated quoted identifier"); }
      YY_BREAK
/* ----------
     * Ignore whitespace (including comments) but remember this happened
     * ----------
     */
case 73:
YY_RULE_SETUP
#line 269 "scan.l"
{ plpgsql_SpaceScanned = true; }
      YY_BREAK
/* ----------
     * Comment and literal handling is mostly copied from the core lexer
     * ----------
     */
case 74:
YY_RULE_SETUP
#line 275 "scan.l"
{
                              /* Set location in case of syntax error in comment */
                              SAVE_TOKEN_START();
                              xcdepth = 0;
                              BEGIN(xc);
                              plpgsql_SpaceScanned = true;
                        }
      YY_BREAK
case 75:
YY_RULE_SETUP
#line 283 "scan.l"
{
                              xcdepth++;
                        }
      YY_BREAK
case 76:
YY_RULE_SETUP
#line 287 "scan.l"
{
                              if (xcdepth <= 0)
                                    BEGIN(INITIAL);
                              else
                                    xcdepth--;
                        }
      YY_BREAK
case 77:
YY_RULE_SETUP
#line 294 "scan.l"
{
                              /* ignore */
                        }
      YY_BREAK
case 78:
YY_RULE_SETUP
#line 298 "scan.l"
{
                              /* ignore */
                        }
      YY_BREAK
case 79:
YY_RULE_SETUP
#line 302 "scan.l"
{
                              /* ignore */
                        }
      YY_BREAK
case YY_STATE_EOF(xc):
#line 306 "scan.l"
{ yyerror("unterminated /* comment"); }
      YY_BREAK
case 80:
YY_RULE_SETUP
#line 308 "scan.l"
{
                              SAVE_TOKEN_START();
                              if (standard_conforming_strings)
                                    BEGIN(xq);
                              else
                                    BEGIN(xe);
                        }
      YY_BREAK
case 81:
YY_RULE_SETUP
#line 315 "scan.l"
{
                              SAVE_TOKEN_START();
                              BEGIN(xe);
                        }
      YY_BREAK
case 82:
#line 320 "scan.l"
case 83:
YY_RULE_SETUP
#line 320 "scan.l"
{
                              yyless(1);
                              BEGIN(INITIAL);
                              /* adjust yytext/yyleng to describe whole string token */
                              yyleng += (yytext - start_charpos);
                              yytext = start_charpos;
                              return T_STRING;
                        }
      YY_BREAK
case 84:
YY_RULE_SETUP
#line 328 "scan.l"
{
                        }
      YY_BREAK
case 85:
YY_RULE_SETUP
#line 330 "scan.l"
{
                        }
      YY_BREAK
case 86:
YY_RULE_SETUP
#line 332 "scan.l"
{
                        }
      YY_BREAK
case 87:
YY_RULE_SETUP
#line 334 "scan.l"
{
                        }
      YY_BREAK
case 88:
YY_RULE_SETUP
#line 336 "scan.l"
{
                              /* ignore */
                        }
      YY_BREAK
case 89:
YY_RULE_SETUP
#line 339 "scan.l"
{
                              /* This is only needed for \ just before EOF */
                        }
      YY_BREAK
case YY_STATE_EOF(xq):
case YY_STATE_EOF(xe):
#line 342 "scan.l"
{ yyerror("unterminated quoted string"); }
      YY_BREAK
case 90:
YY_RULE_SETUP
#line 344 "scan.l"
{
                              SAVE_TOKEN_START();
                              dolqstart = pstrdup(yytext);
                              BEGIN(xdolq);
                        }
      YY_BREAK
case 91:
YY_RULE_SETUP
#line 349 "scan.l"
{
                              /* throw back all but the initial "$" */
                              yyless(1);
                              /* and treat it as {other} */
                              return yytext[0];
                        }
      YY_BREAK
case 92:
YY_RULE_SETUP
#line 355 "scan.l"
{
                              if (strcmp(yytext, dolqstart) == 0)
                              {
                                    pfree(dolqstart);
                                    BEGIN(INITIAL);
                                    /* adjust yytext/yyleng to describe whole string */
                                    yyleng += (yytext - start_charpos);
                                    yytext = start_charpos;
                                    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 93:
YY_RULE_SETUP
#line 375 "scan.l"
{
                        }
      YY_BREAK
case 94:
YY_RULE_SETUP
#line 377 "scan.l"
{
                        }
      YY_BREAK
case 95:
YY_RULE_SETUP
#line 379 "scan.l"
{
                              /* This is only needed for $ inside the quoted text */
                        }
      YY_BREAK
case YY_STATE_EOF(xdolq):
#line 382 "scan.l"
{ yyerror("unterminated dollar-quoted string"); }
      YY_BREAK
/* ----------
     * Any unmatched character is returned as is
     * ----------
     */
case 96:
YY_RULE_SETUP
#line 388 "scan.l"
{
                              return yytext[0];
                        }
      YY_BREAK
case 97:
YY_RULE_SETUP
#line 392 "scan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
      YY_BREAK
#line 1777 "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 >= 393 )
                        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 >= 393 )
                  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 == 392);

      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 392 "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 the translation of "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 the translation of "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)
{
      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;

      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);
}

Generated by  Doxygen 1.6.0   Back to index