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 |
Macros | |
#define | PG_KEYWORD(kwname, value) value, |
#define | AT_STMT_START(prev_token) |
#define | MAX_PUSHBACKS 4 |
Functions | |
static int | internal_yylex (TokenAuxData *auxdata) |
static void | push_back_token (int token, TokenAuxData *auxdata) |
static void | location_lineno_init (void) |
int | plpgsql_yylex (void) |
int | plpgsql_token_length (void) |
void | plpgsql_push_back_token (int token) |
bool | plpgsql_token_is_unreserved_keyword (int token) |
void | plpgsql_append_source_text (StringInfo buf, int startlocation, int endlocation) |
int | plpgsql_peek (void) |
void | plpgsql_peek2 (int *tok1_p, int *tok2_p, int *tok1_loc, int *tok2_loc) |
int | plpgsql_scanner_errposition (int location) |
void | plpgsql_yyerror (const char *message) |
int | plpgsql_location_to_lineno (int location) |
int | plpgsql_latest_lineno (void) |
void | plpgsql_scanner_init (const char *str) |
void | plpgsql_scanner_finish (void) |
Variables | |
IdentifierLookup | plpgsql_IdentifierLookup = IDENTIFIER_LOOKUP_NORMAL |
static const uint16 | ReservedPLKeywordTokens [] |
static const uint16 | UnreservedPLKeywordTokens [] |
static core_yyscan_t | yyscanner = NULL |
static core_yy_extra_type | core_yy |
static const char * | scanorig |
static int | plpgsql_yyleng |
static int | plpgsql_yytoken |
static int | num_pushbacks |
static int | pushback_token [MAX_PUSHBACKS] |
static TokenAuxData | pushback_auxdata [MAX_PUSHBACKS] |
static const char * | cur_line_start |
static const char * | cur_line_end |
static int | cur_line_num |
#define AT_STMT_START | ( | prev_token | ) |
Definition at line 82 of file pl_scanner.c.
#define MAX_PUSHBACKS 4 |
Definition at line 119 of file pl_scanner.c.
Definition at line 64 of file pl_scanner.c.
|
static |
Definition at line 325 of file pl_scanner.c.
References core_yy, core_yylex(), TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, num_pushbacks, pstrdup(), pushback_auxdata, pushback_token, core_yy_extra_type::scanbuf, token, and yyscanner.
Referenced by plpgsql_peek(), plpgsql_peek2(), and plpgsql_yylex().
|
static |
Definition at line 579 of file pl_scanner.c.
References cur_line_end, cur_line_num, cur_line_start, and scanorig.
Referenced by plpgsql_location_to_lineno(), and plpgsql_scanner_init().
void plpgsql_append_source_text | ( | StringInfo | buf, |
int | startlocation, | ||
int | endlocation | ||
) |
Definition at line 421 of file pl_scanner.c.
References appendBinaryStringInfo(), Assert, buf, and scanorig.
int plpgsql_latest_lineno | ( | void | ) |
Definition at line 589 of file pl_scanner.c.
References cur_line_num.
Referenced by plpgsql_compile_error_callback().
int plpgsql_location_to_lineno | ( | int | location | ) |
Definition at line 555 of file pl_scanner.c.
References cur_line_end, cur_line_num, cur_line_start, location_lineno_init(), and scanorig.
int plpgsql_peek | ( | void | ) |
Definition at line 437 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 | ||
) |
Definition at line 456 of file pl_scanner.c.
References internal_yylex(), TokenAuxData::lloc, and push_back_token().
void plpgsql_push_back_token | ( | int | token | ) |
Definition at line 387 of file pl_scanner.c.
References TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, plpgsql_yyleng, push_back_token(), and token.
int plpgsql_scanner_errposition | ( | int | location | ) |
Definition at line 489 of file pl_scanner.c.
References internalerrposition(), internalerrquery(), pg_mbstrlen_with_len(), and scanorig.
Referenced by plpgsql_yyerror().
void plpgsql_scanner_finish | ( | void | ) |
Definition at line 630 of file pl_scanner.c.
References scanner_finish(), scanorig, and yyscanner.
Referenced by do_compile(), and plpgsql_compile_inline().
void plpgsql_scanner_init | ( | const char * | str | ) |
Definition at line 603 of file pl_scanner.c.
References core_yy, IDENTIFIER_LOOKUP_NORMAL, location_lineno_init(), num_pushbacks, plpgsql_IdentifierLookup, plpgsql_yytoken, ReservedPLKeywordTokens, scanner_init(), scanorig, str, and yyscanner.
Referenced by do_compile(), and plpgsql_compile_inline().
bool plpgsql_token_is_unreserved_keyword | ( | int | token | ) |
Definition at line 404 of file pl_scanner.c.
References i, lengthof, token, and UnreservedPLKeywordTokens.
int plpgsql_token_length | ( | void | ) |
Definition at line 313 of file pl_scanner.c.
References plpgsql_yyleng.
void plpgsql_yyerror | ( | const char * | message | ) |
Definition at line 516 of file pl_scanner.c.
References _, core_yy, ereport, errcode(), errmsg(), ERROR, plpgsql_scanner_errposition(), plpgsql_yyleng, and core_yy_extra_type::scanbuf.
int plpgsql_yylex | ( | void | ) |
Definition at line 146 of file pl_scanner.c.
References AT_STMT_START, core_yy, GetScanKeyword(), internal_yylex(), TokenAuxData::leng, TokenAuxData::lloc, TokenAuxData::lval, plpgsql_parse_dblword(), plpgsql_parse_tripword(), plpgsql_parse_word(), plpgsql_yyleng, plpgsql_yytoken, push_back_token(), core_yy_extra_type::scanbuf, ScanKeywordLookup(), and UnreservedPLKeywordTokens.
|
static |
Definition at line 371 of file pl_scanner.c.
References elog, ERROR, MAX_PUSHBACKS, num_pushbacks, pushback_auxdata, pushback_token, and token.
Referenced by plpgsql_peek(), plpgsql_peek2(), plpgsql_push_back_token(), and plpgsql_yylex().
|
static |
Definition at line 107 of file pl_scanner.c.
Referenced by internal_yylex(), plpgsql_scanner_init(), plpgsql_yyerror(), and plpgsql_yylex().
|
static |
Definition at line 127 of file pl_scanner.c.
Referenced by location_lineno_init(), and plpgsql_location_to_lineno().
|
static |
Definition at line 128 of file pl_scanner.c.
Referenced by location_lineno_init(), plpgsql_latest_lineno(), and plpgsql_location_to_lineno().
|
static |
Definition at line 126 of file pl_scanner.c.
Referenced by location_lineno_init(), and plpgsql_location_to_lineno().
|
static |
Definition at line 121 of file pl_scanner.c.
Referenced by internal_yylex(), plpgsql_scanner_init(), and push_back_token().
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 113 of file pl_scanner.c.
Referenced by plpgsql_push_back_token(), plpgsql_token_length(), plpgsql_yyerror(), and plpgsql_yylex().
|
static |
Definition at line 116 of file pl_scanner.c.
Referenced by plpgsql_scanner_init(), and plpgsql_yylex().
|
static |
Definition at line 123 of file pl_scanner.c.
Referenced by internal_yylex(), and push_back_token().
|
static |
Definition at line 122 of file pl_scanner.c.
Referenced by internal_yylex(), and push_back_token().
|
static |
Definition at line 66 of file pl_scanner.c.
Referenced by plpgsql_scanner_init().
|
static |
Definition at line 110 of file pl_scanner.c.
Referenced by location_lineno_init(), plpgsql_append_source_text(), plpgsql_location_to_lineno(), plpgsql_scanner_errposition(), plpgsql_scanner_finish(), and plpgsql_scanner_init().
|
static |
Definition at line 70 of file pl_scanner.c.
Referenced by plpgsql_token_is_unreserved_keyword(), and plpgsql_yylex().
|
static |
Definition at line 106 of file pl_scanner.c.
Referenced by base_yylex(), fill_in_constant_lengths(), internal_yylex(), plpgsql_scanner_finish(), plpgsql_scanner_init(), process_backslash_command(), raw_parser(), and str_udeescape().