|
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 1121 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, and yylex().
Referenced by MainLoop(), ParseScript(), and test_psql_parse().
| PsqlScanState psql_scan_create | ( | const PsqlScanCallbacks * | callbacks | ) |
Definition at line 1001 of file psqlscan.l.
References fb(), pg_malloc0(), and psql_scan_reset().
Referenced by main(), MainLoop(), ParseScript(), and test_psql_parse().
| void psql_scan_destroy | ( | PsqlScanState | state | ) |
Definition at line 1022 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 1248 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 1335 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 1303 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 1275 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 1059 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 1517 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 1585 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 1549 of file psqlscan.l.
References fb(), i, len, and pg_malloc().
Referenced by psqlscan_escape_variable(), and psqlscan_test_variable().
| void psqlscan_pop_buffer_stack | ( | PsqlScanState | state | ) |
Definition at line 1413 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 1476 of file psqlscan.l.
References fb(), i, len, pg_malloc(), and PQmblen().
Referenced by psql_scan_setup(), and psqlscan_push_new_buffer().
Definition at line 1374 of file psqlscan.l.
References fb(), state::next, pg_malloc(), pg_strdup(), psqlscan_prepare_buffer(), and StackElem::varname.
| void psqlscan_select_top_buffer | ( | PsqlScanState | state | ) |
Definition at line 1431 of file psqlscan.l.
References fb().
| void psqlscan_test_variable | ( | PsqlScanState | state, |
| const char * | txt, | ||
| int | len | ||
| ) |
Definition at line 1614 of file psqlscan.l.
References appendPQExpBufferStr(), fb(), free, len, PQUOTE_PLAIN, psqlscan_extract_substring(), and value.
| bool psqlscan_var_is_current_source | ( | PsqlScanState | state, |
| const char * | varname | ||
| ) |
Definition at line 1454 of file psqlscan.l.
References fb().
Definition at line 385 of file psqlscan.l.