summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/keywords.c
blob: 21e1f928fd64ef17091abef4788e87bcd85860bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*-------------------------------------------------------------------------
 *
 * keywords.c
 *	  lexical token lookup for key words in PostgreSQL
 *
 *
 * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 *
 * IDENTIFICATION
 *	  src/interfaces/ecpg/preproc/keywords.c
 *
 *-------------------------------------------------------------------------
 */
#include "postgres_fe.h"

/*
 * This is much trickier than it looks.  We are #include'ing kwlist.h
 * but the "value" numbers that go into the table are from preproc.h
 * not the backend's gram.h.  Therefore this table will recognize all
 * keywords known to the backend, but will supply the token numbers used
 * by ecpg's grammar, which is what we need.  The ecpg grammar must
 * define all the same token names the backend does, else we'll get
 * undefined-symbol failures in this compile.
 */

#include "common/keywords.h"

#include "extern.h"
#include "preproc.h"


#define PG_KEYWORD(a,b,c) {a,b,c},

const ScanKeyword SQLScanKeywords[] = {
#include "parser/kwlist.h"
};

const int	NumSQLScanKeywords = lengthof(SQLScanKeywords);