|
PostgreSQL Source Code git master
|
#include "postgres_fe.h"#include "common/logging.h"#include "fe_utils/psqlscan.h"#include "libpq-fe.h"#include "fe_utils/psqlscan_int.h"Go to the source code of this file.
Macros | |
| #define | LEXRES_EOL 0 /* end of input */ |
| #define | LEXRES_SEMI 1 /* command-terminating semicolon found */ |
| #define | LEXRES_BACKSLASH 2 /* backslash command start */ |
| #define | ECHO psqlscan_emit(cur_state, yytext, yyleng) |
Typedefs | |
| typedef int | YYSTYPE |
| #define ECHO psqlscan_emit(cur_state, yytext, yyleng) |
Definition at line 62 of file psqlscan.l.
Definition at line 59 of file psqlscan.l.
Definition at line 57 of file psqlscan.l.
| #define LEXRES_SEMI 1 /* command-terminating semicolon found */ |
Definition at line 58 of file psqlscan.l.
Definition at line 53 of file psqlscan.l.
| PsqlScanResult psql_scan | ( | PsqlScanState | state, |
| PQExpBuffer | query_buf, | ||
| promptStatus_t * | prompt | ||
| ) |
Definition at line 1215 of file psqlscan.l.
References Assert, fb(), fprintf, LEXRES_BACKSLASH, LEXRES_EOL, LEXRES_SEMI, PROMPT_COMMENT, PROMPT_CONTINUE, PROMPT_DOLLARQUOTE, PROMPT_DOUBLEQUOTE, PROMPT_PAREN, PROMPT_READY, PROMPT_SINGLEQUOTE, PSCAN_BACKSLASH, PSCAN_EOL, PSCAN_INCOMPLETE, PSCAN_SEMICOLON, result, and yylex().
Referenced by MainLoop(), ParseScript(), and test_psql_parse().
| PsqlScanState psql_scan_create | ( | const PsqlScanCallbacks * | callbacks | ) |
Definition at line 1095 of file psqlscan.l.
References fb(), pg_malloc0_object, and psql_scan_reset().
Referenced by main(), MainLoop(), ParseScript(), and test_psql_parse().
| void psql_scan_destroy | ( | PsqlScanState | state | ) |
Definition at line 1116 of file psqlscan.l.
References fb(), free, psql_scan_finish(), and psql_scan_reset().
Referenced by main(), MainLoop(), ParseScript(), and test_psql_parse().
| void psql_scan_finish | ( | PsqlScanState | state | ) |
Definition at line 1342 of file psqlscan.l.
References fb(), free, and psqlscan_pop_buffer_stack().
Referenced by MainLoop(), ParseScript(), and psql_scan_destroy().
| void psql_scan_get_location | ( | PsqlScanState | state, |
| int * | lineno, | ||
| int * | offset | ||
| ) |
Definition at line 1429 of file psqlscan.l.
References fb().
Referenced by expr_lex_one_word(), expr_yyerror_more(), and ParseScript().
| bool psql_scan_in_quote | ( | PsqlScanState | state | ) |
| void psql_scan_reselect_sql_lexer | ( | PsqlScanState | state | ) |
Definition at line 1397 of file psqlscan.l.
References fb().
Referenced by expr_lex_one_word(), expr_scanner_finish(), psql_scan_slash_command(), psql_scan_slash_command_end(), and psql_scan_slash_option().
| void psql_scan_reset | ( | PsqlScanState | state | ) |
Definition at line 1369 of file psqlscan.l.
Referenced by exec_command_reset(), exec_command_watch(), MainLoop(), psql_scan_create(), and psql_scan_destroy().
| void psql_scan_set_passthrough | ( | PsqlScanState | state, |
| void * | passthrough | ||
| ) |
| void psql_scan_setup | ( | PsqlScanState | state, |
| const char * | line, | ||
| int | line_len, | ||
| int | encoding, | ||
| bool | std_strings | ||
| ) |
Definition at line 1153 of file psqlscan.l.
References Assert, encoding, fb(), pg_valid_server_encoding_id, and psqlscan_prepare_buffer().
Referenced by main(), MainLoop(), ParseScript(), and test_psql_parse().
| void psqlscan_emit | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len | ||
| ) |
Definition at line 1611 of file psqlscan.l.
References appendBinaryPQExpBuffer(), appendPQExpBufferChar(), fb(), i, and len.
Referenced by psqlscan_escape_variable().
| void psqlscan_escape_variable | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len, | ||
| PsqlScanQuoteType | quote | ||
| ) |
Definition at line 1679 of file psqlscan.l.
References appendPQExpBufferStr(), fb(), free, len, psqlscan_emit(), psqlscan_extract_substring(), and value.
| char * psqlscan_extract_substring | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len | ||
| ) |
Definition at line 1643 of file psqlscan.l.
References fb(), i, len, memcpy(), pg_malloc_array, and result.
Referenced by psqlscan_escape_variable(), and psqlscan_test_variable().
Definition at line 996 of file psqlscan.l.
Referenced by psqlscan_track_identifier().
| void psqlscan_pop_buffer_stack | ( | PsqlScanState | state | ) |
Definition at line 1507 of file psqlscan.l.
References fb(), free, and state::next.
Referenced by psql_scan_finish().
| YY_BUFFER_STATE psqlscan_prepare_buffer | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len, | ||
| char ** | txtcopy | ||
| ) |
Definition at line 1570 of file psqlscan.l.
References fb(), i, len, memcpy(), pg_malloc_array, and PQmblen().
Referenced by psql_scan_setup(), and psqlscan_push_new_buffer().
Definition at line 1468 of file psqlscan.l.
References fb(), state::next, pg_malloc_object, pg_strdup(), and psqlscan_prepare_buffer().
|
static |
Definition at line 968 of file psqlscan.l.
References fb(), pg_strcasecmp(), and pg_tolower().
Referenced by psqlscan_track_identifier().
| void psqlscan_select_top_buffer | ( | PsqlScanState | state | ) |
Definition at line 1525 of file psqlscan.l.
References fb().
| void psqlscan_test_variable | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len | ||
| ) |
Definition at line 1708 of file psqlscan.l.
References appendPQExpBufferStr(), fb(), free, len, PQUOTE_PLAIN, psqlscan_extract_substring(), and value.
|
static |
Definition at line 1016 of file psqlscan.l.
References fb(), lengthof, pg_strcasecmp(), psqlscan_is_create_routine(), and psqlscan_record_initial_keyword().
| bool psqlscan_var_is_current_source | ( | PsqlScanState | state, |
| const char * | varname | ||
| ) |
Definition at line 1548 of file psqlscan.l.
References fb().
Definition at line 390 of file psqlscan.l.