PostgreSQL Source Code git master
|
#include "postgres.h"
#include <ctype.h>
#include <unistd.h>
#include "common/string.h"
#include "gramparse.h"
#include "nodes/miscnodes.h"
#include "parser/parser.h"
#include "parser/scansup.h"
#include "port/pg_bitutils.h"
#include "mb/pg_wchar.h"
#include "utils/builtins.h"
#include "parser/kwlist.h"
Go to the source code of this file.
Macros | |
#define | fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg) |
#define | PG_KEYWORD(kwname, value, category, collabel) value, |
#define | YYSTYPE core_YYSTYPE |
#define | SET_YYLLOC() (*(yylloc) = yytext - yyextra->scanbuf) |
#define | ADVANCE_YYLLOC(delta) ( *(yylloc) += (delta) ) |
#define | PUSH_YYLLOC() (yyextra->save_yylloc = *(yylloc)) |
#define | POP_YYLLOC() (*(yylloc) = yyextra->save_yylloc) |
#define | startlit() ( yyextra->literallen = 0 ) |
#define | yyerror(msg) scanner_yyerror(msg, yyscanner) |
#define | lexer_errposition() scanner_errposition(*(yylloc), yyscanner) |
#define | yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) |
#define | yylloc (((struct yyguts_t *) yyscanner)->yylloc_r) |
#define | yyleng (((struct yyguts_t *) yyscanner)->yyleng_r) |
Functions | |
static void | fprintf_to_ereport (const char *fmt, const char *msg) |
static void | addlit (char *ytext, int yleng, core_yyscan_t yyscanner) |
static void | addlitchar (unsigned char ychar, core_yyscan_t yyscanner) |
static char * | litbufdup (core_yyscan_t yyscanner) |
static unsigned char | unescape_single_char (unsigned char c, core_yyscan_t yyscanner) |
static int | process_integer_literal (const char *token, YYSTYPE *lval, int base) |
static void | addunicode (pg_wchar c, yyscan_t yyscanner) |
static void | check_string_escape_warning (unsigned char ychar, core_yyscan_t yyscanner) |
static void | check_escape_warning (core_yyscan_t yyscanner) |
int | yylex (YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner) |
int | scanner_errposition (int location, core_yyscan_t yyscanner) |
static void | scb_error_callback (void *arg) |
void | setup_scanner_errposition_callback (ScannerCallbackState *scbstate, core_yyscan_t yyscanner, int location) |
void | cancel_scanner_errposition_callback (ScannerCallbackState *scbstate) |
void | scanner_yyerror (const char *message, 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 | scanner_finish (core_yyscan_t yyscanner) |
void * | core_yyalloc (yy_size_t bytes, core_yyscan_t yyscanner) |
void * | core_yyrealloc (void *ptr, yy_size_t bytes, core_yyscan_t yyscanner) |
void | core_yyfree (void *ptr, core_yyscan_t yyscanner) |
Variables | |
int | backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING |
bool | escape_string_warning = true |
bool | standard_conforming_strings = true |
const uint16 | ScanKeywordTokens [] |
#define fprintf | ( | file, | |
fmt, | |||
msg | |||
) | fprintf_to_ereport(fmt, msg) |
#define lexer_errposition | ( | ) | scanner_errposition(*(yylloc), yyscanner) |
#define startlit | ( | ) | ( yyextra->literallen = 0 ) |
#define yyerror | ( | msg | ) | scanner_yyerror(msg, yyscanner) |
#define yyextra (((struct yyguts_t *) yyscanner)->yyextra_r) |
#define YYSTYPE core_YYSTYPE |
|
static |
Definition at line 1311 of file scan.l.
References pg_nextpower2_32(), repalloc(), and yyextra.
Referenced by addunicode().
|
static |
Definition at line 1379 of file scan.l.
References addlit(), buf, cancel_scanner_errposition_callback(), is_valid_unicode_codepoint(), MAX_UNICODE_EQUIVALENT_STRING, pg_unicode_to_server(), setup_scanner_errposition_callback(), yyerror, and yylloc.
void cancel_scanner_errposition_callback | ( | ScannerCallbackState * | scbstate | ) |
Definition at line 1203 of file scan.l.
References ScannerCallbackState::errcallback, error_context_stack, and ErrorContextCallback::previous.
Referenced by addunicode(), and str_udeescape().
|
static |
Definition at line 1451 of file scan.l.
References ereport, errcode(), errhint(), errmsg(), lexer_errposition, WARNING, and yyextra.
Referenced by check_string_escape_warning().
|
static |
Definition at line 1424 of file scan.l.
References check_escape_warning(), ereport, errcode(), errhint(), errmsg(), lexer_errposition, WARNING, and yyextra.
void * core_yyalloc | ( | yy_size_t | bytes, |
core_yyscan_t | yyscanner | ||
) |
void core_yyfree | ( | void * | ptr, |
core_yyscan_t | yyscanner | ||
) |
void * core_yyrealloc | ( | void * | ptr, |
yy_size_t | bytes, | ||
core_yyscan_t | yyscanner | ||
) |
|
static |
|
static |
|
static |
Definition at line 1362 of file scan.l.
References ErrorSaveContext::error_occurred, pg_strtoint32_safe(), pstrdup(), token, and val.
int scanner_errposition | ( | int | location, |
core_yyscan_t | yyscanner | ||
) |
Definition at line 1140 of file scan.l.
References errposition(), pg_mbstrlen_with_len(), and yyextra.
Referenced by scb_error_callback(), and str_udeescape().
void scanner_finish | ( | core_yyscan_t | yyscanner | ) |
Definition at line 1291 of file scan.l.
References pfree(), and yyextra.
Referenced by fill_in_constant_lengths(), plpgsql_scanner_finish(), and raw_parser().
core_yyscan_t scanner_init | ( | const char * | str, |
core_yy_extra_type * | yyext, | ||
const ScanKeywordList * | keywordlist, | ||
const uint16 * | keyword_tokens | ||
) |
Definition at line 1249 of file scan.l.
References backslash_quote, core_yy_extra_type::backslash_quote, elog, ERROR, escape_string_warning, core_yy_extra_type::escape_string_warning, core_yy_extra_type::keyword_tokens, core_yy_extra_type::keywordlist, core_yy_extra_type::literalalloc, core_yy_extra_type::literalbuf, core_yy_extra_type::literallen, palloc(), core_yy_extra_type::scanbuf, core_yy_extra_type::scanbuflen, standard_conforming_strings, core_yy_extra_type::standard_conforming_strings, and str.
Referenced by fill_in_constant_lengths(), plpgsql_scanner_init(), and raw_parser().
void scanner_yyerror | ( | const char * | message, |
core_yyscan_t | yyscanner | ||
) |
Definition at line 1222 of file scan.l.
References _, ereport, errcode(), errmsg(), ERROR, lexer_errposition, yyextra, and yylloc.
Referenced by base_yylex().
|
static |
Definition at line 1161 of file scan.l.
References arg, geterrcode(), ScannerCallbackState::location, scanner_errposition(), and ScannerCallbackState::yyscanner.
Referenced by setup_scanner_errposition_callback().
void setup_scanner_errposition_callback | ( | ScannerCallbackState * | scbstate, |
core_yyscan_t | yyscanner, | ||
int | location | ||
) |
Definition at line 1186 of file scan.l.
References ErrorContextCallback::arg, ErrorContextCallback::callback, ScannerCallbackState::errcallback, error_context_stack, ScannerCallbackState::location, ErrorContextCallback::previous, scb_error_callback(), and ScannerCallbackState::yyscanner.
Referenced by addunicode(), and str_udeescape().
|
static |
Definition at line 1398 of file scan.l.
References IS_HIGHBIT_SET, and yyextra.
Definition at line 441 of file scan.l.
int backslash_quote = BACKSLASH_QUOTE_SAFE_ENCODING |
Definition at line 68 of file scan.l.
Referenced by scanner_init().
bool escape_string_warning = true |
Definition at line 69 of file scan.l.
Referenced by scanner_init().
const uint16 ScanKeywordTokens[] |
Definition at line 81 of file scan.l.
Referenced by fill_in_constant_lengths(), and raw_parser().
bool standard_conforming_strings = true |
Definition at line 70 of file scan.l.
Referenced by scanner_init(), and simple_quote_literal().