60#include "pl_reserved_kwlist_d.h"
61#include "pl_unreserved_kwlist_d.h"
64#define PG_KEYWORD(kwname, value) value,
82#define AT_STMT_START(prev_token) \
83 ((prev_token) == ';' || \
84 (prev_token) == K_BEGIN || \
85 (prev_token) == K_THEN || \
86 (prev_token) == K_ELSE || \
87 (prev_token) == K_LOOP)
98#define MAX_PUSHBACKS 4
147#define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r)
167 if (tok1 == IDENT || tok1 == PARAM)
246 else if (!aux1.
lval.word.quoted &&
248 &UnreservedPLKeywords)) >= 0)
251 &UnreservedPLKeywords);
283 (tok2 ==
'=' || tok2 == COLON_EQUALS ||
288 else if (!aux1.
lval.word.quoted &&
290 &UnreservedPLKeywords)) >= 0)
293 &UnreservedPLKeywords);
314 *yylvalp = aux1.
lval;
315 *yyllocp = aux1.
lloc;
317 yyextra->plpgsql_yytoken = tok1;
329 return yyextra->plpgsql_yyleng;
344 if (
yyextra->num_pushbacks > 0)
357 yytext =
yyextra->core_yy_extra.scanbuf + auxdata->
lloc;
358 auxdata->
leng = strlen(yytext);
363 if (strcmp(auxdata->
lval.str,
"<<") == 0)
365 else if (strcmp(auxdata->
lval.str,
">>") == 0)
366 token = GREATER_GREATER;
367 else if (strcmp(auxdata->
lval.str,
"#") == 0)
372 else if (
token == PARAM)
388 elog(
ERROR,
"too many tokens pushed back");
405 auxdata.
lval = *yylvalp;
406 auxdata.
lloc = *yyllocp;
436 int startlocation,
int endlocation,
439 Assert(startlocation <= endlocation);
441 endlocation - startlocation);
483 *tok1_loc = aux1.
lloc;
486 *tok2_loc = aux2.
lloc;
508 if (location < 0 || yyextra->
scanorig == NULL)
533 char *yytext =
yyextra->core_yy_extra.scanbuf + *yyllocp;
538 (
errcode(ERRCODE_SYNTAX_ERROR),
540 errmsg(
"%s at end of input",
_(message)),
551 yytext[
yyextra->plpgsql_yyleng] =
'\0';
554 (
errcode(ERRCODE_SYNTAX_ERROR),
556 errmsg(
"%s at or near \"%s\"",
_(message), yytext),
574 if (location < 0 || yyextra->
scanorig == NULL)
576 loc =
yyextra->scanorig + location;
582 while (
yyextra->cur_line_end != NULL && loc >
yyextra->cur_line_end)
#define Assert(condition)
int internalerrquery(const char *query)
int internalerrposition(int cursorpos)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc0_object(type)
int ScanKeywordLookup(const char *str, const ScanKeywordList *keywords)
static const char * GetScanKeyword(int n, const ScanKeywordList *keywords)
int pg_mbstrlen_with_len(const char *mbstr, int limit)
char * pstrdup(const char *in)
bool plpgsql_parse_dblword(char *word1, char *word2, PLwdatum *wdatum, PLcword *cword)
bool plpgsql_parse_word(char *word1, const char *yytxt, bool lookup, PLwdatum *wdatum, PLword *word)
bool plpgsql_parse_tripword(char *word1, char *word2, char *word3, PLwdatum *wdatum, PLcword *cword)
#define AT_STMT_START(prev_token)
void plpgsql_append_source_text(StringInfo buf, int startlocation, int endlocation, yyscan_t yyscanner)
void plpgsql_peek2(int *tok1_p, int *tok2_p, int *tok1_loc, int *tok2_loc, yyscan_t yyscanner)
int plpgsql_token_length(yyscan_t yyscanner)
int plpgsql_yylex(YYSTYPE *yylvalp, YYLTYPE *yyllocp, yyscan_t yyscanner)
static const uint16 UnreservedPLKeywordTokens[]
IdentifierLookup plpgsql_IdentifierLookup
void plpgsql_scanner_finish(yyscan_t yyscanner)
bool plpgsql_token_is_unreserved_keyword(int token)
static const uint16 ReservedPLKeywordTokens[]
static void push_back_token(int token, TokenAuxData *auxdata, yyscan_t yyscanner)
yyscan_t plpgsql_scanner_init(const char *str)
int plpgsql_scanner_errposition(int location, yyscan_t yyscanner)
static int internal_yylex(TokenAuxData *auxdata, yyscan_t yyscanner)
void plpgsql_push_back_token(int token, YYSTYPE *yylvalp, YYLTYPE *yyllocp, yyscan_t yyscanner)
int plpgsql_peek(yyscan_t yyscanner)
int plpgsql_location_to_lineno(int location, yyscan_t yyscanner)
void plpgsql_yyerror(YYLTYPE *yyllocp, yyscan_t yyscanner, const char *message)
static void location_lineno_init(yyscan_t yyscanner)
int plpgsql_latest_lineno(yyscan_t yyscanner)
@ IDENTIFIER_LOOKUP_NORMAL
core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeywordList *keywordlist, const uint16 *keyword_tokens)
void scanner_finish(core_yyscan_t yyscanner)
int core_yylex(core_YYSTYPE *yylval_param, YYLTYPE *yylloc_param, core_yyscan_t yyscanner)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
struct plpgsql_yy_extra_type * yyextra_r