#line 2 "psqlscan.c"

#line 4 "psqlscan.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

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

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

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

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

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 * if you want the limit (max/min) macros for int types. 
 */
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif

#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t; 
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN               (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN              (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN              (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX               (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX              (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX              (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX              (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX             (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX             (4294967295U)
#endif

#endif /* ! FLEXINT_H */

#ifdef __cplusplus

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

#else	/* ! __cplusplus */

/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)

#define YY_USE_CONST

#endif	/* defined (__STDC__) */
#endif	/* ! __cplusplus */

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

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

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

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

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

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

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

#define YY_END_OF_BUFFER_CHAR 0

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

/* The state buf must be large enough to hold one state per character in the main buffer.
 */
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

extern int yyleng;

extern FILE *yyin, *yyout;

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

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

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

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
	{
	FILE *yy_input_file;

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

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

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

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

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

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

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

	int yy_buffer_status;

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

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

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

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

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

/* yy_hold_char holds the character lost when 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 = 0;		/* 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 (FILE *input_file  );
void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
void yy_delete_buffer (YY_BUFFER_STATE b  );
void yy_flush_buffer (YY_BUFFER_STATE b  );
void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
void yypop_buffer_state (void );

static void yyensure_buffer_stack (void );
static void yy_load_buffer_state (void );
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );

#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )

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

void *yyalloc (yy_size_t  );
void *yyrealloc (void *,yy_size_t  );
void yyfree (void *  );

#define yy_new_buffer yy_create_buffer

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

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

#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

#define yywrap(n) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;

FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;

typedef int yy_state_type;

extern int yylineno;

int yylineno = 1;

extern char *yytext;
#define yytext_ptr yytext
static yyconst flex_int16_t yy_nxt[][38] =
    {
    {
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0
    },

    {
       33,   34,   35,   36,   35,   37,   38,   39,   40,   41,
       42,   43,   40,   40,   44,   45,   46,   47,   48,   48,
       49,   50,   51,   52,   53,   51,   54,   55,   56,   37,
       52,   51,   54,   51,   51,   55,   37,   51
    },

    {
       33,   34,   35,   36,   35,   37,   38,   39,   40,   41,
       42,   43,   40,   40,   44,   45,   46,   47,   48,   48,

       49,   50,   51,   52,   53,   51,   54,   55,   56,   37,
       52,   51,   54,   51,   51,   55,   37,   51
    },

    {
       33,   57,   57,   57,   57,   57,   57,   57,   57,   58,
       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
       57,   57,   57,   57,   57,   57,   57,   57
    },

    {
       33,   57,   57,   57,   57,   57,   57,   57,   57,   58,
       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
       57,   57,   57,   57,   57,   57,   57,   57,   57,   57,
       57,   57,   57,   57,   57,   57,   57,   57

    },

    {
       33,   59,   59,   59,   59,   60,   59,   59,   60,   59,
       59,   59,   61,   60,   59,   60,   59,   62,   59,   59,
       59,   59,   59,   59,   59,   59,   59,   59,   59,   60,
       59,   59,   59,   59,   59,   59,   60,   59
    },

    {
       33,   59,   59,   59,   59,   60,   59,   59,   60,   59,
       59,   59,   61,   60,   59,   60,   59,   62,   59,   59,
       59,   59,   59,   59,   59,   59,   59,   59,   59,   60,
       59,   59,   59,   59,   59,   59,   60,   59
    },

    {
       33,   63,   63,   63,   63,   63,   64,   63,   63,   63,
       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,

       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
       63,   63,   63,   63,   63,   63,   63,   63
    },

    {
       33,   63,   63,   63,   63,   63,   64,   63,   63,   63,
       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
       63,   63,   63,   63,   63,   63,   63,   63,   63,   63,
       63,   63,   63,   63,   63,   63,   63,   63
    },

    {
       33,   65,   65,   65,   65,   65,   65,   65,   65,   66,
       65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
       65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
       65,   65,   65,   65,   65,   65,   65,   65

    },

    {
       33,   65,   65,   65,   65,   65,   65,   65,   65,   66,
       65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
       65,   65,   65,   65,   65,   65,   65,   65,   65,   65,
       65,   65,   65,   65,   65,   65,   65,   65
    },

    {
       33,   67,   67,   68,   67,   67,   67,   67,   67,   69,
       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,
       67,   67,   67,   67,   67,   67,   67,   67,   70,   67,
       67,   67,   67,   67,   67,   67,   67,   67
    },

    {
       33,   67,   67,   68,   67,   67,   67,   67,   67,   69,
       67,   67,   67,   67,   67,   67,   67,   67,   67,   67,

       67,   67,   67,   67,   67,   67,   67,   67,   70,   67,
       67,   67,   67,   67,   67,   67,   67,   67
    },

    {
       33,   71,   71,   71,   71,   71,   71,   71,   71,   72,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   71
    },

    {
       33,   71,   71,   71,   71,   71,   71,   71,   71,   72,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   71,   71,   71,
       71,   71,   71,   71,   71,   71,   71,   71

    },

    {
       33,   73,   73,   74,   73,   73,   73,   75,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73
    },

    {
       33,   73,   73,   74,   73,   73,   73,   75,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73,   73,   73,
       73,   73,   73,   73,   73,   73,   73,   73
    },

    {
       33,   76,   77,   78,   77,   76,   76,   76,   76,   76,
       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,

       76,   76,   76,   76,   76,   76,   76,   76,   77,   76,
       76,   76,   76,   76,   76,   76,   76,   76
    },

    {
       33,   76,   77,   78,   77,   76,   76,   76,   76,   76,
       76,   76,   76,   76,   76,   76,   76,   76,   76,   76,
       76,   76,   76,   76,   76,   76,   76,   76,   77,   76,
       76,   76,   76,   76,   76,   76,   76,   76
    },

    {
       33,   79,   80,   81,   80,   79,   82,   79,   79,   83,
       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
       84,   79,   79,   79,   79,   79,   79,   79,   85,   86,
       79,   79,   79,   79,   79,   79,   87,   79

    },

    {
       33,   79,   80,   81,   80,   79,   82,   79,   79,   83,
       79,   79,   79,   79,   79,   79,   79,   79,   79,   79,
       84,   79,   79,   79,   79,   79,   79,   79,   85,   86,
       79,   79,   79,   79,   79,   79,   87,   79
    },

    {
       33,   88,   88,   88,   88,   88,   88,   88,   88,   89,
       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,
       88,   88,   88,   88,   88,   88,   88,   88,   90,   88,
       88,   88,   88,   88,   88,   88,   88,   88
    },

    {
       33,   88,   88,   88,   88,   88,   88,   88,   88,   89,
       88,   88,   88,   88,   88,   88,   88,   88,   88,   88,

       88,   88,   88,   88,   88,   88,   88,   88,   90,   88,
       88,   88,   88,   88,   88,   88,   88,   88
    },

    {
       33,   91,   91,   91,   91,   91,   91,   91,   91,   91,
       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
       91,   91,   91,   91,   91,   91,   91,   91,   91,   92,
       91,   91,   91,   91,   91,   91,   91,   91
    },

    {
       33,   91,   91,   91,   91,   91,   91,   91,   91,   91,
       91,   91,   91,   91,   91,   91,   91,   91,   91,   91,
       91,   91,   91,   91,   91,   91,   91,   91,   91,   92,
       91,   91,   91,   91,   91,   91,   91,   91

    },

    {
       33,   93,   94,   95,   94,   93,   96,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   97,   93,
       93,   93,   93,   93,   93,   93,   93,   93
    },

    {
       33,   93,   94,   95,   94,   93,   96,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
       93,   93,   93,   93,   93,   93,   93,   93,   97,   93,
       93,   93,   93,   93,   93,   93,   93,   93
    },

    {
       33,   98,   98,   98,   98,   98,   99,   98,   98,   98,
       98,   98,   98,   98,   98,   98,   98,   98,   98,   98,

       98,   98,   98,   98,   98,   98,   98,   98,   98,   98,
       98,   98,   98,   98,   98,   98,   98,   98
    },

    {
       33,   98,   98,   98,   98,   98,   99,   98,   98,   98,
       98,   98,   98,   98,   98,   98,   98,   98,   98,   98,
       98,   98,   98,   98,   98,   98,   98,   98,   98,   98,
       98,   98,   98,   98,   98,   98,   98,   98
    },

    {
       33,  100,  101,  102,  101,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100

    },

    {
       33,  100,  101,  102,  101,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100,  100,  100,
      100,  100,  100,  100,  100,  100,  100,  100
    },

    {
       33,  103,  103,  103,  103,  103,  103,  103,  103,  103,
      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,
      103,  103,  103,  103,  103,  103,  103,  103,  104,  103,
      103,  103,  103,  103,  103,  103,  103,  103
    },

    {
       33,  103,  103,  103,  103,  103,  103,  103,  103,  103,
      103,  103,  103,  103,  103,  103,  103,  103,  103,  103,

      103,  103,  103,  103,  103,  103,  103,  103,  104,  103,
      103,  103,  103,  103,  103,  103,  103,  103
    },

    {
      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33,
      -33,  -33,  -33,  -33,  -33,  -33,  -33,  -33
    },

    {
       33,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34,
      -34,  -34,  -34,  -34,  -34,  -34,  -34,  -34

    },

    {
       33,  -35,  105,  105,  105,  -35,  -35,  -35,  -35,  -35,
      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35,
      -35,  -35,  -35,  -35,  -35,  -35,  -35,  -35
    },

    {
       33,  -36,  105,  105,  105,  -36,  -36,  -36,  -36,  -36,
      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36,
      -36,  -36,  -36,  -36,  -36,  -36,  -36,  -36
    },

    {
       33,  -37,  -37,  -37,  -37,  106,  -37,  -37,  106,  -37,
      -37,  -37,  106,  106,  -37,  106,  -37,  106,  -37,  -37,

      -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  -37,  106,
      -37,  -37,  -37,  -37,  -37,  -37,  106,  -37
    },

    {
       33,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38,
      -38,  -38,  -38,  -38,  -38,  -38,  -38,  -38
    },

    {
       33,  -39,  -39,  -39,  -39,  -39,  -39,  107,  -39,  -39,
      -39,  -39,  -39,  -39,  -39,  -39,  -39,  -39,  108,  108,
      -39,  -39,  109,  109,  109,  109,  109,  109,  -39,  -39,
      109,  109,  109,  109,  109,  109,  -39,  109

    },

    {
       33,  -40,  -40,  -40,  -40,  106,  -40,  -40,  106,  -40,
      -40,  -40,  106,  106,  -40,  106,  -40,  106,  -40,  -40,
      -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  -40,  106,
      -40,  -40,  -40,  -40,  -40,  -40,  106,  -40
    },

    {
       33,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41,
      -41,  -41,  -41,  -41,  -41,  -41,  -41,  -41
    },

    {
       33,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,
      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,

      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42,
      -42,  -42,  -42,  -42,  -42,  -42,  -42,  -42
    },

    {
       33,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43,
      -43,  -43,  -43,  -43,  -43,  -43,  -43,  -43
    },

    {
       33,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44,
      -44,  -44,  -44,  -44,  -44,  -44,  -44,  -44

    },

    {
       33,  -45,  -45,  -45,  -45,  106,  -45,  -45,  106,  -45,
      -45,  -45,  106,  106,  -45,  110,  -45,  106,  -45,  -45,
      -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  -45,  106,
      -45,  -45,  -45,  -45,  -45,  -45,  106,  -45
    },

    {
       33,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
      -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  111,  111,
      -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46,
      -46,  -46,  -46,  -46,  -46,  -46,  -46,  -46
    },

    {
       33,  -47,  -47,  -47,  -47,  106,  -47,  -47,  106,  -47,
      -47,  -47,  112,  106,  -47,  106,  -47,  106,  -47,  -47,

      -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  -47,  106,
      -47,  -47,  -47,  -47,  -47,  -47,  106,  -47
    },

    {
       33,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48,
      -48,  -48,  -48,  -48,  -48,  -48,  113,  -48,  114,  114,
      -48,  -48,  -48,  -48,  115,  -48,  -48,  -48,  -48,  -48,
      -48,  -48,  -48,  -48,  -48,  -48,  -48,  -48
    },

    {
       33,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,
      -49,  -49,  -49,  -49,  -49,  -49,  -49,  -49,  116,  116,
      117,  -49,  116,  116,  116,  116,  116,  116,  -49,  -49,
      116,  116,  116,  116,  116,  116,  -49,  -49

    },

    {
       33,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
      -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
      -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50,
      -50,  -50,  -50,  -50,  -50,  -50,  -50,  -50
    },

    {
       33,  -51,  -51,  -51,  -51,  -51,  -51,  118,  -51,  -51,
      -51,  -51,  -51,  -51,  -51,  -51,  -51,  -51,  118,  118,
      -51,  -51,  118,  118,  118,  118,  118,  118,  -51,  -51,
      118,  118,  118,  118,  118,  118,  -51,  118
    },

    {
       33,  -52,  -52,  -52,  -52,  -52,  -52,  118,  -52,  119,
      -52,  -52,  -52,  -52,  -52,  -52,  -52,  -52,  118,  118,

      -52,  -52,  118,  118,  118,  118,  118,  118,  -52,  -52,
      118,  118,  118,  118,  118,  118,  -52,  118
    },

    {
       33,  -53,  -53,  -53,  -53,  -53,  -53,  118,  -53,  120,
      -53,  -53,  -53,  -53,  -53,  -53,  -53,  -53,  118,  118,
      -53,  -53,  118,  118,  118,  118,  118,  118,  -53,  -53,
      118,  118,  118,  118,  118,  118,  -53,  118
    },

    {
       33,  -54,  -54,  -54,  -54,  -54,  -54,  118,  -54,  121,
      -54,  -54,  -54,  -54,  -54,  -54,  -54,  -54,  118,  118,
      -54,  -54,  118,  118,  118,  118,  118,  118,  -54,  -54,
      118,  118,  118,  118,  118,  118,  -54,  118

    },

    {
       33,  -55,  -55,  -55,  -55,  -55,  -55,  118,  -55,  122,
      -55,  -55,  -55,  -55,  -55,  -55,  -55,  -55,  118,  118,
      -55,  -55,  118,  118,  118,  118,  118,  118,  -55,  -55,
      118,  118,  118,  118,  118,  118,  -55,  118
    },

    {
       33,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
      -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
      123,  123,  -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56,
      -56,  -56,  -56,  -56,  -56,  -56,  -56,  -56
    },

    {
       33,  124,  124,  124,  124,  124,  124,  124,  124,  -57,
      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,

      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
      124,  124,  124,  124,  124,  124,  124,  124
    },

    {
       33,  -58,  125,  126,  126,  -58,  -58,  -58,  -58,  -58,
      -58,  -58,  -58,  -58,  -58,  127,  -58,  -58,  -58,  -58,
      -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58,
      -58,  -58,  -58,  -58,  -58,  -58,  -58,  -58
    },

    {
       33,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128,  -59,  128,  128,  128,  128,  -59,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128

    },

    {
       33,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128,  -60,  128,  128,  128,  128,  -60,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128
    },

    {
       33,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,
      -61,  -61,  129,  -61,  -61,  -61,  -61,  130,  -61,  -61,
      -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61,
      -61,  -61,  -61,  -61,  -61,  -61,  -61,  -61
    },

    {
       33,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
      -62,  -62,  131,  -62,  -62,  -62,  -62,  -62,  -62,  -62,

      -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62,
      -62,  -62,  -62,  -62,  -62,  -62,  -62,  -62
    },

    {
       33,  132,  132,  132,  132,  132,  -63,  132,  132,  132,
      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
      132,  132,  132,  132,  132,  132,  132,  132
    },

    {
       33,  -64,  -64,  -64,  -64,  -64,  133,  -64,  -64,  -64,
      -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,
      -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64,
      -64,  -64,  -64,  -64,  -64,  -64,  -64,  -64

    },

    {
       33,  134,  134,  134,  134,  134,  134,  134,  134,  -65,
      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
      134,  134,  134,  134,  134,  134,  134,  134
    },

    {
       33,  -66,  135,  136,  136,  -66,  -66,  -66,  -66,  -66,
      -66,  -66,  -66,  -66,  -66,  137,  -66,  -66,  -66,  -66,
      -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66,
      -66,  -66,  -66,  -66,  -66,  -66,  -66,  -66
    },

    {
       33,  138,  138,  138,  138,  138,  138,  138,  138,  -67,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,

      138,  138,  138,  138,  138,  138,  138,  138,  -67,  138,
      138,  138,  138,  138,  138,  138,  138,  138
    },

    {
       33,  138,  138,  138,  138,  138,  138,  138,  138,  -68,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  138,  138,  138,  138,  138,  -68,  138,
      138,  138,  138,  138,  138,  138,  138,  138
    },

    {
       33,  -69,  139,  140,  140,  -69,  -69,  -69,  -69,  141,
      -69,  -69,  -69,  -69,  -69,  142,  -69,  -69,  -69,  -69,
      -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69,
      -69,  -69,  -69,  -69,  -69,  -69,  -69,  -69

    },

    {
       33,  143,  143,  143,  143,  143,  143,  143,  143,  143,
      143,  143,  143,  143,  143,  143,  143,  143,  144,  143,
      143,  143,  143,  143,  143,  143,  143,  143,  143,  143,
      143,  143,  143,  143,  143,  145,  143,  143
    },

    {
       33,  146,  146,  146,  146,  146,  146,  146,  146,  -71,
      146,  146,  146,  146,  146,  146,  146,  146,  146,  146,
      146,  146,  146,  146,  146,  146,  146,  146,  146,  146,
      146,  146,  146,  146,  146,  146,  146,  146
    },

    {
       33,  -72,  139,  140,  140,  -72,  -72,  -72,  -72,  141,
      -72,  -72,  -72,  -72,  -72,  142,  -72,  -72,  -72,  -72,

      -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72,
      -72,  -72,  -72,  -72,  -72,  -72,  -72,  -72
    },

    {
       33,  147,  147,  147,  147,  147,  147,  -73,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147
    },

    {
       33,  147,  147,  147,  147,  147,  147,  -74,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147

    },

    {
       33,  -75,  -75,  -75,  -75,  -75,  -75,  148,  -75,  -75,
      -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,  -75,
      -75,  -75,  149,  149,  149,  149,  149,  149,  -75,  -75,
      149,  149,  149,  149,  149,  149,  -75,  149
    },

    {
       33,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
      -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
      -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
      -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76
    },

    {
       33,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,
      -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,

      -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77,
      -77,  -77,  -77,  -77,  -77,  -77,  -77,  -77
    },

    {
       33,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78,
      -78,  -78,  -78,  -78,  -78,  -78,  -78,  -78
    },

    {
       33,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
      -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
      -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79,
      -79,  -79,  -79,  -79,  -79,  -79,  -79,  -79

    },

    {
       33,  -80,  150,  150,  150,  -80,  -80,  -80,  -80,  -80,
      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80,
      -80,  -80,  -80,  -80,  -80,  -80,  -80,  -80
    },

    {
       33,  -81,  150,  150,  150,  -81,  -81,  -81,  -81,  -81,
      -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,
      -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81,
      -81,  -81,  -81,  -81,  -81,  -81,  -81,  -81
    },

    {
       33,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,
      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,

      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82,
      -82,  -82,  -82,  -82,  -82,  -82,  -82,  -82
    },

    {
       33,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,
      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,
      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83,
      -83,  -83,  -83,  -83,  -83,  -83,  -83,  -83
    },

    {
       33,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,
      -84,  -84,  -84,  -84,  -84,  -84,  -84,  -84,  151,  151,
      -84,  -84,  151,  151,  151,  151,  151,  151,  -84,  -84,
      151,  151,  151,  151,  151,  151,  -84,  -84

    },

    {
       33,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85,
      -85,  -85,  -85,  -85,  -85,  -85,  -85,  -85
    },

    {
       33,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
      -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
      -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86,
      -86,  -86,  -86,  -86,  -86,  -86,  -86,  -86
    },

    {
       33,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,

      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87,
      -87,  -87,  -87,  -87,  -87,  -87,  -87,  -87
    },

    {
       33,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
      -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
      -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88,
      -88,  -88,  -88,  -88,  -88,  -88,  -88,  -88
    },

    {
       33,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  152,
      -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
      -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89,
      -89,  -89,  -89,  -89,  -89,  -89,  -89,  -89

    },

    {
       33,  153,  153,  -90,  153,  153,  153,  153,  153,  153,
      153,  153,  153,  153,  153,  153,  153,  153,  154,  153,
      153,  153,  153,  153,  153,  153,  153,  153,  153,  153,
      155,  156,  157,  158,  159,  160,  153,  153
    },

    {
       33,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
      -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
      -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91,
      -91,  -91,  -91,  -91,  -91,  -91,  -91,  -91
    },

    {
       33,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,
      -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,

      -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92,
      -92,  -92,  -92,  -92,  -92,  -92,  -92,  -92
    },

    {
       33,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93,
      -93,  -93,  -93,  -93,  -93,  -93,  -93,  -93
    },

    {
       33,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,
      -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,
      -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94,
      -94,  -94,  -94,  -94,  -94,  -94,  -94,  -94

    },

    {
       33,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,
      -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,
      -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95,
      -95,  -95,  -95,  -95,  -95,  -95,  -95,  -95
    },

    {
       33,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,
      -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,
      -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96,
      -96,  -96,  -96,  -96,  -96,  -96,  -96,  -96
    },

    {
       33,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,
      -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,

      -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,
      -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97
    },

    {
       33,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,
      -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,
      -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98,
      -98,  -98,  -98,  -98,  -98,  -98,  -98,  -98
    },

    {
       33,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,
      -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,
      -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99,
      -99,  -99,  -99,  -99,  -99,  -99,  -99,  -99

    },

    {
       33, -100, -100, -100, -100, -100, -100, -100, -100, -100,
     -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
     -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,
     -100, -100, -100, -100, -100, -100, -100, -100
    },

    {
       33, -101,  161,  161,  161, -101, -101, -101, -101, -101,
     -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
     -101, -101, -101, -101, -101, -101, -101, -101, -101, -101,
     -101, -101, -101, -101, -101, -101, -101, -101
    },

    {
       33, -102,  161,  161,  161, -102, -102, -102, -102, -102,
     -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,

     -102, -102, -102, -102, -102, -102, -102, -102, -102, -102,
     -102, -102, -102, -102, -102, -102, -102, -102
    },

    {
       33, -103, -103, -103, -103, -103, -103, -103, -103, -103,
     -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
     -103, -103, -103, -103, -103, -103, -103, -103, -103, -103,
     -103, -103, -103, -103, -103, -103, -103, -103
    },

    {
       33, -104, -104, -104, -104, -104, -104, -104, -104, -104,
     -104, -104, -104, -104, -104, -104, -104, -104, -104, -104,
     -104, -104, -104, -104, -104, -104, -104, -104,  162, -104,
     -104, -104, -104, -104, -104, -104, -104, -104

    },

    {
       33, -105,  105,  105,  105, -105, -105, -105, -105, -105,
     -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
     -105, -105, -105, -105, -105, -105, -105, -105, -105, -105,
     -105, -105, -105, -105, -105, -105, -105, -105
    },

    {
       33, -106, -106, -106, -106,  106, -106, -106,  106, -106,
     -106, -106,  106,  106, -106,  106, -106,  106, -106, -106,
     -106, -106, -106, -106, -106, -106, -106, -106, -106,  106,
     -106, -106, -106, -106, -106, -106,  106, -106
    },

    {
       33, -107, -107, -107, -107, -107, -107, -107, -107, -107,
     -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,

     -107, -107, -107, -107, -107, -107, -107, -107, -107, -107,
     -107, -107, -107, -107, -107, -107, -107, -107
    },

    {
       33, -108, -108, -108, -108, -108, -108, -108, -108, -108,
     -108, -108, -108, -108, -108, -108, -108, -108,  108,  108,
     -108, -108, -108, -108, -108, -108, -108, -108, -108, -108,
     -108, -108, -108, -108, -108, -108, -108, -108
    },

    {
       33, -109, -109, -109, -109, -109, -109,  107, -109, -109,
     -109, -109, -109, -109, -109, -109, -109, -109,  163,  163,
     -109, -109,  163,  163,  163,  163,  163,  163, -109, -109,
      163,  163,  163,  163,  163,  163, -109,  163

    },

    {
       33,  164,  164, -110, -110,  165,  164,  164,  165,  164,
      164,  164,  165,  165,  164,  165,  164,  165,  164,  164,
      164,  164,  164,  164,  164,  164,  164,  164,  164,  165,
      164,  164,  164,  164,  164,  164,  165,  164
    },

    {
       33, -111, -111, -111, -111, -111, -111, -111, -111, -111,
     -111, -111, -111, -111, -111, -111, -111, -111,  111,  111,
     -111, -111, -111, -111,  115, -111, -111, -111, -111, -111,
     -111, -111, -111, -111, -111, -111, -111, -111
    },

    {
       33, -112, -112, -112, -112,  166, -112, -112,  166, -112,
     -112, -112,  166,  166, -112,  166, -112,  166, -112, -112,

     -112, -112, -112, -112, -112, -112, -112, -112, -112,  166,
     -112, -112, -112, -112, -112, -112,  166, -112
    },

    {
       33, -113, -113, -113, -113, -113, -113, -113, -113, -113,
     -113, -113, -113, -113, -113, -113, -113, -113,  167,  167,
     -113, -113, -113, -113,  115, -113, -113, -113, -113, -113,
     -113, -113, -113, -113, -113, -113, -113, -113
    },

    {
       33, -114, -114, -114, -114, -114, -114, -114, -114, -114,
     -114, -114, -114, -114, -114, -114,  113, -114,  114,  114,
     -114, -114, -114, -114,  115, -114, -114, -114, -114, -114,
     -114, -114, -114, -114, -114, -114, -114, -114

    },

    {
       33, -115, -115, -115, -115, -115, -115, -115, -115, -115,
     -115, -115, -115,  168, -115,  168, -115, -115,  169,  169,
     -115, -115, -115, -115, -115, -115, -115, -115, -115, -115,
     -115, -115, -115, -115, -115, -115, -115, -115
    },

    {
       33, -116, -116, -116, -116, -116, -116, -116, -116, -116,
     -116, -116, -116, -116, -116, -116, -116, -116,  116,  116,
     -116, -116,  116,  116,  116,  116,  116,  116, -116, -116,
      116,  116,  116,  116,  116,  116, -116, -116
    },

    {
       33, -117, -117, -117, -117, -117, -117, -117, -117, -117,
     -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,

     -117, -117, -117, -117, -117, -117, -117, -117, -117, -117,
     -117, -117, -117, -117, -117, -117, -117, -117
    },

    {
       33, -118, -118, -118, -118, -118, -118,  118, -118, -118,
     -118, -118, -118, -118, -118, -118, -118, -118,  118,  118,
     -118, -118,  118,  118,  118,  118,  118,  118, -118, -118,
      118,  118,  118,  118,  118,  118, -118,  118
    },

    {
       33, -119, -119, -119, -119, -119, -119, -119, -119, -119,
     -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
     -119, -119, -119, -119, -119, -119, -119, -119, -119, -119,
     -119, -119, -119, -119, -119, -119, -119, -119

    },

    {
       33, -120, -120, -120, -120, -120, -120, -120, -120, -120,
     -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
     -120, -120, -120, -120, -120, -120, -120, -120, -120, -120,
     -120, -120, -120, -120, -120, -120, -120, -120
    },

    {
       33, -121, -121, -121, -121, -121, -121, -121, -121, -121,
     -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
     -121, -121, -121, -121, -121, -121, -121, -121, -121, -121,
     -121, -121, -121, -121, -121, -121, -121, -121
    },

    {
       33, -122, -122, -122, -122, -122, -122, -122, -122, -122,
     -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,

     -122, -122, -122, -122, -122, -122, -122, -122, -122, -122,
     -122, -122, -122, -122, -122, -122, -122, -122
    },

    {
       33, -123, -123, -123, -123, -123, -123, -123, -123, -123,
     -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
     -123, -123, -123, -123, -123, -123, -123, -123, -123, -123,
     -123, -123, -123, -123, -123, -123, -123, -123
    },

    {
       33,  124,  124,  124,  124,  124,  124,  124,  124, -124,
      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
      124,  124,  124,  124,  124,  124,  124,  124,  124,  124,
      124,  124,  124,  124,  124,  124,  124,  124

    },

    {
       33, -125,  125,  126,  126, -125, -125, -125, -125, -125,
     -125, -125, -125, -125, -125,  127, -125, -125, -125, -125,
     -125, -125, -125, -125, -125, -125, -125, -125, -125, -125,
     -125, -125, -125, -125, -125, -125, -125, -125
    },

    {
       33, -126,  170,  170,  170, -126, -126, -126, -126,  171,
     -126, -126, -126, -126, -126,  172, -126, -126, -126, -126,
     -126, -126, -126, -126, -126, -126, -126, -126, -126, -126,
     -126, -126, -126, -126, -126, -126, -126, -126
    },

    {
       33, -127, -127, -127, -127, -127, -127, -127, -127, -127,
     -127, -127, -127, -127, -127,  173, -127, -127, -127, -127,

     -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
     -127, -127, -127, -127, -127, -127, -127, -127
    },

    {
       33,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128, -128,  128,  128,  128,  128, -128,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128,  128,  128,
      128,  128,  128,  128,  128,  128,  128,  128
    },

    {
       33, -129, -129, -129, -129, -129, -129, -129, -129, -129,
     -129, -129,  129, -129, -129, -129, -129,  130, -129, -129,
     -129, -129, -129, -129, -129, -129, -129, -129, -129, -129,
     -129, -129, -129, -129, -129, -129, -129, -129

    },

    {
       33, -130, -130, -130, -130, -130, -130, -130, -130, -130,
     -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
     -130, -130, -130, -130, -130, -130, -130, -130, -130, -130,
     -130, -130, -130, -130, -130, -130, -130, -130
    },

    {
       33, -131, -131, -131, -131,  174, -131, -131,  174, -131,
     -131, -131,  174,  174, -131,  174, -131,  174, -131, -131,
     -131, -131, -131, -131, -131, -131, -131, -131, -131,  174,
     -131, -131, -131, -131, -131, -131,  174, -131
    },

    {
       33,  132,  132,  132,  132,  132, -132,  132,  132,  132,
      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,

      132,  132,  132,  132,  132,  132,  132,  132,  132,  132,
      132,  132,  132,  132,  132,  132,  132,  132
    },

    {
       33, -133, -133, -133, -133, -133, -133, -133, -133, -133,
     -133, -133, -133, -133, -133, -133, -133, -133, -133, -133,
     -133, -133, -133, -133, -133, -133, -133, -133, -133, -133,
     -133, -133, -133, -133, -133, -133, -133, -133
    },

    {
       33,  134,  134,  134,  134,  134,  134,  134,  134, -134,
      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
      134,  134,  134,  134,  134,  134,  134,  134,  134,  134,
      134,  134,  134,  134,  134,  134,  134,  134

    },

    {
       33, -135,  135,  136,  136, -135, -135, -135, -135, -135,
     -135, -135, -135, -135, -135,  137, -135, -135, -135, -135,
     -135, -135, -135, -135, -135, -135, -135, -135, -135, -135,
     -135, -135, -135, -135, -135, -135, -135, -135
    },

    {
       33, -136,  175,  175,  175, -136, -136, -136, -136,  176,
     -136, -136, -136, -136, -136,  177, -136, -136, -136, -136,
     -136, -136, -136, -136, -136, -136, -136, -136, -136, -136,
     -136, -136, -136, -136, -136, -136, -136, -136
    },

    {
       33, -137, -137, -137, -137, -137, -137, -137, -137, -137,
     -137, -137, -137, -137, -137,  178, -137, -137, -137, -137,

     -137, -137, -137, -137, -137, -137, -137, -137, -137, -137,
     -137, -137, -137, -137, -137, -137, -137, -137
    },

    {
       33,  138,  138,  138,  138,  138,  138,  138,  138, -138,
      138,  138,  138,  138,  138,  138,  138,  138,  138,  138,
      138,  138,  138,  138,  138,  138,  138,  138, -138,  138,
      138,  138,  138,  138,  138,  138,  138,  138
    },

    {
       33, -139,  139,  140,  140, -139, -139, -139, -139, -139,
     -139, -139, -139, -139, -139,  142, -139, -139, -139, -139,
     -139, -139, -139, -139, -139, -139, -139, -139, -139, -139,
     -139, -139, -139, -139, -139, -139, -139, -139

    },

    {
       33, -140,  179,  179,  179, -140, -140, -140, -140,  180,
     -140, -140, -140, -140, -140,  181, -140, -140, -140, -140,
     -140, -140, -140, -140, -140, -140, -140, -140, -140, -140,
     -140, -140, -140, -140, -140, -140, -140, -140
    },

    {
       33, -141, -141, -141, -141, -141, -141, -141, -141, -141,
     -141, -141, -141, -141, -141, -141, -141, -141, -141, -141,
     -141, -141, -141, -141, -141, -141, -141, -141, -141, -141,
     -141, -141, -141, -141, -141, -141, -141, -141
    },

    {
       33, -142, -142, -142, -142, -142, -142, -142, -142, -142,
     -142, -142, -142, -142, -142,  182, -142, -142, -142, -142,

     -142, -142, -142, -142, -142, -142, -142, -142, -142, -142,
     -142, -142, -142, -142, -142, -142, -142, -142
    },

    {
       33, -143, -143, -143, -143, -143, -143, -143, -143, -143,
     -143, -143, -143, -143, -143, -143, -143, -143, -143, -143,
     -143, -143, -143, -143, -143, -143, -143, -143, -143, -143,
     -143, -143, -143, -143, -143, -143, -143, -143
    },

    {
       33, -144, -144, -144, -144, -144, -144, -144, -144, -144,
     -144, -144, -144, -144, -144, -144, -144, -144,  183, -144,
     -144, -144, -144, -144, -144, -144, -144, -144, -144, -144,
     -144, -144, -144, -144, -144, -144, -144, -144

    },

    {
       33, -145, -145, -145, -145, -145, -145, -145, -145, -145,
     -145, -145, -145, -145, -145, -145, -145, -145,  184,  184,
     -145, -145,  184,  184,  184, -145, -145, -145, -145, -145,
      184,  184, -145, -145, -145, -145, -145, -145
    },

    {
       33,  146,  146,  146,  146,  146,  146,  146,  146, -146,
      146,  146,  146,  146,  146,  146,  146,  146,  146,  146,
      146,  146,  146,  146,  146,  146,  146,  146,  146,  146,
      146,  146,  146,  146,  146,  146,  146,  146
    },

    {
       33,  147,  147,  147,  147,  147,  147, -147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,

      147,  147,  147,  147,  147,  147,  147,  147,  147,  147,
      147,  147,  147,  147,  147,  147,  147,  147
    },

    {
       33, -148, -148, -148, -148, -148, -148, -148, -148, -148,
     -148, -148, -148, -148, -148, -148, -148, -148, -148, -148,
     -148, -148, -148, -148, -148, -148, -148, -148, -148, -148,
     -148, -148, -148, -148, -148, -148, -148, -148
    },

    {
       33, -149, -149, -149, -149, -149, -149,  148, -149, -149,
     -149, -149, -149, -149, -149, -149, -149, -149,  185,  185,
     -149, -149,  185,  185,  185,  185,  185,  185, -149, -149,
      185,  185,  185,  185,  185,  185, -149,  185

    },

    {
       33, -150,  150,  150,  150, -150, -150, -150, -150, -150,
     -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
     -150, -150, -150, -150, -150, -150, -150, -150, -150, -150,
     -150, -150, -150, -150, -150, -150, -150, -150
    },

    {
       33, -151, -151, -151, -151, -151, -151, -151, -151, -151,
     -151, -151, -151, -151, -151, -151, -151, -151,  151,  151,
     -151, -151,  151,  151,  151,  151,  151,  151, -151, -151,
      151,  151,  151,  151,  151,  151, -151, -151
    },

    {
       33, -152, -152, -152, -152, -152, -152, -152, -152, -152,
     -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,

     -152, -152, -152, -152, -152, -152, -152, -152, -152, -152,
     -152, -152, -152, -152, -152, -152, -152, -152
    },

    {
       33, -153, -153, -153, -153, -153, -153, -153, -153, -153,
     -153, -153, -153, -153, -153, -153, -153, -153, -153, -153,
     -153, -153, -153, -153, -153, -153, -153, -153, -153, -153,
     -153, -153, -153, -153, -153, -153, -153, -153
    },

    {
       33, -154, -154, -154, -154, -154, -154, -154, -154, -154,
     -154, -154, -154, -154, -154, -154, -154, -154,  186, -154,
     -154, -154, -154, -154, -154, -154, -154, -154, -154, -154,
     -154, -154, -154, -154, -154, -154, -154, -154

    },

    {
       33, -155, -155, -155, -155, -155, -155, -155, -155, -155,
     -155, -155, -155, -155, -155, -155, -155, -155, -155, -155,
     -155, -155, -155, -155, -155, -155, -155, -155, -155, -155,
     -155, -155, -155, -155, -155, -155, -155, -155
    },

    {
       33, -156, -156, -156, -156, -156, -156, -156, -156, -156,
     -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
     -156, -156, -156, -156, -156, -156, -156, -156, -156, -156,
     -156, -156, -156, -156, -156, -156, -156, -156
    },

    {
       33, -157, -157, -157, -157, -157, -157, -157, -157, -157,
     -157, -157, -157, -157, -157, -157, -157, -157, -157, -157,

     -157, -157, -157, -157, -157, -157, -157, -157, -157, -157,
     -157, -157, -157, -157, -157, -157, -157, -157
    },

    {
       33, -158, -158, -158, -158, -158, -158, -158, -158, -158,
     -158, -158, -158, -158, -158, -158, -158, -158, -158, -158,
     -158, -158, -158, -158, -158, -158, -158, -158, -158, -158,
     -158, -158, -158, -158, -158, -158, -158, -158
    },

    {
       33, -159, -159, -159, -159, -159, -159, -159, -159, -159,
     -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
     -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
     -159, -159, -159, -159, -159, -159, -159, -159

    },

    {
       33, -160, -160, -160, -160, -160, -160, -160, -160, -160,
     -160, -160, -160, -160, -160, -160, -160, -160,  187,  187,
     -160, -160,  187,  187,  187, -160, -160, -160, -160, -160,
      187,  187, -160, -160, -160, -160, -160, -160
    },

    {
       33, -161,  161,  161,  161, -161, -161, -161, -161, -161,
     -161, -161, -161, -161, -161, -161, -161, -161, -161, -161,
     -161, -161, -161, -161, -161, -161, -161, -161, -161, -161,
     -161, -161, -161, -161, -161, -161, -161, -161
    },

    {
       33, -162, -162, -162, -162, -162, -162, -162, -162, -162,
     -162, -162, -162, -162, -162, -162, -162, -162, -162, -162,

     -162, -162, -162, -162, -162, -162, -162, -162, -162, -162,
     -162, -162, -162, -162, -162, -162, -162, -162
    },

    {
       33, -163, -163, -163, -163, -163, -163,  107, -163, -163,
     -163, -163, -163, -163, -163, -163, -163, -163,  163,  163,
     -163, -163,  163,  163,  163,  163,  163,  163, -163, -163,
      163,  163,  163,  163,  163,  163, -163,  163
    },

    {
       33,  164,  164, -164, -164,  164,  164,  164,  164,  164,
      164,  164,  164,  164,  164,  164,  164,  164,  164,  164,
      164,  164,  164,  164,  164,  164,  164,  164,  164,  164,
      164,  164,  164,  164,  164,  164,  164,  164

    },

    {
       33,  164,  164, -165, -165,  165,  164,  164,  165,  164,
      164,  164,  165,  165,  164,  165,  164,  165,  164,  164,
      164,  164,  164,  164,  164,  164,  164,  164,  164,  165,
      164,  164,  164,  164,  164,  164,  165,  164
    },

    {
       33, -166, -166, -166, -166,  166, -166, -166,  166, -166,
     -166, -166,  166,  166, -166,  166, -166,  166, -166, -166,
     -166, -166, -166, -166, -166, -166, -166, -166, -166,  166,
     -166, -166, -166, -166, -166, -166,  166, -166
    },

    {
       33, -167, -167, -167, -167, -167, -167, -167, -167, -167,
     -167, -167, -167, -167, -167, -167, -167, -167,  167,  167,

     -167, -167, -167, -167,  115, -167, -167, -167, -167, -167,
     -167, -167, -167, -167, -167, -167, -167, -167
    },

    {
       33, -168, -168, -168, -168, -168, -168, -168, -168, -168,
     -168, -168, -168, -168, -168, -168, -168, -168,  169,  169,
     -168, -168, -168, -168, -168, -168, -168, -168, -168, -168,
     -168, -168, -168, -168, -168, -168, -168, -168
    },

    {
       33, -169, -169, -169, -169, -169, -169, -169, -169, -169,
     -169, -169, -169, -169, -169, -169, -169, -169,  169,  169,
     -169, -169, -169, -169, -169, -169, -169, -169, -169, -169,
     -169, -169, -169, -169, -169, -169, -169, -169

    },

    {
       33, -170,  170,  170,  170, -170, -170, -170, -170,  171,
     -170, -170, -170, -170, -170,  172, -170, -170, -170, -170,
     -170, -170, -170, -170, -170, -170, -170, -170, -170, -170,
     -170, -170, -170, -170, -170, -170, -170, -170
    },

    {
       33, -171, -171, -171, -171, -171, -171, -171, -171, -171,
     -171, -171, -171, -171, -171, -171, -171, -171, -171, -171,
     -171, -171, -171, -171, -171, -171, -171, -171, -171, -171,
     -171, -171, -171, -171, -171, -171, -171, -171
    },

    {
       33, -172, -172, -172, -172, -172, -172, -172, -172, -172,
     -172, -172, -172, -172, -172,  188, -172, -172, -172, -172,

     -172, -172, -172, -172, -172, -172, -172, -172, -172, -172,
     -172, -172, -172, -172, -172, -172, -172, -172
    },

    {
       33,  189,  190,  126,  126,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  191,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189
    },

    {
       33, -174, -174, -174, -174,  174, -174, -174,  174, -174,
     -174, -174,  174,  174, -174,  174, -174,  174, -174, -174,
     -174, -174, -174, -174, -174, -174, -174, -174, -174,  174,
     -174, -174, -174, -174, -174, -174,  174, -174

    },

    {
       33, -175,  175,  175,  175, -175, -175, -175, -175,  176,
     -175, -175, -175, -175, -175,  177, -175, -175, -175, -175,
     -175, -175, -175, -175, -175, -175, -175, -175, -175, -175,
     -175, -175, -175, -175, -175, -175, -175, -175
    },

    {
       33, -176, -176, -176, -176, -176, -176, -176, -176, -176,
     -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
     -176, -176, -176, -176, -176, -176, -176, -176, -176, -176,
     -176, -176, -176, -176, -176, -176, -176, -176
    },

    {
       33, -177, -177, -177, -177, -177, -177, -177, -177, -177,
     -177, -177, -177, -177, -177,  192, -177, -177, -177, -177,

     -177, -177, -177, -177, -177, -177, -177, -177, -177, -177,
     -177, -177, -177, -177, -177, -177, -177, -177
    },

    {
       33,  193,  194,  136,  136,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  195,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193
    },

    {
       33, -179,  179,  179,  179, -179, -179, -179, -179,  180,
     -179, -179, -179, -179, -179,  181, -179, -179, -179, -179,
     -179, -179, -179, -179, -179, -179, -179, -179, -179, -179,
     -179, -179, -179, -179, -179, -179, -179, -179

    },

    {
       33, -180, -180, -180, -180, -180, -180, -180, -180, -180,
     -180, -180, -180, -180, -180, -180, -180, -180, -180, -180,
     -180, -180, -180, -180, -180, -180, -180, -180, -180, -180,
     -180, -180, -180, -180, -180, -180, -180, -180
    },

    {
       33, -181, -181, -181, -181, -181, -181, -181, -181, -181,
     -181, -181, -181, -181, -181,  196, -181, -181, -181, -181,
     -181, -181, -181, -181, -181, -181, -181, -181, -181, -181,
     -181, -181, -181, -181, -181, -181, -181, -181
    },

    {
       33,  197,  198,  140,  140,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  199,  197,  197,  197,  197,

      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197
    },

    {
       33, -183, -183, -183, -183, -183, -183, -183, -183, -183,
     -183, -183, -183, -183, -183, -183, -183, -183,  200, -183,
     -183, -183, -183, -183, -183, -183, -183, -183, -183, -183,
     -183, -183, -183, -183, -183, -183, -183, -183
    },

    {
       33, -184, -184, -184, -184, -184, -184, -184, -184, -184,
     -184, -184, -184, -184, -184, -184, -184, -184,  201,  201,
     -184, -184,  201,  201,  201, -184, -184, -184, -184, -184,
      201,  201, -184, -184, -184, -184, -184, -184

    },

    {
       33, -185, -185, -185, -185, -185, -185,  148, -185, -185,
     -185, -185, -185, -185, -185, -185, -185, -185,  185,  185,
     -185, -185,  185,  185,  185,  185,  185,  185, -185, -185,
      185,  185,  185,  185,  185,  185, -185,  185
    },

    {
       33, -186, -186, -186, -186, -186, -186, -186, -186, -186,
     -186, -186, -186, -186, -186, -186, -186, -186,  202, -186,
     -186, -186, -186, -186, -186, -186, -186, -186, -186, -186,
     -186, -186, -186, -186, -186, -186, -186, -186
    },

    {
       33, -187, -187, -187, -187, -187, -187, -187, -187, -187,
     -187, -187, -187, -187, -187, -187, -187, -187,  203,  203,

     -187, -187,  203,  203,  203, -187, -187, -187, -187, -187,
      203,  203, -187, -187, -187, -187, -187, -187
    },

    {
       33,  204,  205,  206,  206,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  207,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204
    },

    {
       33,  189,  190,  126,  126,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  191,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189

    },

    {
       33,  189,  190,  126,  126,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  191,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189
    },

    {
       33,  189,  190,  126,  126,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  208,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189
    },

    {
       33,  209,  210,  211,  211,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  212,  209,  209,  209,  209,

      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209
    },

    {
       33,  193,  194,  136,  136,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  195,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193
    },

    {
       33,  193,  194,  136,  136,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  195,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193

    },

    {
       33,  193,  194,  136,  136,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  213,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193
    },

    {
       33,  214,  215,  216,  216,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  217,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214
    },

    {
       33,  197,  198,  140,  140,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  199,  197,  197,  197,  197,

      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197
    },

    {
       33,  197,  198,  140,  140,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  199,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197
    },

    {
       33,  197,  198,  140,  140,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  218,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197

    },

    {
       33, -200, -200, -200, -200, -200, -200, -200, -200, -200,
     -200, -200, -200, -200, -200, -200, -200, -200, -200, -200,
     -200, -200, -200, -200, -200, -200, -200, -200, -200, -200,
     -200, -200, -200, -200, -200, -200, -200, -200
    },

    {
       33, -201, -201, -201, -201, -201, -201, -201, -201, -201,
     -201, -201, -201, -201, -201, -201, -201, -201, -201, -201,
     -201, -201, -201, -201, -201, -201, -201, -201, -201, -201,
     -201, -201, -201, -201, -201, -201, -201, -201
    },

    {
       33, -202, -202, -202, -202, -202, -202, -202, -202, -202,
     -202, -202, -202, -202, -202, -202, -202, -202, -202, -202,

     -202, -202, -202, -202, -202, -202, -202, -202, -202, -202,
     -202, -202, -202, -202, -202, -202, -202, -202
    },

    {
       33, -203, -203, -203, -203, -203, -203, -203, -203, -203,
     -203, -203, -203, -203, -203, -203, -203, -203, -203, -203,
     -203, -203, -203, -203, -203, -203, -203, -203, -203, -203,
     -203, -203, -203, -203, -203, -203, -203, -203
    },

    {
       33,  204,  205,  206,  206,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  207,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204

    },

    {
       33,  204,  205,  206,  206,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  207,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204
    },

    {
       33, -206,  170,  170,  170, -206, -206, -206, -206,  171,
     -206, -206, -206, -206, -206,  172, -206, -206, -206, -206,
     -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
     -206, -206, -206, -206, -206, -206, -206, -206
    },

    {
       33,  204,  205,  206,  206,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  219,  204,  204,  204,  204,

      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204
    },

    {
       33,  189,  190,  126,  126,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  208,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189,  189,  189,
      189,  189,  189,  189,  189,  189,  189,  189
    },

    {
       33,  209,  210,  211,  211,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  212,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209

    },

    {
       33,  209,  210,  211,  211,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  212,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209
    },

    {
       33, -211,  175,  175,  175, -211, -211, -211, -211,  176,
     -211, -211, -211, -211, -211,  177, -211, -211, -211, -211,
     -211, -211, -211, -211, -211, -211, -211, -211, -211, -211,
     -211, -211, -211, -211, -211, -211, -211, -211
    },

    {
       33,  209,  210,  211,  211,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  220,  209,  209,  209,  209,

      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209
    },

    {
       33,  193,  194,  136,  136,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  213,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193,  193,  193,
      193,  193,  193,  193,  193,  193,  193,  193
    },

    {
       33,  214,  215,  216,  216,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  217,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214

    },

    {
       33,  214,  215,  216,  216,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  217,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214
    },

    {
       33, -216,  179,  179,  179, -216, -216, -216, -216,  180,
     -216, -216, -216, -216, -216,  181, -216, -216, -216, -216,
     -216, -216, -216, -216, -216, -216, -216, -216, -216, -216,
     -216, -216, -216, -216, -216, -216, -216, -216
    },

    {
       33,  214,  215,  216,  216,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  221,  214,  214,  214,  214,

      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214
    },

    {
       33,  197,  198,  140,  140,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  218,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197,  197,  197,
      197,  197,  197,  197,  197,  197,  197,  197
    },

    {
       33,  204,  205,  206,  206,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  219,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204,  204,  204,
      204,  204,  204,  204,  204,  204,  204,  204

    },

    {
       33,  209,  210,  211,  211,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  220,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209,  209,  209,
      209,  209,  209,  209,  209,  209,  209,  209
    },

    {
       33,  214,  215,  216,  216,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  221,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214,  214,  214,
      214,  214,  214,  214,  214,  214,  214,  214
    },

    } ;

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

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

#define YY_NUM_RULES 91
#define YY_END_OF_BUFFER 92
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static yyconst flex_int16_t yy_accept[222] =
    {   0,
        0,    0,   12,   12,    0,    0,    0,    0,   11,   11,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        0,    0,   92,   57,    1,    1,   49,   37,   57,   48,
       19,   42,   43,   48,   48,   48,   48,   51,   48,   44,
       56,   56,   56,   56,   56,   46,   12,    9,    5,    5,
        6,    6,   40,   38,   11,   16,   25,   25,   21,   30,
       24,   21,   34,   34,   36,   59,   58,   58,   67,   60,
       60,   66,   62,   64,   61,   63,   65,   78,   68,   78,
       80,   79,   84,   81,   81,   83,   82,   86,   85,   88,

       87,   87,   90,   90,    1,   49,   31,   50,   32,    1,
       52,    2,   52,   51,   54,   47,   41,   56,    8,   20,
       18,   15,   45,   12,    9,    9,   10,    5,    7,    4,
        3,   40,   39,   11,   16,   16,   17,   25,   21,   21,
       23,   22,   26,   27,   26,   24,   34,   33,   35,   60,
       64,   69,   77,   75,   72,   74,   70,   73,   71,   77,
       87,   89,   32,    1,    1,    2,   52,   55,   53,    9,
       14,   10,    9,    3,   16,   13,   17,   16,   21,   29,
       22,   21,   27,   28,   35,   75,   76,    9,    9,    9,
        9,   16,   16,   16,   16,   21,   21,   21,   21,   27,

       28,   75,   76,    9,    9,    9,    9,    9,   16,   16,
       16,   16,   16,   21,   21,   21,   21,   21,    9,   16,
       21
    } ;

static yyconst flex_int32_t yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    2,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    5,    6,    5,    7,    8,    5,    9,   10,
       11,   12,   13,   14,   15,   16,   17,   18,   18,   18,
       18,   18,   18,   18,   18,   19,   19,   20,   21,    8,
        8,    8,    5,    5,   22,   23,   22,   22,   24,   22,
       25,   25,   25,   25,   25,   25,   25,   26,   25,   25,
       25,   25,   25,   25,   25,   25,   25,   27,   25,   25,
       14,   28,   14,    8,   25,   29,   22,   30,   22,   22,

       24,   31,   25,   25,   25,   25,   25,   25,   25,   32,
       25,   25,   25,   33,   25,   34,   25,   25,   25,   35,
       25,   25,    1,   36,    1,    5,    1,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,

       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37,   37,   37,   37,   37,   37,
       37,   37,   37,   37,   37
    } ;

extern int yy_flex_debug;
int yy_flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "psqlscan.l"
#line 2 "psqlscan.l"
/*-------------------------------------------------------------------------
 *
 * psqlscan.l
 *	  lexical scanner for psql
 *
 * This code is mainly needed to determine where the end of a SQL statement
 * is: we are looking for semicolons that are not within quotes, comments,
 * or parentheses.  The most reliable way to handle this is to borrow the
 * backend's flex lexer rules, lock, stock, and barrel.  The rules below
 * are (except for a few) the same as the backend's, but their actions are
 * just ECHO whereas the backend's actions generally do other things.
 *
 * XXX The rules in this file must be kept in sync with the backend lexer!!!
 *
 * XXX Avoid creating backtracking cases --- see the backend lexer for info.
 *
 * The most difficult aspect of this code is that we need to work in multibyte
 * encodings that are not ASCII-safe.  A "safe" encoding is one in which each
 * byte of a multibyte character has the high bit set (it's >= 0x80).  Since
 * all our lexing rules treat all high-bit-set characters alike, we don't
 * really need to care whether such a byte is part of a sequence or not.
 * In an "unsafe" encoding, we still expect the first byte of a multibyte
 * sequence to be >= 0x80, but later bytes might not be.  If we scan such
 * a sequence as-is, the lexing rules could easily be fooled into matching
 * such bytes to ordinary ASCII characters.  Our solution for this is to
 * substitute 0xFF for each non-first byte within the data presented to flex.
 * The flex rules will then pass the FF's through unmolested.  The emit()
 * subroutine is responsible for looking back to the original string and
 * replacing FF's with the corresponding original bytes.
 *
 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * IDENTIFICATION
 *	  $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.23.2.1 2010/05/05 22:19:11 tgl Exp $
 *
 *-------------------------------------------------------------------------
 */
#include "postgres_fe.h"

#include "psqlscan.h"

#include <ctype.h>

#include "common.h"
#include "settings.h"
#include "variables.h"


/*
 * We use a stack of flex buffers to handle substitution of psql variables.
 * Each stacked buffer contains the as-yet-unread text from one psql variable.
 * When we pop the stack all the way, we resume reading from the outer buffer
 * identified by scanbufhandle.
 */
typedef struct StackElem
{
	YY_BUFFER_STATE buf;		/* flex input control structure */
	char	   *bufstring;		/* data actually being scanned by flex */
	char	   *origstring;		/* copy of original data, if needed */
	char	   *varname;		/* name of variable providing data, or NULL */
	struct StackElem *next;
} StackElem;

/*
 * All working state of the lexer must be stored in PsqlScanStateData
 * between calls.  This allows us to have multiple open lexer operations,
 * which is needed for nested include files.  The lexer itself is not
 * recursive, but it must be re-entrant.
 */
typedef struct PsqlScanStateData
{
	StackElem  *buffer_stack;	/* stack of variable expansion buffers */
	/*
	 * These variables always refer to the outer buffer, never to any
	 * stacked variable-expansion buffer.
	 */
	YY_BUFFER_STATE scanbufhandle;
	char	   *scanbuf;		/* start of outer-level input buffer */
	const char *scanline;		/* current input line at outer level */

	/* safe_encoding, curline, refline are used by emit() to replace FFs */
	int			encoding;		/* encoding being used now */
	bool		safe_encoding;	/* is current encoding "safe"? */
	const char *curline;		/* actual flex input string for cur buf */
	const char *refline;		/* original data for cur buffer */

	/*
	 * All this state lives across successive input lines, until explicitly
	 * reset by psql_scan_reset.
	 */
	int			start_state;	/* saved YY_START */
	int			paren_depth;	/* depth of nesting in parentheses */
	int			xcdepth;		/* depth of nesting in slash-star comments */
	char	   *dolqstart;		/* current $foo$ quote start string */
} PsqlScanStateData;

static PsqlScanState cur_state;	/* current state while active */

static PQExpBuffer output_buf;	/* current output buffer */

/* these variables do not need to be saved across calls */
static enum slash_option_type option_type;
static char *option_quote;


/* Return values from yylex() */
#define LEXRES_EOL			0	/* end of input */
#define LEXRES_SEMI			1	/* command-terminating semicolon found */
#define LEXRES_BACKSLASH	2	/* backslash command start */
#define LEXRES_OK			3	/* OK completion of backslash argument */


int	yylex(void);

static void push_new_buffer(const char *newstr, const char *varname);
static void pop_buffer_stack(PsqlScanState state);
static bool var_is_current_source(PsqlScanState state, const char *varname);
static YY_BUFFER_STATE prepare_buffer(const char *txt, int len,
									  char **txtcopy);
static void emit(const char *txt, int len);

#define ECHO emit(yytext, yyleng)

/*
 * All of the following definitions and rules should exactly match
 * src/backend/parser/scan.l so far as the flex patterns are concerned.
 * The rule bodies are just ECHO as opposed to what the backend does,
 * however.  (But be sure to duplicate code that affects the lexing process,
 * such as BEGIN().)  Also, psqlscan uses a single <<EOF>> rule whereas
 * scan.l has a separate one for each exclusive state.
 */
/*
 * OK, here is a short description of lex/flex rules behavior.
 * The longest pattern which matches an input string is always chosen.
 * For equal-length patterns, the first occurring in the rules list is chosen.
 * INITIAL is the starting state, to which all non-conditional rules apply.
 * Exclusive states change parsing rules while the state is active.  When in
 * an exclusive state, only those rules defined for that state apply.
 *
 * We use exclusive states for quoted strings, extended comments,
 * and to eliminate parsing troubles for numeric strings.
 * Exclusive states:
 *  <xb> bit string literal
 *  <xc> extended C-style comments
 *  <xd> delimited identifiers (double-quoted identifiers)
 *  <xh> hexadecimal numeric string
 *  <xq> standard quoted strings
 *  <xe> extended quoted strings (support backslash escape sequences)
 *  <xdolq> $foo$ quoted strings
 */







/* Additional exclusive states for psql only: lex backslash commands */








/*
 * In order to make the world safe for Windows and Mac clients as well as
 * Unix ones, we accept either \n or \r as a newline.  A DOS-style \r\n
 * sequence will be seen as two successive newlines, but that doesn't cause
 * any problems.  Comments that start with -- and extend to the next
 * newline are treated as equivalent to a single whitespace character.
 *
 * NOTE a fine point: if there is no newline following --, we will absorb
 * everything to the end of the input as a comment.  This is correct.  Older
 * versions of Postgres failed to recognize -- as a comment if the input
 * did not end with a newline.
 *
 * XXX perhaps \f (formfeed) should be treated as a newline as well?
 */
/*
 * SQL requires at least one newline in the whitespace separating
 * string literals that are to be concatenated.  Silly, but who are we
 * to argue?  Note that {whitespace_with_newline} should not have * after
 * it, whereas {whitespace} should generally have a * after it...
 */
/*
 * To ensure that {quotecontinue} can be scanned without having to back up
 * if the full pattern isn't matched, we include trailing whitespace in
 * {quotestop}.  This matches all cases where {quotecontinue} fails to match,
 * except for {quote} followed by whitespace and just one "-" (not two,
 * which would start a {comment}).  To cover that we have {quotefail}.
 * The actions for {quotestop} and {quotefail} must throw back characters
 * beyond the quote proper.
 */
/* Bit string
 * It is tempting to scan the string for only those characters
 * which are allowed. However, this leads to silently swallowed
 * characters if illegal characters are included in the string.
 * For example, if xbinside is [01] then B'ABCD' is interpreted
 * as a zero-length string, and the ABCD' is lost!
 * Better to pass the string forward and let the input routines
 * validate the contents.
 */
/* Hexadecimal number */
/* National character */
/* Quoted string that allows backslash escapes */
/* Extended quote
 * xqdouble implements embedded quote, ''''
 */
/* $foo$ style quotes ("dollar quoting")
 * The quoted string starts with $foo$ where "foo" is an optional string
 * in the form of an identifier, except that it may not contain "$", 
 * and extends to the first occurrence of an identical string.  
 * There is *no* processing of the quoted text.
 *
 * {dolqfailed} is an error rule to avoid scanner backup when {dolqdelim}
 * fails to match its trailing "$".
 */
/* Double quote
 * Allows embedded spaces and other special characters into identifiers.
 */
/* C-style comments
 *
 * The "extended comment" syntax closely resembles allowable operator syntax.
 * The tricky part here is to get lex to recognize a string starting with
 * slash-star as a comment, when interpreting it as an operator would produce
 * a longer match --- remember lex will prefer a longer match!  Also, if we
 * have something like plus-slash-star, lex will think this is a 3-character
 * operator whereas we want to see it as a + operator and a comment start.
 * The solution is two-fold:
 * 1. append {op_chars}* to xcstart so that it matches as much text as
 *    {operator} would. Then the tie-breaker (first matching rule of same
 *    length) ensures xcstart wins.  We put back the extra stuff with yyless()
 *    in case it contains a star-slash that should terminate the comment.
 * 2. In the operator rule, check for slash-star within the operator, and
 *    if found throw it back with yyless().  This handles the plus-slash-star
 *    problem.
 * Dash-dash comments have similar interactions with the operator rule.
 */
/*
 * "self" is the set of chars that should be returned as single-character
 * tokens.  "op_chars" is the set of chars that can make up "Op" tokens,
 * which can be one or more characters long (but if a single-char token
 * appears in the "self" set, it is not to be returned as an Op).  Note
 * that the sets overlap, but each has some chars that are not in the other.
 *
 * If you change either set, adjust the character lists appearing in the
 * rule for "operator"!
 */
/* we no longer allow unary minus in numbers. 
 * instead we pass it separately to parser. there it gets
 * coerced via doNegate() -- Leon aug 20 1999
 *
 * {realfail1} and {realfail2} are added to prevent the need for scanner
 * backup when the {real} rule fails to match completely.
 */
/*
 * Dollar quoted strings are totally opaque, and no escaping is done on them.
 * Other quoted strings must allow some special characters such as single-quote
 *  and newline.
 * Embedded single-quotes are implemented both in the SQL standard
 *  style of two adjacent single quotes "''" and in the Postgres/Java style
 *  of escaped-quote "\'".
 * Other embedded escaped characters are matched explicitly and the leading
 *  backslash is dropped from the string.
 * Note that xcstart must appear before operator, as explained above!
 *  Also whitespace (comment) must appear before operator.
 */
#line 2365 "psqlscan.c"

#define INITIAL 0
#define xb 1
#define xc 2
#define xd 3
#define xh 4
#define xe 5
#define xq 6
#define xdolq 7
#define xslashcmd 8
#define xslasharg 9
#define xslashquote 10
#define xslashbackquote 11
#define xslashdefaultarg 12
#define xslashquotedarg 13
#define xslashwholeline 14
#define xslashend 15

#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 * down here because we want the user's section 1 to have been scanned first.
 * The user has a chance to override it with an option.
 */
#include <unistd.h>
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals (void );

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

int yylex_destroy (void );

int yyget_debug (void );

void yyset_debug (int debug_flag  );

YY_EXTRA_TYPE yyget_extra (void );

void yyset_extra (YY_EXTRA_TYPE user_defined  );

FILE *yyget_in (void );

void yyset_in  (FILE * in_str  );

FILE *yyget_out (void );

void yyset_out  (FILE * out_str  );

int yyget_leng (void );

char *yyget_text (void );

int yyget_lineno (void );

void yyset_lineno (int line_number  );

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

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

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

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

#ifndef YY_NO_INPUT

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

#endif

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

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO fwrite( 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_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		int 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 \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\

#endif

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

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

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

/* end tables serialization structures and prototypes */

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

extern int yylex (void);

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

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

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


#line 2563 "psqlscan.c"

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

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

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

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				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_match:
		while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)]  ]) > 0 )
			++yy_cp;

		yy_current_state = -yy_current_state;

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

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

		switch ( yy_act )
	{ /* beginning of action switch */
case 1:
/* rule 1 can match eol */
YY_RULE_SETUP
#line 363 "psqlscan.l"
{
					/*
					 * Note that the whitespace rule includes both true
					 * whitespace and single-line ("--" style) comments.
					 * We suppress whitespace at the start of the query
					 * buffer.  We also suppress all single-line comments,
					 * which is pretty dubious but is the historical
					 * behavior.
					 */
					if (!(output_buf->len == 0 || yytext[0] == '-'))
						ECHO;
				}
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 376 "psqlscan.l"
{
					cur_state->xcdepth = 0;
					BEGIN(xc);
					/* Put back any characters past slash-star; see above */
					yyless(2);
					ECHO;
				}
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 384 "psqlscan.l"
{
					cur_state->xcdepth++;
					/* Put back any characters past slash-star; see above */
					yyless(2);
					ECHO;
				}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 391 "psqlscan.l"
{
					if (cur_state->xcdepth <= 0)
					{
						BEGIN(INITIAL);
					}
					else
						cur_state->xcdepth--;
					ECHO;
				}
	YY_BREAK
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
#line 401 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 405 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 409 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 413 "psqlscan.l"
{
					BEGIN(xb);
					ECHO;
				}
	YY_BREAK
case 9:
/* rule 9 can match eol */
#line 418 "psqlscan.l"
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
#line 418 "psqlscan.l"
{
					yyless(1);
					BEGIN(INITIAL);
					ECHO;
				}
	YY_BREAK
case 11:
/* rule 11 can match eol */
#line 424 "psqlscan.l"
case 12:
/* rule 12 can match eol */
YY_RULE_SETUP
#line 424 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 13:
/* rule 13 can match eol */
#line 428 "psqlscan.l"
case 14:
/* rule 14 can match eol */
YY_RULE_SETUP
#line 428 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 432 "psqlscan.l"
{
					/* Hexadecimal bit type.
					 * At some point we should simply pass the string
					 * forward to the parser and label it there.
					 * In the meantime, place a leading "x" on the string
					 * to mark it for the input routine as a hex string.
					 */
					BEGIN(xh);
					ECHO;
				}
	YY_BREAK
case 16:
/* rule 16 can match eol */
#line 443 "psqlscan.l"
case 17:
/* rule 17 can match eol */
YY_RULE_SETUP
#line 443 "psqlscan.l"
{
					yyless(1);
					BEGIN(INITIAL);
					ECHO;
				}
	YY_BREAK
case 18:
YY_RULE_SETUP
#line 449 "psqlscan.l"
{
					yyless(1);				/* eat only 'n' this time */
					ECHO;
				}
	YY_BREAK
case 19:
YY_RULE_SETUP
#line 454 "psqlscan.l"
{
					if (standard_strings())
						BEGIN(xq);
					else
						BEGIN(xe);
					ECHO;
				}
	YY_BREAK
case 20:
YY_RULE_SETUP
#line 461 "psqlscan.l"
{
					BEGIN(xe);
					ECHO;
				}
	YY_BREAK
case 21:
/* rule 21 can match eol */
#line 466 "psqlscan.l"
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
#line 466 "psqlscan.l"
{
					yyless(1);
					BEGIN(INITIAL);
					ECHO;
				}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 471 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 24:
/* rule 24 can match eol */
YY_RULE_SETUP
#line 474 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 25:
/* rule 25 can match eol */
YY_RULE_SETUP
#line 477 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 26:
/* rule 26 can match eol */
YY_RULE_SETUP
#line 480 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 483 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 486 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 29:
/* rule 29 can match eol */
YY_RULE_SETUP
#line 489 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 492 "psqlscan.l"
{
					/* This is only needed for \ just before EOF */
					ECHO;
				}
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 497 "psqlscan.l"
{
					cur_state->dolqstart = pg_strdup(yytext);
					BEGIN(xdolq);
					ECHO;
				}
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 502 "psqlscan.l"
{
					/* throw back all but the initial "$" */
					yyless(1);
					ECHO;
				}
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 507 "psqlscan.l"
{
					if (strcmp(yytext, cur_state->dolqstart) == 0)
					{
						free(cur_state->dolqstart);
						cur_state->dolqstart = NULL;
						BEGIN(INITIAL);
					}
					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);
					}
					ECHO;
				}
	YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
#line 525 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 528 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 531 "psqlscan.l"
{
					/* This is only needed for $ inside the quoted text */
					ECHO;
				}
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 536 "psqlscan.l"
{
					BEGIN(xd);
					ECHO;
				}
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 540 "psqlscan.l"
{
					BEGIN(INITIAL);
					ECHO;
				}
	YY_BREAK
case 39:
YY_RULE_SETUP
#line 544 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 40:
/* rule 40 can match eol */
YY_RULE_SETUP
#line 547 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 41:
YY_RULE_SETUP
#line 551 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
/*
	 * These rules are specific to psql --- they implement parenthesis
	 * counting and detection of command-ending semicolon.  These must
	 * appear before the {self} rule so that they take precedence over it.
	 */
case 42:
YY_RULE_SETUP
#line 561 "psqlscan.l"
{
					cur_state->paren_depth++;
					ECHO;
				}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 566 "psqlscan.l"
{
					if (cur_state->paren_depth > 0)
						cur_state->paren_depth--;
					ECHO;
				}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 572 "psqlscan.l"
{
					ECHO;
					if (cur_state->paren_depth == 0)
					{
						/* Terminate lexing temporarily */
						return LEXRES_SEMI;
					}
				}
	YY_BREAK
/*
	 * psql-specific rules to handle backslash commands and variable
	 * substitution.  We want these before {self}, also.
	 */
case 45:
YY_RULE_SETUP
#line 586 "psqlscan.l"
{
					/* Force a semicolon or colon into the query buffer */
					emit(yytext + 1, 1);
				}
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 591 "psqlscan.l"
{
					/* Terminate lexing temporarily */
					return LEXRES_BACKSLASH;
				}
	YY_BREAK
case 47:
YY_RULE_SETUP
#line 596 "psqlscan.l"
{
					/* Possible psql variable substitution */
					const char *varname = yytext + 1;
					const char *value;

					value = GetVariable(pset.vars, varname);

					if (value)
					{
						/* It is a variable, check for recursion */
						if (var_is_current_source(cur_state, varname))
						{
							/* Recursive expansion --- don't go there */
							psql_error("skipping recursive expansion of variable \"%s\"\n",
									   varname);
							/* Instead copy the string as is */
							ECHO;
						}
						else
						{
							/* OK, perform substitution */
							push_new_buffer(value, varname);
							/* yy_scan_string already made buffer active */
						}
					}
					else
					{
						/*
						 * if the variable doesn't exist we'll copy the
						 * string as is
						 */
						ECHO;
					}
				}
	YY_BREAK
/*
	 * Back to backend-compatible rules.
	 */
case 48:
YY_RULE_SETUP
#line 635 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 639 "psqlscan.l"
{
					/*
					 * Check for embedded slash-star or dash-dash; those
					 * are comment starts, so operator must stop there.
					 * Note that slash-star or dash-dash at the first
					 * character will match a prior rule, not this one.
					 */
					int		nchars = yyleng;
					char   *slashstar = strstr(yytext, "/*");
					char   *dashdash = strstr(yytext, "--");

					if (slashstar && dashdash)
					{
						/* if both appear, take the first one */
						if (slashstar > dashdash)
							slashstar = dashdash;
					}
					else if (!slashstar)
						slashstar = dashdash;
					if (slashstar)
						nchars = slashstar - yytext;

					/*
					 * For SQL compatibility, '+' and '-' cannot be the
					 * last char of a multi-char operator unless the operator
					 * contains chars that are not in SQL operators.
					 * The idea is to lex '=-' as two operators, but not
					 * to forbid operator names like '?-' that could not be
					 * sequences of SQL operators.
					 */
					while (nchars > 1 &&
						   (yytext[nchars-1] == '+' ||
							yytext[nchars-1] == '-'))
					{
						int		ic;

						for (ic = nchars-2; ic >= 0; ic--)
						{
							if (strchr("~!@#^&|`?%", yytext[ic]))
								break;
						}
						if (ic >= 0)
							break; /* found a char that makes it OK */
						nchars--; /* else remove the +/-, and check again */
					}

					if (nchars < yyleng)
					{
						/* Strip the unwanted chars from the token */
						yyless(nchars);
					}
					ECHO;
				}
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 693 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 697 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 700 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 703 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 706 "psqlscan.l"
{
					/*
					 * throw back the [Ee], and treat as {decimal}.  Note
					 * that it is possible the input is actually {integer},
					 * but since this case will almost certainly lead to a
					 * syntax error anyway, we don't bother to distinguish.
					 */
					yyless(yyleng-1);
					ECHO;
				}
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 716 "psqlscan.l"
{
					/* throw back the [Ee][+-], and proceed as above */
					yyless(yyleng-2);
					ECHO;
				}
	YY_BREAK
case 56:
YY_RULE_SETUP
#line 723 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 727 "psqlscan.l"
{
					ECHO;
				}
	YY_BREAK
/*
	 * Everything from here down is psql-specific.
	 */
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(xb):
case YY_STATE_EOF(xc):
case YY_STATE_EOF(xd):
case YY_STATE_EOF(xh):
case YY_STATE_EOF(xe):
case YY_STATE_EOF(xq):
case YY_STATE_EOF(xdolq):
case YY_STATE_EOF(xslashcmd):
case YY_STATE_EOF(xslasharg):
case YY_STATE_EOF(xslashquote):
case YY_STATE_EOF(xslashbackquote):
case YY_STATE_EOF(xslashdefaultarg):
case YY_STATE_EOF(xslashquotedarg):
case YY_STATE_EOF(xslashwholeline):
case YY_STATE_EOF(xslashend):
#line 736 "psqlscan.l"
{
					StackElem  *stackelem = cur_state->buffer_stack;

					if (stackelem == NULL)
						return LEXRES_EOL; /* end of input reached */

					/*
					 * We were expanding a variable, so pop the inclusion
					 * stack and keep lexing
					 */
					pop_buffer_stack(cur_state);

					stackelem = cur_state->buffer_stack;
					if (stackelem != NULL)
					{
						yy_switch_to_buffer(stackelem->buf);
						cur_state->curline = stackelem->bufstring;
						cur_state->refline = stackelem->origstring ? stackelem->origstring : stackelem->bufstring;
					}
					else
					{
						yy_switch_to_buffer(cur_state->scanbufhandle);
						cur_state->curline = cur_state->scanbuf;
						cur_state->refline = cur_state->scanline;
					}
				}
	YY_BREAK
/*
	 * Exclusive lexer states to handle backslash command lexing
	 */

/* command name ends at whitespace or backslash; eat all else */
case 58:
/* rule 58 can match eol */
YY_RULE_SETUP
#line 770 "psqlscan.l"
{
					yyless(0);
					return LEXRES_OK;
				}
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 775 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/* eat any whitespace, then decide what to do at first nonblank */
case 60:
/* rule 60 can match eol */
YY_RULE_SETUP
#line 782 "psqlscan.l"
{ }
	YY_BREAK
case 61:
YY_RULE_SETUP
#line 784 "psqlscan.l"
{
					/*
					 * backslash is end of command or next command, do not eat
					 *
					 * XXX this means we can't conveniently accept options
					 * that start with a backslash; therefore, option
					 * processing that encourages use of backslashes is rather
					 * broken.
					 */
					yyless(0);
					return LEXRES_OK;
				}
	YY_BREAK
case 62:
YY_RULE_SETUP
#line 797 "psqlscan.l"
{
					*option_quote = '\'';
					BEGIN(xslashquote);
				}
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 802 "psqlscan.l"
{
					if (option_type == OT_VERBATIM)
					{
						/* in verbatim mode, backquote is not special */
						ECHO;
						BEGIN(xslashdefaultarg);
					}
					else
					{
						*option_quote = '`';
						BEGIN(xslashbackquote);
					}
				}
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 816 "psqlscan.l"
{
					/* Possible psql variable substitution */
					if (option_type == OT_VERBATIM)
						ECHO;
					else
					{
						const char *value;

						value = GetVariable(pset.vars, yytext + 1);

						/*
						 * The variable value is just emitted without any
						 * further examination.  This is consistent with the
						 * pre-8.0 code behavior, if not with the way that
						 * variables are handled outside backslash commands.
						 * Note that we needn't guard against recursion here.
						 */
						if (value)
							appendPQExpBufferStr(output_buf, value);
					}

					*option_quote = ':';

					return LEXRES_OK;
				}
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 842 "psqlscan.l"
{
					ECHO;
					if (option_type == OT_FILEPIPE)
					{
						/* treat like whole-string case */
						BEGIN(xslashwholeline);
					}
					else
					{
						/* treat like default case */
						BEGIN(xslashdefaultarg);
					}
				}
	YY_BREAK
case 66:
YY_RULE_SETUP
#line 856 "psqlscan.l"
{
					*option_quote = '"';
					ECHO;
					BEGIN(xslashquotedarg);
				}
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 862 "psqlscan.l"
{
					ECHO;
					BEGIN(xslashdefaultarg);
				}
	YY_BREAK


/*
	 * single-quoted text: copy literally except for '' and backslash
	 * sequences
	 */
case 68:
YY_RULE_SETUP
#line 875 "psqlscan.l"
{ return LEXRES_OK; }
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 877 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\''); }
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 879 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\n'); }
	YY_BREAK
case 71:
YY_RULE_SETUP
#line 880 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\t'); }
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 881 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\b'); }
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 882 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\r'); }
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 883 "psqlscan.l"
{ appendPQExpBufferChar(output_buf, '\f'); }
	YY_BREAK
case 75:
YY_RULE_SETUP
#line 885 "psqlscan.l"
{
					/* octal case */
					appendPQExpBufferChar(output_buf,
										  (char) strtol(yytext + 1, NULL, 8));
				}
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 891 "psqlscan.l"
{
					/* hex case */
					appendPQExpBufferChar(output_buf,
										  (char) strtol(yytext + 2, NULL, 16));
				}
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 897 "psqlscan.l"
{ emit(yytext + 1, 1); }
	YY_BREAK
case 78:
/* rule 78 can match eol */
YY_RULE_SETUP
#line 899 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/*
	 * backticked text: copy everything until next backquote or end of line.
	 * Invocation of the command will happen in psql_scan_slash_option.
	 */
case 79:
YY_RULE_SETUP
#line 909 "psqlscan.l"
{ return LEXRES_OK; }
	YY_BREAK
case 80:
/* rule 80 can match eol */
YY_RULE_SETUP
#line 911 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/*
	 * Copy everything until unquoted whitespace or end of line.  Quotes
	 * do not get stripped yet.
	 */
case 81:
/* rule 81 can match eol */
YY_RULE_SETUP
#line 921 "psqlscan.l"
{
					yyless(0);
					return LEXRES_OK;
				}
	YY_BREAK
case 82:
YY_RULE_SETUP
#line 926 "psqlscan.l"
{
					/*
					 * unquoted backslash is end of command or next command,
					 * do not eat
					 *
					 * (this was not the behavior pre-8.0, but it seems
					 * consistent)
					 */
					yyless(0);
					return LEXRES_OK;
				}
	YY_BREAK
case 83:
YY_RULE_SETUP
#line 938 "psqlscan.l"
{
					*option_quote = '"';
					ECHO;
					BEGIN(xslashquotedarg);
				}
	YY_BREAK
case 84:
YY_RULE_SETUP
#line 944 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/* double-quoted text within a default-type argument: copy */
case 85:
YY_RULE_SETUP
#line 951 "psqlscan.l"
{
					ECHO;
					BEGIN(xslashdefaultarg);
				}
	YY_BREAK
case 86:
/* rule 86 can match eol */
YY_RULE_SETUP
#line 956 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/* copy everything until end of input line */
/* but suppress leading whitespace */
case 87:
/* rule 87 can match eol */
YY_RULE_SETUP
#line 964 "psqlscan.l"
{
					if (output_buf->len > 0)
						ECHO;
				}
	YY_BREAK
case 88:
YY_RULE_SETUP
#line 969 "psqlscan.l"
{ ECHO; }
	YY_BREAK


/* at end of command, eat a double backslash, but not anything else */
case 89:
YY_RULE_SETUP
#line 976 "psqlscan.l"
{ return LEXRES_OK; }
	YY_BREAK
case 90:
/* rule 90 can match eol */
YY_RULE_SETUP
#line 978 "psqlscan.l"
{
					yyless(0);
					return LEXRES_OK;
				}
	YY_BREAK

case 91:
YY_RULE_SETUP
#line 985 "psqlscan.l"
YY_FATAL_ERROR( "flex scanner jammed" );
	YY_BREAK
#line 3556 "psqlscan.c"

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

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

		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed 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_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

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

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

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

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

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

			else
				{
				yy_cp = (yy_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_LVALUE->yy_ch_buf[(yy_n_chars)];

				yy_current_state = yy_get_previous_state(  );

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

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

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

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

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

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

	/* Try to read more data. */

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

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

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

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

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;

			int yy_c_buf_p_offset =
				(int) ((yy_c_buf_p) - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

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

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

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

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

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	if ( (yy_n_chars) == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart(yyin  );
			}

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

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
	}

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

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

	return ret_val;
}

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

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

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
		yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)];
		}

	return yy_current_state;
}

/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	register int yy_is_jam;
    
	yy_current_state = yy_nxt[yy_current_state][1];
	yy_is_jam = (yy_current_state <= 0);

	return yy_is_jam ? 0 : yy_current_state;
}

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

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

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

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

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

					/* Reset buffer status. */
					yyrestart(yyin );

					/*FALLTHROUGH*/

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

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

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

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

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

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

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	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;
}

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

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * 
 * @return the allocated buffer state.
 */
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc(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 *) yyalloc(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;
}

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

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

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

	yyfree((void *) b  );
}

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

{
	int oerrno = errno;
    
	yy_flush_buffer(b );

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

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

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

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

	b->yy_n_chars = 0;

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

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

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

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

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

	yyensure_buffer_stack();

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

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

	/* copied from yy_switch_to_buffer. */
	yy_load_buffer_state( );
	(yy_did_buffer_switch_on_eof) = 1;
}

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

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

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

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

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

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

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

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

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

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

	b = (YY_BUFFER_STATE) yyalloc(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;
}

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

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

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

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

	b = 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;
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

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

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

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

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

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

/** Get the input stream.
 * 
 */
FILE *yyget_in  (void)
{
        return yyin;
}

/** Get the output stream.
 * 
 */
FILE *yyget_out  (void)
{
        return yyout;
}

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

/** Get the current token.
 * 
 */

char *yyget_text  (void)
{
        return yytext;
}

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

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

void yyset_out (FILE *  out_str )
{
        yyout = out_str ;
}

int yyget_debug  (void)
{
        return yy_flex_debug;
}

void yyset_debug (int  bdebug )
{
        yy_flex_debug = bdebug ;
}

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

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

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

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

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

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

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

    return 0;
}

/*
 * Internal utility routines.
 */

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

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

	return n;
}
#endif

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

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

void yyfree (void * ptr )
{
	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 985 "psqlscan.l"



/*
 * Create a lexer working state struct.
 */
PsqlScanState
psql_scan_create(void)
{
	PsqlScanState state;

	state = (PsqlScanStateData *) pg_malloc_zero(sizeof(PsqlScanStateData));

	psql_scan_reset(state);

	return state;
}

/*
 * Destroy a lexer working state struct, releasing all resources.
 */
void
psql_scan_destroy(PsqlScanState state)
{
	psql_scan_finish(state);

	psql_scan_reset(state);

	free(state);
}

/*
 * Set up to perform lexing of the given input line.
 *
 * The text at *line, extending for line_len bytes, will be scanned by
 * subsequent calls to the psql_scan routines.  psql_scan_finish should
 * be called when scanning is complete.  Note that the lexer retains
 * a pointer to the storage at *line --- this string must not be altered
 * or freed until after psql_scan_finish is called.
 */
void
psql_scan_setup(PsqlScanState state,
				const char *line, int line_len)
{
	/* Mustn't be scanning already */
	psql_assert(state->scanbufhandle == NULL);
	psql_assert(state->buffer_stack == NULL);

	/* Do we need to hack the character set encoding? */
	state->encoding = pset.encoding;
	state->safe_encoding = pg_valid_server_encoding_id(state->encoding);

	/* needed for prepare_buffer */
	cur_state = state;

	/* Set up flex input buffer with appropriate translation and padding */
	state->scanbufhandle = prepare_buffer(line, line_len,
										  &state->scanbuf);
	state->scanline = line;

	/* Set lookaside data in case we have to map unsafe encoding */
	state->curline = state->scanbuf;
	state->refline = state->scanline;
}

/*
 * Do lexical analysis of SQL command text.
 *
 * The text previously passed to psql_scan_setup is scanned, and appended
 * (possibly with transformation) to query_buf.
 *
 * The return value indicates the condition that stopped scanning:
 *
 * PSCAN_SEMICOLON: found a command-ending semicolon.  (The semicolon is
 * transferred to query_buf.)  The command accumulated in query_buf should
 * be executed, then clear query_buf and call again to scan the remainder
 * of the line.
 *
 * PSCAN_BACKSLASH: found a backslash that starts a psql special command.
 * Any previous data on the line has been transferred to query_buf.
 * The caller will typically next call psql_scan_slash_command(),
 * perhaps psql_scan_slash_option(), and psql_scan_slash_command_end().
 *
 * PSCAN_INCOMPLETE: the end of the line was reached, but we have an
 * incomplete SQL command.  *prompt is set to the appropriate prompt type.
 *
 * PSCAN_EOL: the end of the line was reached, and there is no lexical
 * reason to consider the command incomplete.  The caller may or may not
 * choose to send it.  *prompt is set to the appropriate prompt type if
 * the caller chooses to collect more input.
 *
 * In the PSCAN_INCOMPLETE and PSCAN_EOL cases, psql_scan_finish() should
 * be called next, then the cycle may be repeated with a fresh input line.
 *
 * In all cases, *prompt is set to an appropriate prompt type code for the
 * next line-input operation.
 */
PsqlScanResult
psql_scan(PsqlScanState state,
		  PQExpBuffer query_buf,
		  promptStatus_t *prompt)
{
	PsqlScanResult result;
	int			lexresult;

	/* Must be scanning already */
	psql_assert(state->scanbufhandle);

	/* Set up static variables that will be used by yylex */
	cur_state = state;
	output_buf = query_buf;

	if (state->buffer_stack != NULL)
		yy_switch_to_buffer(state->buffer_stack->buf);
	else
		yy_switch_to_buffer(state->scanbufhandle);

	BEGIN(state->start_state);

	/* And lex. */
	lexresult = yylex();

	/* Update static vars back to the state struct */
	state->start_state = YY_START;

	/*
	 * Check termination state and return appropriate result info.
	 */
	switch (lexresult)
	{
		case LEXRES_EOL:		/* end of input */
			switch (state->start_state)
			{
				case INITIAL:
					if (state->paren_depth > 0)
					{
						result = PSCAN_INCOMPLETE;
						*prompt = PROMPT_PAREN;
					}
					else if (query_buf->len > 0)
					{
						result = PSCAN_EOL;
						*prompt = PROMPT_CONTINUE;
					}
					else
					{
						/* never bother to send an empty buffer */
						result = PSCAN_INCOMPLETE;
						*prompt = PROMPT_READY;
					}
					break;
				case xb:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_SINGLEQUOTE;
					break;
				case xc:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_COMMENT;
					break;
				case xd:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_DOUBLEQUOTE;
					break;
				case xh:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_SINGLEQUOTE;
					break;
				case xq:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_SINGLEQUOTE;
					break;
				case xe:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_SINGLEQUOTE;
					break;
				case xdolq:
					result = PSCAN_INCOMPLETE;
					*prompt = PROMPT_DOLLARQUOTE;
					break;
				default:
					/* can't get here */
					fprintf(stderr, "invalid YY_START\n");
					exit(1);
			}
			break;
		case LEXRES_SEMI:		/* semicolon */
			result = PSCAN_SEMICOLON;
			*prompt = PROMPT_READY;
			break;
		case LEXRES_BACKSLASH:	/* backslash */
			result = PSCAN_BACKSLASH;
			*prompt = PROMPT_READY;
			break;
		default:
			/* can't get here */
			fprintf(stderr, "invalid yylex result\n");
			exit(1);
	}

	return result;
}

/*
 * Clean up after scanning a string.  This flushes any unread input and
 * releases resources (but not the PsqlScanState itself).  Note however
 * that this does not reset the lexer scan state; that can be done by
 * psql_scan_reset(), which is an orthogonal operation.
 *
 * It is legal to call this when not scanning anything (makes it easier
 * to deal with error recovery).
 */
void
psql_scan_finish(PsqlScanState state)
{
	/* Drop any incomplete variable expansions. */
	while (state->buffer_stack != NULL)
		pop_buffer_stack(state);

	/* Done with the outer scan buffer, too */
	if (state->scanbufhandle)
		yy_delete_buffer(state->scanbufhandle);
	state->scanbufhandle = NULL;
	if (state->scanbuf)
		free(state->scanbuf);
	state->scanbuf = NULL;
}

/*
 * Reset lexer scanning state to start conditions.  This is appropriate
 * for executing \r psql commands (or any other time that we discard the
 * prior contents of query_buf).  It is not, however, necessary to do this
 * when we execute and clear the buffer after getting a PSCAN_SEMICOLON or
 * PSCAN_EOL scan result, because the scan state must be INITIAL when those
 * conditions are returned.
 *
 * Note that this is unrelated to flushing unread input; that task is
 * done by psql_scan_finish().
 */
void
psql_scan_reset(PsqlScanState state)
{
	state->start_state = INITIAL;
	state->paren_depth = 0;
	state->xcdepth = 0;			/* not really necessary */
	if (state->dolqstart)
		free(state->dolqstart);
	state->dolqstart = NULL;
}

/*
 * Return true if lexer is currently in an "inside quotes" state.
 *
 * This is pretty grotty but is needed to preserve the old behavior
 * that mainloop.c drops blank lines not inside quotes without even
 * echoing them.
 */
bool
psql_scan_in_quote(PsqlScanState state)
{
	return state->start_state != INITIAL;
}

/*
 * Scan the command name of a psql backslash command.  This should be called
 * after psql_scan() returns PSCAN_BACKSLASH.  It is assumed that the input
 * has been consumed through the leading backslash.
 *
 * The return value is a malloc'd copy of the command name, as parsed off
 * from the input.
 */
char *
psql_scan_slash_command(PsqlScanState state)
{
	PQExpBufferData mybuf;
	int			lexresult;

	/* Must be scanning already */
	psql_assert(state->scanbufhandle);

	/* Build a local buffer that we'll return the data of */
	initPQExpBuffer(&mybuf);

	/* Set up static variables that will be used by yylex */
	cur_state = state;
	output_buf = &mybuf;

	if (state->buffer_stack != NULL)
		yy_switch_to_buffer(state->buffer_stack->buf);
	else
		yy_switch_to_buffer(state->scanbufhandle);

	BEGIN(xslashcmd);

	/* And lex. */
	lexresult = yylex();

	/* There are no possible errors in this lex state... */

	return mybuf.data;
}

/*
 * Parse off the next argument for a backslash command, and return it as a
 * malloc'd string.  If there are no more arguments, returns NULL.
 *
 * type tells what processing, if any, to perform on the option string;
 * for example, if it's a SQL identifier, we want to downcase any unquoted
 * letters.
 *
 * if quote is not NULL, *quote is set to 0 if no quoting was found, else
 * the quote symbol.
 *
 * if semicolon is true, unquoted trailing semicolon(s) that would otherwise
 * be taken as part of the option string will be stripped.
 *
 * NOTE: the only possible syntax errors for backslash options are unmatched
 * quotes, which are detected when we run out of input.  Therefore, on a
 * syntax error we just throw away the string and return NULL; there is no
 * need to worry about flushing remaining input.
 */
char *
psql_scan_slash_option(PsqlScanState state,
					   enum slash_option_type type,
					   char *quote,
					   bool semicolon)
{
	PQExpBufferData mybuf;
	int			lexresult;
	char		local_quote;
	bool		badarg;

	/* Must be scanning already */
	psql_assert(state->scanbufhandle);

	if (quote == NULL)
		quote = &local_quote;
	*quote = 0;

	/* Build a local buffer that we'll return the data of */
	initPQExpBuffer(&mybuf);

	/* Set up static variables that will be used by yylex */
	cur_state = state;
	output_buf = &mybuf;
	option_type = type;
	option_quote = quote;

	if (state->buffer_stack != NULL)
		yy_switch_to_buffer(state->buffer_stack->buf);
	else
		yy_switch_to_buffer(state->scanbufhandle);

	if (type == OT_WHOLE_LINE)
		BEGIN(xslashwholeline);
	else
		BEGIN(xslasharg);

	/* And lex. */
	lexresult = yylex();

	/*
	 * Check the lex result: we should have gotten back either LEXRES_OK
	 * or LEXRES_EOL (the latter indicating end of string).  If we were inside
	 * a quoted string, as indicated by YY_START, EOL is an error.
	 */
	psql_assert(lexresult == LEXRES_EOL || lexresult == LEXRES_OK);
	badarg = false;
	switch (YY_START)
	{
		case xslasharg:
			/* empty arg, or possibly a psql variable substitution */
			break;
		case xslashquote:
			if (lexresult != LEXRES_OK)
				badarg = true;		/* hit EOL not ending quote */
			break;
		case xslashbackquote:
			if (lexresult != LEXRES_OK)
				badarg = true;		/* hit EOL not ending quote */
			else
			{
				/* Perform evaluation of backticked command */
				char	   *cmd = mybuf.data;
				FILE	   *fd;
				bool		error = false;
				PQExpBufferData output;
				char		buf[512];
				size_t		result;

				fd = popen(cmd, PG_BINARY_R);
				if (!fd)
				{
					psql_error("%s: %s\n", cmd, strerror(errno));
					error = true;
				}

				initPQExpBuffer(&output);

				if (!error)
				{
					do
					{
						result = fread(buf, 1, sizeof(buf), fd);
						if (ferror(fd))
						{
							psql_error("%s: %s\n", cmd, strerror(errno));
							error = true;
							break;
						}
						appendBinaryPQExpBuffer(&output, buf, result);
					} while (!feof(fd));
				}

				if (fd && pclose(fd) == -1)
				{
					psql_error("%s: %s\n", cmd, strerror(errno));
					error = true;
				}

				/* Now done with cmd, transfer result to mybuf */
				resetPQExpBuffer(&mybuf);

				if (!error)
				{
					/* strip any trailing newline */
					if (output.len > 0 &&
						output.data[output.len - 1] == '\n')
						output.len--;
					appendBinaryPQExpBuffer(&mybuf, output.data, output.len);
				}

				termPQExpBuffer(&output);
			}
			break;
		case xslashdefaultarg:
			/* Strip any trailing semi-colons if requested */
			if (semicolon)
			{
				while (mybuf.len > 0 &&
					   mybuf.data[mybuf.len - 1] == ';')
				{
					mybuf.data[--mybuf.len] = '\0';
				}
			}

			/*
			 * If SQL identifier processing was requested, then we strip out
			 * excess double quotes and downcase unquoted letters.
			 * Doubled double-quotes become output double-quotes, per spec.
			 *
			 * Note that a string like FOO"BAR"BAZ will be converted to
			 * fooBARbaz; this is somewhat inconsistent with the SQL spec,
			 * which would have us parse it as several identifiers.  But
			 * for psql's purposes, we want a string like "foo"."bar" to
			 * be treated as one option, so there's little choice.
			 */
			if (type == OT_SQLID || type == OT_SQLIDHACK)
			{
				bool		inquotes = false;
				char	   *cp = mybuf.data;

				while (*cp)
				{
					if (*cp == '"')
					{
						if (inquotes && cp[1] == '"')
						{
							/* Keep the first quote, remove the second */
							cp++;
						}
						inquotes = !inquotes;
						/* Collapse out quote at *cp */
						memmove(cp, cp + 1, strlen(cp));
						mybuf.len--;
						/* do not advance cp */
					}
					else
					{
						if (!inquotes && type == OT_SQLID)
							*cp = pg_tolower((unsigned char) *cp);
						cp += PQmblen(cp, pset.encoding);
					}
				}
			}
			break;
		case xslashquotedarg:
			/* must have hit EOL inside double quotes */
			badarg = true;
			break;
		case xslashwholeline:
			/* always okay */
			break;
		default:
			/* can't get here */
			fprintf(stderr, "invalid YY_START\n");
			exit(1);
	}

	if (badarg)
	{
		psql_error("unterminated quoted string\n");
		termPQExpBuffer(&mybuf);
		return NULL;
	}

	/*
	 * An unquoted empty argument isn't possible unless we are at end of
	 * command.  Return NULL instead.
	 */
	if (mybuf.len == 0 && *quote == 0)
	{
		termPQExpBuffer(&mybuf);
		return NULL;
	}

	/* Else return the completed string. */
	return mybuf.data;
}

/*
 * Eat up any unused \\ to complete a backslash command.
 */
void
psql_scan_slash_command_end(PsqlScanState state)
{
	int			lexresult;

	/* Must be scanning already */
	psql_assert(state->scanbufhandle);

	/* Set up static variables that will be used by yylex */
	cur_state = state;
	output_buf = NULL;

	if (state->buffer_stack != NULL)
		yy_switch_to_buffer(state->buffer_stack->buf);
	else
		yy_switch_to_buffer(state->scanbufhandle);

	BEGIN(xslashend);

	/* And lex. */
	lexresult = yylex();

	/* There are no possible errors in this lex state... */
}

/*
 * "Push back" the passed string so that it will be rescanned by subsequent
 * psql_scan_slash_option calls.  This is presently only used in the case
 * where a single-letter command has been concatenated with its argument.
 *
 * We use the same buffer stack mechanism as for variable expansion.
 */
void
psql_scan_slash_pushback(PsqlScanState state, const char *str)
{
	/* needed for push_new_buffer */
	cur_state = state;

	push_new_buffer(str, NULL);
}


/*
 * Push the given string onto the stack of stuff to scan.
 *
 * cur_state must point to the active PsqlScanState.
 *
 * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer.
 */
static void
push_new_buffer(const char *newstr, const char *varname)
{
	StackElem  *stackelem;

	stackelem = (StackElem *) pg_malloc(sizeof(StackElem));

	/*
	 * In current usage, the passed varname points at the current flex
	 * input buffer; we must copy it before calling prepare_buffer()
	 * because that will change the buffer state.
	 */
	stackelem->varname = varname ? pg_strdup(varname) : NULL;

	stackelem->buf = prepare_buffer(newstr, strlen(newstr),
									&stackelem->bufstring);
	cur_state->curline = stackelem->bufstring;
	if (cur_state->safe_encoding)
	{
		stackelem->origstring = NULL;
		cur_state->refline = stackelem->bufstring;
	}
	else
	{
		stackelem->origstring = pg_strdup(newstr);
		cur_state->refline = stackelem->origstring;
	}
	stackelem->next = cur_state->buffer_stack;
	cur_state->buffer_stack = stackelem;
}

/*
 * Pop the topmost buffer stack item (there must be one!)
 *
 * NB: after this, the flex input state is unspecified; caller must
 * switch to an appropriate buffer to continue lexing.
 */
static void
pop_buffer_stack(PsqlScanState state)
{
	StackElem  *stackelem = state->buffer_stack;

	state->buffer_stack = stackelem->next;
	yy_delete_buffer(stackelem->buf);
	free(stackelem->bufstring);
	if (stackelem->origstring)
		free(stackelem->origstring);
	if (stackelem->varname)
		free(stackelem->varname);
	free(stackelem);
}

/*
 * Check if specified variable name is the source for any string
 * currently being scanned
 */
static bool
var_is_current_source(PsqlScanState state, const char *varname)
{
	StackElem  *stackelem;

	for (stackelem = state->buffer_stack;
		 stackelem != NULL;
		 stackelem = stackelem->next)
	{
		if (stackelem->varname && strcmp(stackelem->varname, varname) == 0)
			return true;
	}
	return false;
}

/*
 * Set up a flex input buffer to scan the given data.  We always make a
 * copy of the data.  If working in an unsafe encoding, the copy has
 * multibyte sequences replaced by FFs to avoid fooling the lexer rules.
 *
 * cur_state must point to the active PsqlScanState.
 *
 * NOTE SIDE EFFECT: the new buffer is made the active flex input buffer.
 */
static YY_BUFFER_STATE
prepare_buffer(const char *txt, int len, char **txtcopy)
{
	char	   *newtxt;

	/* Flex wants two \0 characters after the actual data */
	newtxt = pg_malloc(len + 2);
	*txtcopy = newtxt;
	newtxt[len] = newtxt[len + 1] = YY_END_OF_BUFFER_CHAR;

	if (cur_state->safe_encoding)
		memcpy(newtxt, txt, len);
	else
	{
		/* Gotta do it the hard way */
		int		i = 0;

		while (i < len)
		{
			int		thislen = PQmblen(txt + i, cur_state->encoding);

			/* first byte should always be okay... */
			newtxt[i] = txt[i];
			i++;
			while (--thislen > 0)
				newtxt[i++] = (char) 0xFF;
		}
	}

	return yy_scan_buffer(newtxt,len + 2);
}

/*
 * emit() --- body for ECHO macro
 *
 * NB: this must be used for ALL and ONLY the text copied from the flex
 * input data.  If you pass it something that is not part of the yytext
 * string, you are making a mistake.  Internally generated text can be
 * appended directly to output_buf.
 */
static void
emit(const char *txt, int len)
{
	if (cur_state->safe_encoding)
		appendBinaryPQExpBuffer(output_buf, txt, len);
	else
	{
		/* Gotta do it the hard way */
		const char *reference = cur_state->refline;
		int		i;

		reference += (txt - cur_state->curline);

		for (i = 0; i < len; i++)
		{
			char	ch = txt[i];

			if (ch == (char) 0xFF)
				ch = reference[i];
			appendPQExpBufferChar(output_buf, ch);
		}
	}
}

