PostgreSQL Source Code git master
parser.h File Reference
#include "nodes/parsenodes.h"
Include dependency graph for parser.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  RawParseMode {
  RAW_PARSE_DEFAULT = 0 , RAW_PARSE_TYPE_NAME , RAW_PARSE_PLPGSQL_EXPR , RAW_PARSE_PLPGSQL_ASSIGN1 ,
  RAW_PARSE_PLPGSQL_ASSIGN2 , RAW_PARSE_PLPGSQL_ASSIGN3
}
 
enum  BackslashQuoteType { BACKSLASH_QUOTE_OFF , BACKSLASH_QUOTE_ON , BACKSLASH_QUOTE_SAFE_ENCODING }
 

Functions

Listraw_parser (const char *str, RawParseMode mode)
 
ListSystemFuncName (char *name)
 
TypeNameSystemTypeName (char *name)
 

Variables

PGDLLIMPORT int backslash_quote
 
PGDLLIMPORT bool escape_string_warning
 
PGDLLIMPORT bool standard_conforming_strings
 

Enumeration Type Documentation

◆ BackslashQuoteType

Enumerator
BACKSLASH_QUOTE_OFF 
BACKSLASH_QUOTE_ON 
BACKSLASH_QUOTE_SAFE_ENCODING 

Definition at line 48 of file parser.h.

49{
BackslashQuoteType
Definition: parser.h:49
@ BACKSLASH_QUOTE_ON
Definition: parser.h:51
@ BACKSLASH_QUOTE_SAFE_ENCODING
Definition: parser.h:52
@ BACKSLASH_QUOTE_OFF
Definition: parser.h:50

◆ RawParseMode

Enumerator
RAW_PARSE_DEFAULT 
RAW_PARSE_TYPE_NAME 
RAW_PARSE_PLPGSQL_EXPR 
RAW_PARSE_PLPGSQL_ASSIGN1 
RAW_PARSE_PLPGSQL_ASSIGN2 
RAW_PARSE_PLPGSQL_ASSIGN3 

Definition at line 37 of file parser.h.

38{
RawParseMode
Definition: parser.h:38
@ RAW_PARSE_PLPGSQL_EXPR
Definition: parser.h:41
@ RAW_PARSE_PLPGSQL_ASSIGN2
Definition: parser.h:43
@ RAW_PARSE_PLPGSQL_ASSIGN1
Definition: parser.h:42
@ RAW_PARSE_TYPE_NAME
Definition: parser.h:40
@ RAW_PARSE_PLPGSQL_ASSIGN3
Definition: parser.h:44
@ RAW_PARSE_DEFAULT
Definition: parser.h:39

Function Documentation

◆ raw_parser()

List * raw_parser ( const char *  str,
RawParseMode  mode 
)

Definition at line 42 of file parser.c.

43{
44 core_yyscan_t yyscanner;
46 int yyresult;
47
48 /* initialize the flex scanner */
49 yyscanner = scanner_init(str, &yyextra.core_yy_extra,
51
52 /* base_yylex() only needs us to initialize the lookahead token, if any */
54 yyextra.have_lookahead = false;
55 else
56 {
57 /* this array is indexed by RawParseMode enum */
58 static const int mode_token[] = {
60 [RAW_PARSE_TYPE_NAME] = MODE_TYPE_NAME,
61 [RAW_PARSE_PLPGSQL_EXPR] = MODE_PLPGSQL_EXPR,
62 [RAW_PARSE_PLPGSQL_ASSIGN1] = MODE_PLPGSQL_ASSIGN1,
63 [RAW_PARSE_PLPGSQL_ASSIGN2] = MODE_PLPGSQL_ASSIGN2,
64 [RAW_PARSE_PLPGSQL_ASSIGN3] = MODE_PLPGSQL_ASSIGN3,
65 };
66
67 yyextra.have_lookahead = true;
68 yyextra.lookahead_token = mode_token[mode];
69 yyextra.lookahead_yylloc = 0;
70 yyextra.lookahead_end = NULL;
71 }
72
73 /* initialize the bison parser */
75
76 /* Parse! */
77 yyresult = base_yyparse(yyscanner);
78
79 /* Clean up (release memory) */
80 scanner_finish(yyscanner);
81
82 if (yyresult) /* error */
83 return NIL;
84
85 return yyextra.parsetree;
86}
void parser_init(base_yy_extra_type *yyext)
int base_yyparse(core_yyscan_t yyscanner)
const char * str
PGDLLIMPORT const ScanKeywordList ScanKeywords
static PgChecksumMode mode
Definition: pg_checksums.c:55
#define NIL
Definition: pg_list.h:68
core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeywordList *keywordlist, const uint16 *keyword_tokens)
Definition: scan.l:1249
void scanner_finish(core_yyscan_t yyscanner)
Definition: scan.l:1291
#define yyextra
Definition: scan.l:1118
const uint16 ScanKeywordTokens[]
Definition: scan.l:81
void * core_yyscan_t
Definition: scanner.h:121

References base_yyparse(), mode, NIL, parser_init(), RAW_PARSE_DEFAULT, RAW_PARSE_PLPGSQL_ASSIGN1, RAW_PARSE_PLPGSQL_ASSIGN2, RAW_PARSE_PLPGSQL_ASSIGN3, RAW_PARSE_PLPGSQL_EXPR, RAW_PARSE_TYPE_NAME, ScanKeywords, ScanKeywordTokens, scanner_finish(), scanner_init(), str, and yyextra.

Referenced by _SPI_prepare_oneshot_plan(), _SPI_prepare_plan(), ATPostAlterTypeParse(), pg_parse_query(), and typeStringToTypeName().

◆ SystemFuncName()

◆ SystemTypeName()

TypeName * SystemTypeName ( char *  name)

Variable Documentation

◆ backslash_quote

PGDLLIMPORT int backslash_quote
extern

Definition at line 68 of file scan.l.

Referenced by scanner_init().

◆ escape_string_warning

PGDLLIMPORT bool escape_string_warning
extern

Definition at line 69 of file scan.l.

Referenced by scanner_init().

◆ standard_conforming_strings

PGDLLIMPORT bool standard_conforming_strings
extern

Definition at line 70 of file scan.l.

Referenced by scanner_init(), and simple_quote_literal().