1997-11-25 23:07:18 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* parser.h
|
2009-07-12 19:12:34 +02:00
|
|
|
* Definitions for the "raw" parser (flex and bison phases only)
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
2009-07-12 19:12:34 +02:00
|
|
|
* This is the external API for the raw lexing/parsing functions.
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
2022-01-08 01:04:57 +01:00
|
|
|
* Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/parser/parser.h
|
1997-11-25 23:07:18 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef PARSER_H
|
|
|
|
#define PARSER_H
|
|
|
|
|
2009-07-12 19:12:34 +02:00
|
|
|
#include "nodes/parsenodes.h"
|
2008-05-12 02:00:54 +02:00
|
|
|
|
2009-07-12 19:12:34 +02:00
|
|
|
|
2021-01-04 17:03:22 +01:00
|
|
|
/*
|
|
|
|
* RawParseMode determines the form of the string that raw_parser() accepts:
|
|
|
|
*
|
|
|
|
* RAW_PARSE_DEFAULT: parse a semicolon-separated list of SQL commands,
|
|
|
|
* and return a List of RawStmt nodes.
|
|
|
|
*
|
|
|
|
* RAW_PARSE_TYPE_NAME: parse a type name, and return a one-element List
|
|
|
|
* containing a TypeName node.
|
|
|
|
*
|
2021-01-04 17:52:00 +01:00
|
|
|
* RAW_PARSE_PLPGSQL_EXPR: parse a PL/pgSQL expression, and return
|
|
|
|
* a one-element List containing a RawStmt node.
|
|
|
|
*
|
|
|
|
* RAW_PARSE_PLPGSQL_ASSIGNn: parse a PL/pgSQL assignment statement,
|
|
|
|
* and return a one-element List containing a RawStmt node. "n"
|
|
|
|
* gives the number of dotted names comprising the target ColumnRef.
|
2021-01-04 17:03:22 +01:00
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
RAW_PARSE_DEFAULT = 0,
|
2021-01-04 17:52:00 +01:00
|
|
|
RAW_PARSE_TYPE_NAME,
|
|
|
|
RAW_PARSE_PLPGSQL_EXPR,
|
|
|
|
RAW_PARSE_PLPGSQL_ASSIGN1,
|
|
|
|
RAW_PARSE_PLPGSQL_ASSIGN2,
|
|
|
|
RAW_PARSE_PLPGSQL_ASSIGN3
|
2021-01-04 17:03:22 +01:00
|
|
|
} RawParseMode;
|
|
|
|
|
|
|
|
/* Values for the backslash_quote GUC */
|
2009-07-12 19:12:34 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
BACKSLASH_QUOTE_OFF,
|
|
|
|
BACKSLASH_QUOTE_ON,
|
|
|
|
BACKSLASH_QUOTE_SAFE_ENCODING
|
|
|
|
} BackslashQuoteType;
|
|
|
|
|
|
|
|
/* GUC variables in scan.l (every one of these is a bad idea :-() */
|
2022-04-08 14:16:38 +02:00
|
|
|
extern PGDLLIMPORT int backslash_quote;
|
|
|
|
extern PGDLLIMPORT bool escape_string_warning;
|
2009-07-13 02:42:18 +02:00
|
|
|
extern PGDLLIMPORT bool standard_conforming_strings;
|
2009-07-12 19:12:34 +02:00
|
|
|
|
|
|
|
|
2009-11-12 02:13:12 +01:00
|
|
|
/* Primary entry point for the raw parsing functions */
|
2021-01-04 17:03:22 +01:00
|
|
|
extern List *raw_parser(const char *str, RawParseMode mode);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2009-07-12 19:12:34 +02:00
|
|
|
/* Utility functions exported by gram.y (perhaps these should be elsewhere) */
|
|
|
|
extern List *SystemFuncName(char *name);
|
|
|
|
extern TypeName *SystemTypeName(char *name);
|
|
|
|
|
1997-11-25 23:07:18 +01:00
|
|
|
#endif /* PARSER_H */
|