mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Synced parser.
Made ecpg parser use backend provided keyword list. Changed whenever test so exit value is 0.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* keywords.c
|
||||
* lexical token lookup for reserved words in postgres embedded SQL
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/c_keywords.c,v 1.21 2007/08/22 08:20:58 meskes Exp $
|
||||
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/c_keywords.c,v 1.22 2008/05/20 23:17:32 meskes Exp $
|
||||
* §
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -21,37 +21,39 @@
|
||||
* search is used to locate entries.
|
||||
*/
|
||||
static const ScanKeyword ScanCKeywords[] = {
|
||||
/* name value */
|
||||
{"VARCHAR", VARCHAR},
|
||||
{"auto", S_AUTO},
|
||||
{"bool", SQL_BOOL},
|
||||
{"char", CHAR_P},
|
||||
{"const", S_CONST},
|
||||
{"enum", ENUM_P},
|
||||
{"extern", S_EXTERN},
|
||||
{"float", FLOAT_P},
|
||||
{"hour", HOUR_P},
|
||||
{"int", INT_P},
|
||||
{"long", SQL_LONG},
|
||||
{"minute", MINUTE_P},
|
||||
{"month", MONTH_P},
|
||||
{"register", S_REGISTER},
|
||||
{"second", SECOND_P},
|
||||
{"short", SQL_SHORT},
|
||||
{"signed", SQL_SIGNED},
|
||||
{"static", S_STATIC},
|
||||
{"struct", SQL_STRUCT},
|
||||
{"to", TO},
|
||||
{"typedef", S_TYPEDEF},
|
||||
{"union", UNION},
|
||||
{"unsigned", SQL_UNSIGNED},
|
||||
{"varchar", VARCHAR},
|
||||
{"volatile", S_VOLATILE},
|
||||
{"year", YEAR_P},
|
||||
/* name, value, category */
|
||||
/* category is not needed in ecpg, it is only here so we can share
|
||||
* the data structure with the backend */
|
||||
{"VARCHAR", VARCHAR, 0},
|
||||
{"auto", S_AUTO, 0},
|
||||
{"bool", SQL_BOOL, 0},
|
||||
{"char", CHAR_P, 0},
|
||||
{"const", S_CONST, 0},
|
||||
{"enum", ENUM_P, 0},
|
||||
{"extern", S_EXTERN, 0},
|
||||
{"float", FLOAT_P, 0},
|
||||
{"hour", HOUR_P, 0},
|
||||
{"int", INT_P, 0},
|
||||
{"long", SQL_LONG, 0},
|
||||
{"minute", MINUTE_P, 0},
|
||||
{"month", MONTH_P, 0},
|
||||
{"register", S_REGISTER, 0},
|
||||
{"second", SECOND_P, 0},
|
||||
{"short", SQL_SHORT, 0},
|
||||
{"signed", SQL_SIGNED, 0},
|
||||
{"static", S_STATIC, 0},
|
||||
{"struct", SQL_STRUCT, 0},
|
||||
{"to", TO, 0},
|
||||
{"typedef", S_TYPEDEF, 0},
|
||||
{"union", UNION, 0},
|
||||
{"unsigned", SQL_UNSIGNED, 0},
|
||||
{"varchar", VARCHAR, 0},
|
||||
{"volatile", S_VOLATILE, 0},
|
||||
{"year", YEAR_P, 0},
|
||||
};
|
||||
|
||||
const ScanKeyword *
|
||||
ScanCKeywordLookup(char *text)
|
||||
ScanCKeywordLookup(const char *text)
|
||||
{
|
||||
return DoLookup(text, &ScanCKeywords[0], endof(ScanCKeywords) - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user