PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
keywords.h
Go to the documentation of this file.
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 Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/common/keywords.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef KEYWORDS_H
15 #define KEYWORDS_H
16 
17 /* Keyword categories --- should match lists in gram.y */
18 #define UNRESERVED_KEYWORD 0
19 #define COL_NAME_KEYWORD 1
20 #define TYPE_FUNC_NAME_KEYWORD 2
21 #define RESERVED_KEYWORD 3
22 
23 
24 typedef struct ScanKeyword
25 {
26  const char *name; /* in lower case */
27  int16 value; /* grammar's token code */
28  int16 category; /* see codes above */
29 } ScanKeyword;
30 
31 #ifndef FRONTEND
32 extern PGDLLIMPORT const ScanKeyword ScanKeywords[];
33 extern PGDLLIMPORT const int NumScanKeywords;
34 #else
35 extern const ScanKeyword ScanKeywords[];
36 extern const int NumScanKeywords;
37 #endif
38 
39 
40 extern const ScanKeyword *ScanKeywordLookup(const char *text,
41  const ScanKeyword *keywords,
42  int num_keywords);
43 
44 #endif /* KEYWORDS_H */
signed short int16
Definition: c.h:252
struct ScanKeyword ScanKeyword
const ScanKeyword * ScanKeywordLookup(const char *text, const ScanKeyword *keywords, int num_keywords)
Definition: keywords.c:64
PGDLLIMPORT const int NumScanKeywords
Definition: keywords.c:45
#define PGDLLIMPORT
Definition: c.h:1062
PGDLLIMPORT const ScanKeyword ScanKeywords[]
Definition: keywords.c:41
const char * name
Definition: keywords.h:26
int16 value
Definition: keywords.h:27
int16 category
Definition: keywords.h:28
Definition: c.h:434