PostgreSQL Source Code git master
Loading...
Searching...
No Matches
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
 

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 
)
extern

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[] = {
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}
const char * str
PGDLLIMPORT const ScanKeywordList ScanKeywords
static PgChecksumMode mode
#define NIL
Definition pg_list.h:68
static int fb(int x)
int base_yyparse(void)
void parser_init(void)
core_yyscan_t scanner_init(const char *str, core_yy_extra_type *yyext, const ScanKeywordList *keywordlist, const uint16 *keyword_tokens)
Definition scan.l:1224
void scanner_finish(core_yyscan_t yyscanner)
Definition scan.l:1264
#define yyextra
Definition scan.l:1093
const uint16 ScanKeywordTokens[]
Definition scan.l:80
void * core_yyscan_t
Definition scanner.h:118

References base_yyparse(), fb(), 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)
extern

Variable Documentation

◆ backslash_quote

PGDLLIMPORT int backslash_quote
extern

Definition at line 69 of file scan.l.

Referenced by scanner_init().