58 static const int mode_token[] = {
116 int cur_token_length;
122 cur_token =
yyextra->lookahead_token;
123 lvalp->core_yystype =
yyextra->lookahead_yylval;
124 *llocp =
yyextra->lookahead_yylloc;
127 yyextra->have_lookahead =
false;
141 cur_token_length = 6;
144 cur_token_length = 3;
147 cur_token_length = 5;
150 cur_token_length = 4;
154 cur_token_length = strlen(
yyextra->core_yy_extra.scanbuf + *llocp);
157 cur_token_length = 7;
169 *llocp + cur_token_length;
184 yyextra->lookahead_yylloc = *llocp;
190 *(
yyextra->lookahead_end) =
'\0';
192 yyextra->have_lookahead =
true;
202 cur_token = FORMAT_LA;
227 cur_token = NULLS_LA;
248 cur_token = WITHOUT_LA;
276 escstr =
yyextra->lookahead_yylval.str;
285 lvalp->core_yystype.str =
296 yyextra->have_lookahead =
false;
301 lvalp->core_yystype.str =
308 if (cur_token == UIDENT)
312 strlen(lvalp->core_yystype.str),
316 else if (cur_token == USCONST)
330 if (
c >=
'0' &&
c <=
'9')
332 if (
c >=
'a' &&
c <=
'f')
333 return c -
'a' + 0xA;
334 if (
c >=
'A' &&
c <=
'F')
335 return c -
'A' + 0xA;
336 elog(
ERROR,
"invalid hexadecimal digit");
346 (
errcode(ERRCODE_SYNTAX_ERROR),
347 errmsg(
"invalid Unicode escape value")));
394 size_t out_dist = out -
new;
400 out =
new + out_dist;
410 in -
str + position + 3);
418 else if (isxdigit((
unsigned char) in[1]) &&
419 isxdigit((
unsigned char) in[2]) &&
420 isxdigit((
unsigned char) in[3]) &&
421 isxdigit((
unsigned char) in[4]))
425 unicode = (
hexval(in[1]) << 12) +
444 pair_first = unicode;
452 else if (in[1] ==
'+' &&
453 isxdigit((
unsigned char) in[2]) &&
454 isxdigit((
unsigned char) in[3]) &&
455 isxdigit((
unsigned char) in[4]) &&
456 isxdigit((
unsigned char) in[5]) &&
457 isxdigit((
unsigned char) in[6]) &&
458 isxdigit((
unsigned char) in[7]))
462 unicode = (
hexval(in[2]) << 20) +
483 pair_first = unicode;
493 (
errcode(ERRCODE_SYNTAX_ERROR),
494 errmsg(
"invalid Unicode escape"),
495 errhint(
"Unicode escapes must be \\XXXX or \\+XXXXXX.")));
522 (
errcode(ERRCODE_SYNTAX_ERROR),
523 errmsg(
"invalid Unicode surrogate pair"),
static void check_unicode_value(pg_wchar c)
List * raw_parser(const char *str, RawParseMode mode)
static unsigned int hexval(unsigned char c)
static char * str_udeescape(const char *str, char escape, int position, core_yyscan_t yyscanner)
int base_yylex(YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner)
static bool check_uescapechar(unsigned char escape)
#define Assert(condition)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define pg_yyget_extra(yyscanner)
void parser_init(base_yy_extra_type *yyext)
int base_yyparse(core_yyscan_t yyscanner)
static bool next_token(char **lineptr, StringInfo buf, bool *initial_quote, bool *terminating_comma)
PGDLLIMPORT const ScanKeywordList ScanKeywords
void pg_unicode_to_server(pg_wchar c, unsigned char *s)
void * repalloc(void *pointer, Size size)
@ RAW_PARSE_PLPGSQL_ASSIGN2
@ RAW_PARSE_PLPGSQL_ASSIGN1
@ RAW_PARSE_PLPGSQL_ASSIGN3
static PgChecksumMode mode
#define MAX_UNICODE_EQUIVALENT_STRING
static bool is_valid_unicode_codepoint(pg_wchar c)
static pg_wchar surrogate_pair_to_codepoint(pg_wchar first, pg_wchar second)
static bool is_utf16_surrogate_first(pg_wchar c)
static bool is_utf16_surrogate_second(pg_wchar c)
static core_yyscan_t yyscanner
int scanner_errposition(int location, core_yyscan_t yyscanner)
core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeywordList *keywordlist, const uint16 *keyword_tokens)
void setup_scanner_errposition_callback(ScannerCallbackState *scbstate, core_yyscan_t yyscanner, int location)
void scanner_finish(core_yyscan_t yyscanner)
void cancel_scanner_errposition_callback(ScannerCallbackState *scbstate)
const uint16 ScanKeywordTokens[]
void scanner_yyerror(const char *message, core_yyscan_t yyscanner)
int core_yylex(core_YYSTYPE *yylval_param, YYLTYPE *yylloc_param, core_yyscan_t yyscanner)
void truncate_identifier(char *ident, int len, bool warn)
bool scanner_isspace(char ch)