PostgreSQL Source Code  git master
parser.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parser.h
4  * Definitions for the "raw" parser (flex and bison phases only)
5  *
6  * This is the external API for the raw lexing/parsing functions.
7  *
8  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * src/include/parser/parser.h
12  *
13  *-------------------------------------------------------------------------
14  */
15 #ifndef PARSER_H
16 #define PARSER_H
17 
18 #include "nodes/parsenodes.h"
19 
20 
21 /*
22  * RawParseMode determines the form of the string that raw_parser() accepts:
23  *
24  * RAW_PARSE_DEFAULT: parse a semicolon-separated list of SQL commands,
25  * and return a List of RawStmt nodes.
26  *
27  * RAW_PARSE_TYPE_NAME: parse a type name, and return a one-element List
28  * containing a TypeName node.
29  *
30  * RAW_PARSE_PLPGSQL_EXPR: parse a PL/pgSQL expression, and return
31  * a one-element List containing a RawStmt node.
32  *
33  * RAW_PARSE_PLPGSQL_ASSIGNn: parse a PL/pgSQL assignment statement,
34  * and return a one-element List containing a RawStmt node. "n"
35  * gives the number of dotted names comprising the target ColumnRef.
36  */
37 typedef enum
38 {
45 } RawParseMode;
46 
47 /* Values for the backslash_quote GUC */
48 typedef enum
49 {
54 
55 /* GUC variables in scan.l (every one of these is a bad idea :-() */
56 extern PGDLLIMPORT int backslash_quote;
59 
60 
61 /* Primary entry point for the raw parsing functions */
62 extern List *raw_parser(const char *str, RawParseMode mode);
63 
64 /* Utility functions exported by gram.y (perhaps these should be elsewhere) */
65 extern List *SystemFuncName(char *name);
66 extern TypeName *SystemTypeName(char *name);
67 
68 #endif /* PARSER_H */
#define PGDLLIMPORT
Definition: c.h:1319
const char * str
TypeName * SystemTypeName(char *name)
PGDLLIMPORT bool escape_string_warning
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
List * raw_parser(const char *str, RawParseMode mode)
Definition: parser.c:42
PGDLLIMPORT bool standard_conforming_strings
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
List * SystemFuncName(char *name)
PGDLLIMPORT int backslash_quote
static PgChecksumMode mode
Definition: pg_checksums.c:56
Definition: pg_list.h:54
const char * name