1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Tweak scanner/grammar interface so that the keyword-as-identifier rules

in gram.y can make use of the keywords.c string table, instead of having
their own copies of the keyword strings.  This saves a few kilobytes and
more importantly eliminates an opportunity for cut-and-paste errors.
This commit is contained in:
Tom Lane
2002-05-02 18:44:11 +00:00
parent 0041a3d72f
commit 3220fd2138
5 changed files with 300 additions and 294 deletions

View File

@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.93 2002/05/01 17:12:07 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.94 2002/05/02 18:44:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -504,14 +504,17 @@ other .
{identifier} {
ScanKeyword *keyword;
const ScanKeyword *keyword;
char *ident;
int i;
/* Is it a keyword? */
keyword = ScanKeywordLookup(yytext);
if (keyword != NULL)
{
yylval.keyword = keyword->name;
return keyword->value;
}
/*
* No. Convert the identifier to lower case, and truncate