📄 scan.c
字号:
/* A lexical scanner generated by flex *//* Scanner skeleton version: * $FreeBSD: src/usr.bin/lex/skel.c,v 1.2.2.1 1999/08/29 15:29:33 peter Exp $ */#define FLEX_SCANNER#define YY_FLEX_MAJOR_VERSION 2#define YY_FLEX_MINOR_VERSION 5#include <stdio.h>/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */#ifdef c_plusplus#ifndef __cplusplus#define __cplusplus#endif#endif#ifdef __cplusplus#include <stdlib.h>#include <unistd.h>/* Use prototypes in function declarations. */#define YY_USE_PROTOS/* The "const" storage-class-modifier is valid. */#define YY_USE_CONST#else /* ! __cplusplus */#if __STDC__#define YY_USE_PROTOS#define YY_USE_CONST#endif /* __STDC__ */#endif /* ! __cplusplus */#ifdef __TURBOC__ #pragma warn -rch #pragma warn -use#include <io.h>#include <stdlib.h>#define YY_USE_CONST#define YY_USE_PROTOS#endif#ifdef YY_USE_CONST#define yyconst const#else#define yyconst#endif#ifdef YY_USE_PROTOS#define YY_PROTO(proto) proto#else#define YY_PROTO(proto) ()#endif/* Returned upon end-of-file. */#define YY_NULL 0/* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)/* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */#define BEGIN yy_start = 1 + 2 */* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */#define YY_START ((yy_start - 1) / 2)#define YYSTATE YY_START/* Action number for EOF rule of a given start state. */#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)/* Special action meaning "start processing a new file". */#define YY_NEW_FILE yyrestart( yyin )#define YY_END_OF_BUFFER_CHAR 0/* Size of default input buffer. */#define YY_BUF_SIZE 65536typedef struct yy_buffer_state *YY_BUFFER_STATE;extern int yyleng;extern FILE *yyin, *yyout;#define EOB_ACT_CONTINUE_SCAN 0#define EOB_ACT_END_OF_FILE 1#define EOB_ACT_LAST_MATCH 2/* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. *//* Return all but the first 'n' matched characters back to the input stream. */#define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 )#define unput(c) yyunput( c, yytext_ptr )/* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */typedef unsigned int yy_size_t;struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status;#define YY_BUFFER_NEW 0#define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */#define YY_BUFFER_EOF_PENDING 2 };static YY_BUFFER_STATE yy_current_buffer = 0;/* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */#define YY_CURRENT_BUFFER yy_current_buffer/* yy_hold_char holds the character lost when yytext is formed. */static char yy_hold_char;static int yy_n_chars; /* number of characters read into yy_ch_buf */int yyleng;/* Points to current character in buffer. */static char *yy_c_buf_p = (char *) 0;static int yy_init = 1; /* whether we need to initialize */static int yy_start = 0; /* start state number *//* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */static int yy_did_buffer_switch_on_eof;void yyrestart YY_PROTO(( FILE *input_file ));void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));void yy_load_buffer_state YY_PROTO(( void ));YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));static void *yy_flex_alloc YY_PROTO(( yy_size_t ));static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));static void yy_flex_free YY_PROTO(( void * ));#define yy_new_buffer yy_create_buffer#define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ }#define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ }#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)#define YY_USES_REJECTtypedef unsigned char YY_CHAR;FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;typedef int yy_state_type;extern char *yytext;#define yytext_ptr yytextstatic yy_state_type yy_get_previous_state YY_PROTO(( void ));static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));static int yy_get_next_buffer YY_PROTO(( void ));static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));/* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */#define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp;#define YY_NUM_RULES 43#define YY_END_OF_BUFFER 44static yyconst short int yy_acclist[181] = { 0, 10, 10, 6, 6, 23, 23, 9, 9, 24, 24, 18, 18, 44, 42, 43, 41, 42, 43, 41, 43, 31, 42, 43, 21, 42, 43, 28, 29, 31, 42, 43, 28, 29, 31, 42, 43, 15, 42, 43, 28, 29, 42, 43, 28, 29, 31, 42, 43, 28, 29, 42, 43, 28, 29, 31, 42, 43, 37, 42, 43, 16418, 28, 29, 31, 42, 43, 40, 42, 43,16417, 40, 42, 43,16417, 40, 42, 43,16417, 10, 43, 8, 43, 3, 6, 43, 3, 6, 43, 3, 43, 6, 43, 23, 43, 22, 43, 9, 43, 14, 43, 43, 24, 43, 25, 43, 18, 43, 16, 43, 43, 31, 31, 31, 32, 31, 31, 37,16418, 38,16419, 4, 31, 31, 38,16419, 26, 31, 40,16417, 7, 13, 10, 6, 6, 5, 23, 9, 24, 18, 17, 19, 30, 27, 30, 27, 30, 32, 27, 1, 31, 31, 27, 30, 4, 31, 4, 31, 4, 31, 8226, 38,16419, 39,16420, 8225, 12, 5, 11, 20, 30, 8227, 2, 4, 31, 30, 2, 2, 2, 8228, 2 } ;static yyconst short int yy_accept[134] = { 0, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 19, 21, 24, 27, 32, 37, 40, 44, 49, 53, 58, 62, 67, 71, 75, 79, 81, 83, 86, 89, 91, 93, 95, 97, 99, 101, 102, 104, 106, 108, 110, 111, 112, 113, 113, 114, 115, 116, 116, 117, 117, 119, 121, 123, 124, 124, 124, 126, 126, 128, 128, 128, 130, 131, 132, 133, 133, 133, 134, 135, 135, 135, 136, 137, 138, 138, 138, 139, 140, 140, 140, 141, 142, 143, 145, 148, 149, 149, 150, 151, 152, 154, 154, 154, 154, 156, 158, 160, 161, 163, 163, 165, 166, 166, 166, 167, 168, 168, 168, 169, 169, 169, 170, 171, 172, 172, 175, 176, 176, 176, 177, 178, 179, 180, 181, 181 } ;static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 5, 4, 6, 7, 4, 8, 9, 9, 10, 11, 9, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 9, 7, 7, 7, 4, 4, 17, 18, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 17, 9, 21, 9, 7, 17, 4, 17, 18, 17, 17, 19, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 20, 17, 17, 1, 7, 1, 4, 1, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 } ;static yyconst int yy_meta[22] = { 0, 1, 2, 3, 4, 5, 4, 4, 6, 1, 7, 8, 9, 10, 4, 11, 4, 2, 2, 11, 2, 12 } ;static yyconst short int yy_base[153] = { 0, 0, 0, 261, 260, 18, 31, 261, 248, 243, 234, 24, 37, 23, 25, 239, 466, 466, 466, 225, 466, 48, 40, 466, 54, 46, 65, 55, 79, 218, 71, 97, 220, 0, 51, 0, 106, 61, 0, 0, 466, 0, 76, 466, 82, 466, 0, 85, 0, 214, 89, 94, 49, 203, 190, 57, 122, 180, 0, 142, 158, 106, 144, 0, 177, 96, 170, 146, 0, 142, 466, 466, 0, 87, 173, 0, 0, 141, 93, 150, 0, 0, 112, 175, 164, 0, 177, 182, 466, 466, 466, 466, 80, 466, 187, 466, 200, 158, 0, 184, 0, 76, 213, 62, 200, 466, 0, 33, 228, 466, 230, 233, 466, 186, 242, 244, 466, 246, 253, 466, 0, 466, 149, 206, 13, 255, 0, 260, 262, 219, 466, 257, 466, 272, 284, 296, 308, 320, 332, 341, 349, 360, 372, 381, 390, 402, 414, 425, 437, 442, 446, 450, 454 } ;static yyconst short int yy_def[153] = { 0, 132, 1, 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, 132, 132, 132, 132, 139, 132, 139, 21, 132, 132, 21, 132, 22, 132, 22, 140, 140, 31, 141, 132, 142, 142, 143, 36, 144, 132, 145, 132, 132, 132, 132, 146, 132, 147, 139, 139, 132, 50, 132, 52, 132, 132, 132, 28, 132, 148, 56, 132, 149, 59, 132, 139, 132, 150, 31, 132, 132, 141, 132, 132, 142, 36, 143, 143, 143, 144, 145, 132, 132, 132, 146, 132, 132, 132, 132, 132, 132, 132, 132, 56, 132, 94, 96, 94, 132, 151, 148, 148, 102, 102, 132, 64, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 94, 132, 148, 102, 148, 132, 152, 148, 148, 132, 132, 132, 0, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132 } ;static yyconst short int yy_nxt[488] = { 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 22, 22, 25, 26, 27, 28, 29, 30, 31, 30, 32, 16, 36, 122, 36, 36, 44, 44, 37, 36, 36, 47, 38, 47, 36, 36, 45, 36, 36, 44, 44, 37, 36, 36, 48, 38, 48, 36, 108, 45, 51, 51, 54, 73, 74, 132, 51, 51, 56, 57, 52, 58, 91, 53, 92, 60, 55, 51, 51, 61, 93, 77, 93, 67, 67, 79, 123, 55, 82, 83, 59, 62, 62, 68, 84, 84, 122, 86, 87, 73, 74, 63, 64, 88, 58, 53, 51, 51, 65, 67, 67, 50, 90, 77, 90, 70, 55, 107, 107, 68, 76, 108, 76, 76, 82, 83, 77, 76, 76, 94, 76, 94, 76, 94, 94, 95, 96, 94, 96, 96, 94, 94, 96, 96, 97, 98, 96, 98, 96, 94, 94, 94, 94, 94, 99, 99, 62, 62, 67, 67, 132, 77, 113, 113, 100, 79, 63, 59, 68, 122, 77, 65, 102, 127, 102, 102, 84, 84, 103, 102, 104, 120, 102, 120, 102, 110, 111, 114, 115, 86, 87, 112, 50, 116, 117, 118, 99, 99, 113, 113, 119, 94, 106, 94, 94, 59, 100, 94, 94, 94, 94, 94, 94, 94, 96, 91, 96, 96, 128, 129, 96, 96, 97, 124, 96, 124, 96, 102, 53, 102, 102, 131, 129, 103, 102, 104, 50, 102, 71, 102, 125, 125, 110, 111, 66, 110, 111, 50, 112, 132, 126, 112, 42, 108, 114, 115, 114, 115, 117, 118, 116, 42, 116, 40, 119, 117, 118, 125, 125, 131, 129, 119, 128, 129, 128, 129, 40, 126, 34, 34, 122, 132, 122, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 49, 132, 132, 49, 49, 49, 69, 69, 132, 132, 132, 132, 132, 69, 132, 69, 72, 72, 72, 72, 72, 132, 72, 72, 72, 72, 72, 72, 75, 75, 75, 75, 75, 75, 132, 75, 75, 75, 75, 75, 78, 132, 132, 78, 78, 78, 80, 80, 80, 80, 132, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 132, 81, 81, 81, 81, 81, 81, 85, 85, 85, 85, 85, 132, 85, 85, 85, 85, 85, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 101, 101, 132, 101, 101, 101, 101, 101, 101, 101, 101, 101, 105, 105, 105, 105, 109, 109, 109, 109, 121, 121, 121, 121, 130, 130, 130, 130, 15, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132 } ;static yyconst short int yy_chk[488] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 124, 5, 5, 11, 11, 5, 5, 5, 13, 5, 14, 5, 6, 11, 6, 6, 12, 12, 6, 6, 6, 13, 6, 14, 6, 107, 12, 21, 21, 22, 34, 34, 22, 24, 24, 25, 25, 21, 25, 52, 21, 52, 27, 24, 26, 26, 27, 55, 37, 55, 30, 30, 37, 103, 26, 42, 42, 26, 28, 28, 30, 44, 44, 101, 47, 47, 73, 73, 28, 28, 47, 28, 92, 51, 51, 28, 31, 31, 50, 50, 78, 50, 31, 51, 65, 65, 31, 36, 65, 36, 36, 82, 82, 36, 36, 36, 61, 36, 61, 36, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 59, 59, 62, 62, 67, 67, 69, 77, 79, 79, 59, 77, 62, 59, 67, 122, 79, 59, 60, 122, 60, 60, 84, 84, 60, 60, 60, 97, 60, 97, 60, 74, 74, 83, 83, 86, 86, 74, 66, 83, 87, 87, 99, 99, 113, 113, 87, 94, 64, 94, 94, 57, 99, 94, 94, 94, 94, 94, 94, 94, 96, 54, 96, 96, 123, 123, 96, 96, 96, 104, 96, 104, 96, 102, 53, 102, 102, 129, 129, 102, 102, 102, 49, 102, 32, 102, 108, 108, 110, 110, 29, 111, 111, 19, 110, 15, 108, 111, 10, 108, 114, 114, 115, 115, 117, 117, 114, 9, 115, 8, 117, 118, 118, 125, 125, 131, 131, 118, 127, 127, 128, 128, 7, 125, 4, 3, 127, 0, 128, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 0, 0, 139, 139, 139, 140, 140, 0, 0, 0, 0, 0, 140, 0, 140, 141, 141, 141, 141, 141, 0, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 0, 142, 142, 142, 142, 142, 143, 0, 0, 143, 143, 143, 144, 144, 144, 144, 0, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 0, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 0, 146, 146, 146, 146, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 0, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 150, 150, 150, 150, 151, 151, 151, 151, 152, 152, 152, 152, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132 } ;static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;static char *yy_full_match;static int yy_lp;static int yy_looking_for_trail_begin = 0;static int yy_full_lp;static int *yy_full_state;#define YY_TRAILING_MASK 0x2000#define YY_TRAILING_HEAD_MASK 0x4000#define REJECT \{ \*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \yy_cp = yy_full_match; /* restore poss. backed-over text */ \yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \yy_state_ptr = yy_full_state; /* restore orig. state */ \yy_current_state = *yy_state_ptr; /* restore curr. state */ \++yy_lp; \goto find_rule; \}#define yymore() yymore_used_but_not_detected#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSETchar *yytext;#line 1 "scan.l"#define INITIAL 0#line 2 "scan.l"/*------------------------------------------------------------------------- * * scan.l * lexical scanner for POSTGRES * * Copyright (c) 1994, Regents of the University of California * * * IDENTIFICATION * $Header: /usr/local/cvsroot/pgsql/src/backend/parser/scan.l,v 1.50 1999/07/08 00:00:43 momjian Exp $ * *------------------------------------------------------------------------- */#include <ctype.h>#include <unistd.h>#ifndef __linux__#include <math.h>#else#include <stdlib.h>#endif /* __linux__ */#include <string.h>#include <errno.h>#include "postgres.h"#include "miscadmin.h"#include "nodes/pg_list.h"#include "nodes/parsenodes.h"#include "parser/gramparse.h"#include "parser/keywords.h"#include "parser/scansup.h"#include "parse.h"#include "utils/builtins.h"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -