PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
keywords.c
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * keywords.c
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  *
11  * IDENTIFICATION
12  * src/interfaces/ecpg/preproc/keywords.c
13  *
14  *-------------------------------------------------------------------------
15  */
16 #include "postgres_fe.h"
17 
18 /*
19  * This is much trickier than it looks. We are #include'ing kwlist.h
20  * but the "value" numbers that go into the table are from preproc.h
21  * not the backend's gram.h. Therefore this table will recognize all
22  * keywords known to the backend, but will supply the token numbers used
23  * by ecpg's grammar, which is what we need. The ecpg grammar must
24  * define all the same token names the backend does, else we'll get
25  * undefined-symbol failures in this compile.
26  */
27 
28 #include "common/keywords.h"
29 
30 #include "extern.h"
31 #include "preproc.h"
32 
33 
34 #define PG_KEYWORD(a,b,c) {a,b,c},
35 
37 #include "parser/kwlist.h"
38 };
39 
40 const int NumSQLScanKeywords = lengthof(SQLScanKeywords);
const int NumSQLScanKeywords
Definition: keywords.c:40
#define lengthof(array)
Definition: c.h:557
const ScanKeyword SQLScanKeywords[]
Definition: keywords.c:36