📄 cqllex.cpp
字号:
144, 144, 144, 64, 64, 64, 64, 159, 64, 64, 164, 64, 160, 163, 64, 64, 64, 167, 165, 64, 64, 158, 156, 64, 147, 161, 64, 64, 166, 64, 168, 41, 41, 41, 41, 41, 41, 41, 41, 41, 63, 63, 63, 63, 85, 85, 85, 85, 64, 85, 85, 85, 85, 44, 44, 44, 64, 44, 44, 44, 44, 44, 98, 64, 98, 119, 64, 119, 125, 64, 125, 126, 126, 142, 64, 142, 146, 64, 64, 146, 99, 146, 146, 157, 64, 157, 157, 157, 157, 157, 157, 157, 162, 87, 162, 162, 162, 162, 162, 162, 162, 40, 84, 64, 64, 62, 40, 169, 3, 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, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169 } ;static yyconst short int yy_chk[487] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 108, 8, 8, 8, 12, 168, 12, 12, 12, 14, 27, 14, 14, 14, 15, 108, 15, 15, 15, 17, 24, 17, 17, 17, 18, 23, 18, 18, 18, 17, 20, 20, 27, 19, 18, 19, 19, 19, 26, 28, 8, 23, 29, 28, 23, 24, 26, 30, 17, 31, 26, 28, 33, 32, 34, 42, 33, 28, 29, 30, 33, 29, 35, 85, 166, 41, 31, 41, 41, 41, 31, 32, 34, 35, 45, 66, 45, 46, 46, 46, 47, 66, 47, 47, 47, 48, 82, 48, 48, 48, 47, 50, 50, 50, 42, 48, 49, 163, 49, 49, 49, 51, 85, 51, 51, 51, 41, 82, 162, 47, 52, 51, 52, 52, 52, 45, 55, 55, 55, 53, 52, 53, 53, 53, 56, 56, 56, 55, 68, 57, 51, 57, 57, 57, 65, 56, 69, 70, 71, 57, 72, 65, 75, 73, 76, 70, 75, 68, 77, 78, 80, 81, 71, 86, 79, 69, 83, 76, 72, 65, 73, 79, 161, 78, 83, 81, 158, 157, 77, 103, 80, 88, 88, 88, 89, 103, 89, 89, 89, 96, 96, 96, 88, 90, 89, 90, 90, 90, 105, 110, 96, 93, 86, 93, 93, 93, 94, 110, 94, 94, 94, 93, 95, 104, 95, 106, 105, 95, 95, 95, 97, 107, 97, 112, 113, 97, 97, 97, 115, 114, 116, 117, 113, 104, 106, 126, 115, 112, 116, 131, 107, 114, 120, 120, 120, 118, 129, 118, 128, 117, 118, 118, 118, 121, 121, 121, 122, 135, 122, 131, 128, 122, 122, 122, 123, 123, 123, 124, 124, 124, 130, 129, 136, 137, 126, 135, 139, 146, 130, 137, 140, 140, 140, 148, 139, 141, 141, 141, 143, 143, 143, 136, 144, 144, 144, 153, 159, 154, 160, 148, 164, 165, 159, 167, 153, 156, 155, 152, 151, 165, 160, 150, 149, 147, 145, 138, 146, 154, 134, 133, 164, 132, 167, 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 172, 172, 172, 172, 127, 172, 172, 172, 172, 173, 173, 173, 111, 173, 173, 173, 173, 173, 174, 109, 174, 175, 102, 175, 176, 101, 176, 177, 177, 178, 100, 178, 179, 74, 67, 179, 64, 179, 179, 180, 63, 180, 180, 180, 180, 180, 180, 180, 181, 44, 181, 181, 181, 181, 181, 181, 181, 40, 39, 38, 25, 22, 5, 3, 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, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169 } ;static yy_state_type yy_last_accepting_state;static char *yy_last_accepting_cpos;/* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */#define REJECT reject_used_but_not_detected#define yymore() yymore_used_but_not_detected#define YY_MORE_ADJ 0#define YY_RESTORE_YY_MORE_OFFSETchar *yytext;#line 1 "CQL.l"#define INITIAL 0/**//* This file describes the language tokens possible for CQL. When a token is matched, the token postion is updated in the CQL_globalParserState, copying from the lex buffer to a shared buffer (shared with the lexer and parser) may happen, then a token identifier is returned to the parser.*/ #define YY_NEVER_INTERACTIVE 1#line 41 "CQL.l"extern int CQLInput(char* buffer, int& numRead, int numRequested);extern int CQL_error(const char*);#ifdef CQLINPUT#define YY_INPUT(BUF, NREAD, NREQUESTED) CQLInput(BUF, NREAD, NREQUESTED)#endif#ifdef CQL_DEBUG_LEXER#define DEBUG_LEX 1#else#define DEBUG_LEX 0#endif#include <Pegasus/Common/Config.h>#include <Pegasus/Common/CommonUTF.h>#include <Pegasus/Common/MessageLoader.h>#include "CQLParserState.h"#include <stdlib.h>#include <stdio.h>#include <cstring>#include "CQLObjects.h"#include "CQLYACC.h"PEGASUS_NAMESPACE_BEGIN extern CQLParserState* CQL_globalParserState; PEGASUS_NAMESPACE_ENDstatic char msg_[100];void printf__(char * msg){ if(DEBUG_LEX == 1) printf("%s\n",msg);}int lineno;#line 618 "lex.CQL_.c"/* Macros after this point can all be overridden by user definitions in * section 1. */#ifndef YY_SKIP_YYWRAP#ifdef __cplusplusextern "C" int yywrap YY_PROTO(( void ));#elseextern int yywrap YY_PROTO(( void ));#endif#endif#ifndef YY_NO_UNPUTstatic void yyunput YY_PROTO(( int c, char *buf_ptr ));#endif#ifndef yytext_ptrstatic void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));#endif#ifdef YY_NEED_STRLENstatic int yy_flex_strlen YY_PROTO(( yyconst char * ));#endif#ifndef YY_NO_INPUT#ifdef __cplusplusstatic int yyinput YY_PROTO(( void ));#elsestatic int input YY_PROTO(( void ));#endif#endif#if YY_STACK_USEDstatic int yy_start_stack_ptr = 0;static int yy_start_stack_depth = 0;static int *yy_start_stack = 0;#ifndef YY_NO_PUSH_STATEstatic void yy_push_state YY_PROTO(( int new_state ));#endif#ifndef YY_NO_POP_STATEstatic void yy_pop_state YY_PROTO(( void ));#endif#ifndef YY_NO_TOP_STATEstatic int yy_top_state YY_PROTO(( void ));#endif#else#define YY_NO_PUSH_STATE 1#define YY_NO_POP_STATE 1#define YY_NO_TOP_STATE 1#endif#ifdef YY_MALLOC_DECLYY_MALLOC_DECL#else#if __STDC__#ifndef __cplusplus#include <stdlib.h>#endif#else/* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */#endif#endif/* Amount of stuff to slurp up with each read. */#ifndef YY_READ_BUF_SIZE#define YY_READ_BUF_SIZE 8192#endif/* Copy whatever the last rule matched to the standard output. */#ifndef ECHO/* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )#endif/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */#ifndef YY_INPUT#define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" );#endif/* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */#ifndef yyterminate#define yyterminate() return YY_NULL#endif/* Number of entries by which start-condition stack grows. */#ifndef YY_START_STACK_INCR#define YY_START_STACK_INCR 25#endif/* Report a fatal error. */#ifndef YY_FATAL_ERROR#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )#endif/* Default declaration of generated scanner - a define so the user can * easily add parameters. */#ifndef YY_DECL#define YY_DECL int yylex YY_PROTO(( void ))#endif/* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */#ifndef YY_USER_ACTION#define YY_USER_ACTION#endif/* Code executed at the end of each rule. */#ifndef YY_BREAK#define YY_BREAK break;#endif#define YY_RULE_SETUP \ YY_USER_ACTIONYY_DECL { register yy_state_type yy_current_state; register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act;#line 116 "CQL.l"#line 772 "lex.CQL_.c" if ( yy_init ) { yy_init = 0;#ifdef YY_USER_INIT YY_USER_INIT;#endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start;yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 170 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 439 );yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION;do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action;case 1:YY_RULE_SETUP#line 118 "CQL.l"{ sprintf(msg_,"LEX: %s [SELECT] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return SELECT;} YY_BREAKcase 2:YY_RULE_SETUP#line 127 "CQL.l"{ sprintf(msg_,"LEX: %s [FROM] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return FROM;} YY_BREAKcase 3:YY_RULE_SETUP#line 136 "CQL.l"{ sprintf(msg_,"LEX: %s [WHERE] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return WHERE;} YY_BREAKcase 4:YY_RULE_SETUP#line 145 "CQL.l"{ sprintf(msg_,"LEX: %s [ANY] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return ANY;} YY_BREAKcase 5:YY_RULE_SETUP#line 154 "CQL.l"{ sprintf(msg_,"LEX: %s [AS] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return AS;} YY_BREAKcase 6:YY_RULE_SETUP#line 162 "CQL.l"{ sprintf(msg_,"LEX: %s [ASC] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return ASC;} YY_BREAKcase 7:YY_RULE_SETUP#line 170 "CQL.l"{ sprintf(msg_,"LEX: %s [BY] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return BY;} YY_BREAKcase 8:YY_RULE_SETUP#line 178 "CQL.l"{ sprintf(msg_,"LEX: %s [DESC] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return DESC;} YY_BREAKcase 9:YY_RULE_SETUP#line 187 "CQL.l"{ sprintf(msg_,"LEX: %s [DISTINCT] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++; return DISTINCT;} YY_BREAKcase 10:YY_RULE_SETUP#line 195 "CQL.l"{ sprintf(msg_,"LEX: %s [EVERY] ", yytext); printf__(msg_); CQL_globalParserState->currentTokenPos+=yyleng; CQL_globalParserState->tokenCount++;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -