| 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-2017, PostgreSQL Global Development PGGroup |
| 9 | * Portions Copyright (c) 1994, Regents of the University of California |
| 10 | * |
| 11 | * src/include/parser/parser.h |
| 12 | * |
| 13 | *------------------------------------------------------------------------- |
| 14 | */ |
| 15 | #pragma once |
| 16 | |
| 17 | #include "nodes/parsenodes.hpp" |
| 18 | #include "pg_simplified_token.hpp" |
| 19 | #include <vector> |
| 20 | |
| 21 | namespace duckdb_libpgquery { |
| 22 | |
| 23 | typedef enum PGBackslashQuoteType { |
| 24 | PG_BACKSLASH_QUOTE_OFF, |
| 25 | PG_BACKSLASH_QUOTE_ON, |
| 26 | PG_BACKSLASH_QUOTE_SAFE_ENCODING |
| 27 | } PGBackslashQuoteType; |
| 28 | |
| 29 | /* Primary entry point for the raw parsing functions */ |
| 30 | PGList *raw_parser(const char *str); |
| 31 | |
| 32 | bool is_keyword(const char *str); |
| 33 | std::vector<PGKeyword> keyword_list(); |
| 34 | |
| 35 | std::vector<PGSimplifiedToken> tokenize(const char *str); |
| 36 | |
| 37 | /* Utility functions exported by gram.y (perhaps these should be elsewhere) */ |
| 38 | PGList *SystemFuncName(const char *name); |
| 39 | PGTypeName *SystemTypeName(const char *name); |
| 40 | |
| 41 | } |