1 | /*------------------------------------------------------------------------- |
2 | * |
3 | * keywords.h |
4 | * lexical token lookup for key words in PostgreSQL |
5 | * |
6 | * |
7 | * Portions Copyright (c) 1996-2017, PostgreSQL Global Development PGGroup |
8 | * Portions Copyright (c) 1994, Regents of the University of California |
9 | * |
10 | * src/include/common/keywords.h |
11 | * |
12 | *------------------------------------------------------------------------- |
13 | */ |
14 | #pragma once |
15 | |
16 | #include <cstdint> |
17 | |
18 | /* Keyword categories --- should match lists in gram.y */ |
19 | #define UNRESERVED_KEYWORD 0 |
20 | #define COL_NAME_KEYWORD 1 |
21 | #define TYPE_FUNC_NAME_KEYWORD 2 |
22 | #define RESERVED_KEYWORD 3 |
23 | |
24 | |
25 | typedef struct PGScanKeyword |
26 | { |
27 | const char *name; /* in lower case */ |
28 | int16_t value; /* grammar's token code */ |
29 | int16_t category; /* see codes above */ |
30 | } PGScanKeyword; |
31 | |
32 | extern const PGScanKeyword ScanKeywords[]; |
33 | extern const int NumScanKeywords; |
34 | |
35 | extern const PGScanKeyword *ScanKeywordLookup(const char *text, |
36 | const PGScanKeyword *keywords, |
37 | int num_keywords); |
38 | |