00001 /*------------------------------------------------------------------------- 00002 * 00003 * keywords.h 00004 * lexical token lookup for key words in PostgreSQL 00005 * 00006 * 00007 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00008 * Portions Copyright (c) 1994, Regents of the University of California 00009 * 00010 * src/include/parser/keywords.h 00011 * 00012 *------------------------------------------------------------------------- 00013 */ 00014 #ifndef KEYWORDS_H 00015 #define KEYWORDS_H 00016 00017 /* Keyword categories --- should match lists in gram.y */ 00018 #define UNRESERVED_KEYWORD 0 00019 #define COL_NAME_KEYWORD 1 00020 #define TYPE_FUNC_NAME_KEYWORD 2 00021 #define RESERVED_KEYWORD 3 00022 00023 00024 typedef struct ScanKeyword 00025 { 00026 const char *name; /* in lower case */ 00027 int16 value; /* grammar's token code */ 00028 int16 category; /* see codes above */ 00029 } ScanKeyword; 00030 00031 extern PGDLLIMPORT const ScanKeyword ScanKeywords[]; 00032 extern PGDLLIMPORT const int NumScanKeywords; 00033 00034 extern const ScanKeyword *ScanKeywordLookup(const char *text, 00035 const ScanKeyword *keywords, 00036 int num_keywords); 00037 00038 #endif /* KEYWORDS_H */