PostgreSQL Source Code git master
|
#include "postgres.h"
#include "mb/pg_wchar.h"
#include "parser/scanner.h"
#include "plpgsql.h"
#include "pl_gram.h"
#include "pl_reserved_kwlist_d.h"
#include "pl_unreserved_kwlist_d.h"
#include "pl_reserved_kwlist.h"
#include "pl_unreserved_kwlist.h"
Go to the source code of this file.
Data Structures | |
struct | TokenAuxData |
struct | plpgsql_yy_extra_type |
struct | yyguts_t |
Macros | |
#define | PG_KEYWORD(kwname, value) value, |
#define | AT_STMT_START(prev_token) |
#define | MAX_PUSHBACKS 4 |
#define | yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) |
Functions | |
static int | internal_yylex (TokenAuxData *auxdata, yyscan_t yyscanner) |
static void | push_back_token (int token, TokenAuxData *auxdata, yyscan_t yyscanner) |
static void | location_lineno_init (yyscan_t yyscanner) |
int | plpgsql_yylex (YYSTYPE *yylvalp, YYLTYPE *yyllocp, yyscan_t yyscanner) |
int | plpgsql_token_length (yyscan_t yyscanner) |
void | plpgsql_push_back_token (int token, YYSTYPE *yylvalp, YYLTYPE *yyllocp, yyscan_t yyscanner) |
bool | plpgsql_token_is_unreserved_keyword (int token) |
void | plpgsql_append_source_text (StringInfo buf, int startlocation, int endlocation, yyscan_t yyscanner) |
int | plpgsql_peek (yyscan_t yyscanner) |
void | plpgsql_peek2 (int *tok1_p, int *tok2_p, int *tok1_loc, int *tok2_loc, yyscan_t yyscanner) |
int | plpgsql_scanner_errposition (int location, yyscan_t yyscanner) |
void | plpgsql_yyerror (YYLTYPE *yyllocp, PLpgSQL_stmt_block **plpgsql_parse_result_p, yyscan_t yyscanner, const char *message) |
int | plpgsql_location_to_lineno (int location, yyscan_t yyscanner) |
int | plpgsql_latest_lineno (yyscan_t yyscanner) |
yyscan_t | plpgsql_scanner_init (const char *str) |
void | plpgsql_scanner_finish (yyscan_t yyscanner) |
Variables | |
IdentifierLookup | plpgsql_IdentifierLookup = IDENTIFIER_LOOKUP_NORMAL |
static const uint16 | ReservedPLKeywordTokens [] |
static const uint16 | UnreservedPLKeywordTokens [] |
#define AT_STMT_START | ( | prev_token | ) |
Definition at line 82 of file pl_scanner.c.
#define MAX_PUSHBACKS 4 |
Definition at line 98 of file pl_scanner.c.
Definition at line 64 of file pl_scanner.c.
#define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) |
Definition at line 147 of file pl_scanner.c.
|
static |
Definition at line 339 of file pl_scanner.c.
References core_yylex(), TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, pstrdup(), token, and yyextra.
Referenced by plpgsql_peek(), plpgsql_peek2(), and plpgsql_yylex().
|
static |
Definition at line 597 of file pl_scanner.c.
References yyextra.
Referenced by plpgsql_location_to_lineno(), and plpgsql_scanner_init().
void plpgsql_append_source_text | ( | StringInfo | buf, |
int | startlocation, | ||
int | endlocation, | ||
yyscan_t | yyscanner | ||
) |
Definition at line 435 of file pl_scanner.c.
References appendBinaryStringInfo(), Assert, buf, and yyextra.
int plpgsql_latest_lineno | ( | yyscan_t | yyscanner | ) |
Definition at line 607 of file pl_scanner.c.
References yyextra.
Referenced by plpgsql_compile_error_callback().
int plpgsql_location_to_lineno | ( | int | location, |
yyscan_t | yyscanner | ||
) |
Definition at line 573 of file pl_scanner.c.
References plpgsql_yy_extra_type::cur_line_start, location_lineno_init(), plpgsql_yy_extra_type::scanorig, and yyextra.
int plpgsql_peek | ( | yyscan_t | yyscanner | ) |
Definition at line 452 of file pl_scanner.c.
References internal_yylex(), and push_back_token().
void plpgsql_peek2 | ( | int * | tok1_p, |
int * | tok2_p, | ||
int * | tok1_loc, | ||
int * | tok2_loc, | ||
yyscan_t | yyscanner | ||
) |
Definition at line 471 of file pl_scanner.c.
References internal_yylex(), TokenAuxData::lloc, and push_back_token().
void plpgsql_push_back_token | ( | int | token, |
YYSTYPE * | yylvalp, | ||
YYLTYPE * | yyllocp, | ||
yyscan_t | yyscanner | ||
) |
Definition at line 401 of file pl_scanner.c.
References TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, push_back_token(), token, and yyextra.
int plpgsql_scanner_errposition | ( | int | location, |
yyscan_t | yyscanner | ||
) |
Definition at line 504 of file pl_scanner.c.
References internalerrposition(), internalerrquery(), pg_mbstrlen_with_len(), plpgsql_yy_extra_type::scanorig, and yyextra.
Referenced by plpgsql_yyerror().
void plpgsql_scanner_finish | ( | yyscan_t | yyscanner | ) |
Definition at line 653 of file pl_scanner.c.
References scanner_finish().
Referenced by do_compile(), and plpgsql_compile_inline().
yyscan_t plpgsql_scanner_init | ( | const char * | str | ) |
Definition at line 621 of file pl_scanner.c.
References IDENTIFIER_LOOKUP_NORMAL, location_lineno_init(), plpgsql_yy_extra_type::num_pushbacks, palloc0_object, plpgsql_IdentifierLookup, plpgsql_yy_extra_type::plpgsql_yytoken, ReservedPLKeywordTokens, scanner_init(), plpgsql_yy_extra_type::scanorig, and str.
Referenced by do_compile(), and plpgsql_compile_inline().
bool plpgsql_token_is_unreserved_keyword | ( | int | token | ) |
Definition at line 418 of file pl_scanner.c.
References i, lengthof, token, and UnreservedPLKeywordTokens.
int plpgsql_token_length | ( | yyscan_t | yyscanner | ) |
Definition at line 327 of file pl_scanner.c.
References yyextra.
void plpgsql_yyerror | ( | YYLTYPE * | yyllocp, |
PLpgSQL_stmt_block ** | plpgsql_parse_result_p, | ||
yyscan_t | yyscanner, | ||
const char * | message | ||
) |
Definition at line 534 of file pl_scanner.c.
References _, ereport, errcode(), errmsg(), ERROR, plpgsql_scanner_errposition(), and yyextra.
Definition at line 160 of file pl_scanner.c.
References AT_STMT_START, GetScanKeyword(), internal_yylex(), TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, plpgsql_parse_dblword(), plpgsql_parse_tripword(), plpgsql_parse_word(), push_back_token(), ScanKeywordLookup(), UnreservedPLKeywordTokens, and yyextra.
|
static |
Definition at line 385 of file pl_scanner.c.
References elog, ERROR, MAX_PUSHBACKS, token, and yyextra.
Referenced by plpgsql_peek(), plpgsql_peek2(), plpgsql_push_back_token(), and plpgsql_yylex().
IdentifierLookup plpgsql_IdentifierLookup = IDENTIFIER_LOOKUP_NORMAL |
Definition at line 26 of file pl_scanner.c.
Referenced by plpgsql_parse_dblword(), plpgsql_parse_tripword(), plpgsql_parse_word(), and plpgsql_scanner_init().
|
static |
Definition at line 66 of file pl_scanner.c.
Referenced by plpgsql_scanner_init().
|
static |
Definition at line 70 of file pl_scanner.c.
Referenced by plpgsql_token_is_unreserved_keyword(), and plpgsql_yylex().