Commit cf8da4e9 authored by Michael Meskes's avatar Michael Meskes

Merged ecpg_big_bison back into HEAD

parent 79382cb9
...@@ -1271,11 +1271,39 @@ Mon Jun 17 15:23:51 CEST 2002 ...@@ -1271,11 +1271,39 @@ Mon Jun 17 15:23:51 CEST 2002
- Fixed parser bug in pgc.l. Octal numbers in single quotes are now - Fixed parser bug in pgc.l. Octal numbers in single quotes are now
correctly handled. correctly handled.
Sat Jul 20 10:09:58 CEST 2002 Tue Jun 18 15:13:15 CEST 2002
- Fixed parser bug concerning foreign keys.
- Synced preproc.y with gram.y.
- Synced pgc.l with scan.l.
- Synced keywords.c.
Sun Aug 18 16:09:06 CEST 2002
- Synced preproc.y with gram.y. - Synced preproc.y with gram.y.
- Synced pgc.l with scan.l. - Synced pgc.l with scan.l.
- Synced keywords.c.
Tue Aug 20 14:13:34 CEST 2002
- Removed ',' from preproc.y for bison 1.49b.
Sun Sep 1 11:13:04 CEST 2002
- Synced preproc.y with gram.y.
- Synced keywords.c.
Wed Sep 11 10:43:17 CEST 2002
- Synced preproc.y with gram.y.
Fri Sep 20 07:57:42 CEST 2002
- Synced preproc.y with gram.y.
- Synced keywords.c. - Synced keywords.c.
- Deactivated backend functions PREPARE, EXECUTE and DEALLOCATE for
the time being.
- Set ecpg version to 2.10.0. - Set ecpg version to 2.10.0.
- Set library version to 3.4.0. - Set library version to 3.4.0.
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.39 2002/09/04 20:31:46 momjian Exp $ */ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.40 2002/10/21 13:09:31 meskes Exp $ */
/* /*
* The aim is to get a simpler inteface to the database routines. * The aim is to get a simpler inteface to the database routines.
...@@ -89,7 +89,7 @@ quote_postgres(char *arg, int lineno) ...@@ -89,7 +89,7 @@ quote_postgres(char *arg, int lineno)
res[ri++] = '\''; res[ri++] = '\'';
res[ri] = '\0'; res[ri] = '\0';
return res; return res;
} }
......
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.85 2002/07/27 20:10:05 petere Exp $ # $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.86 2002/10/21 13:09:31 meskes Exp $
subdir = src/interfaces/ecpg/preproc subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -18,7 +18,8 @@ override CFLAGS += -Wno-error ...@@ -18,7 +18,8 @@ override CFLAGS += -Wno-error
endif endif
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\ OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o \
$(SNPRINTF) $(STRDUP)
all: submake-libpgport ecpg all: submake-libpgport ecpg
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* lexical token lookup for reserved words in postgres embedded SQL * lexical token lookup for reserved words in postgres embedded SQL
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.26 2002/05/19 20:00:53 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c,v 1.27 2002/10/21 13:09:31 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -38,13 +38,11 @@ static ScanKeyword ScanKeywords[] = { ...@@ -38,13 +38,11 @@ static ScanKeyword ScanKeywords[] = {
{"data", SQL_DATA}, {"data", SQL_DATA},
{"datetime_interval_code", SQL_DATETIME_INTERVAL_CODE}, {"datetime_interval_code", SQL_DATETIME_INTERVAL_CODE},
{"datetime_interval_precision", SQL_DATETIME_INTERVAL_PRECISION}, {"datetime_interval_precision", SQL_DATETIME_INTERVAL_PRECISION},
{"deallocate", SQL_DEALLOCATE},
{"descriptor", SQL_DESCRIPTOR}, {"descriptor", SQL_DESCRIPTOR},
{"disconnect", SQL_DISCONNECT}, {"disconnect", SQL_DISCONNECT},
{"enum", SQL_ENUM}, {"enum", SQL_ENUM},
{"found", SQL_FOUND}, {"found", SQL_FOUND},
{"free", SQL_FREE}, {"free", SQL_FREE},
{"get", SQL_GET},
{"go", SQL_GO}, {"go", SQL_GO},
{"goto", SQL_GOTO}, {"goto", SQL_GOTO},
{"identified", SQL_IDENTIFIED}, {"identified", SQL_IDENTIFIED},
...@@ -56,7 +54,6 @@ static ScanKeyword ScanKeywords[] = { ...@@ -56,7 +54,6 @@ static ScanKeyword ScanKeywords[] = {
{"nullable", SQL_NULLABLE}, {"nullable", SQL_NULLABLE},
{"octet_length", SQL_OCTET_LENGTH}, {"octet_length", SQL_OCTET_LENGTH},
{"open", SQL_OPEN}, {"open", SQL_OPEN},
{"prepare", SQL_PREPARE},
{"reference", SQL_REFERENCE}, {"reference", SQL_REFERENCE},
{"release", SQL_RELEASE}, {"release", SQL_RELEASE},
{"returned_length", SQL_RETURNED_LENGTH}, {"returned_length", SQL_RETURNED_LENGTH},
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.54 2002/07/21 11:09:41 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.55 2002/10/21 13:09:31 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -44,6 +44,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -44,6 +44,7 @@ static ScanKeyword ScanKeywords[] = {
{"as", AS}, {"as", AS},
{"asc", ASC}, {"asc", ASC},
{"assertion", ASSERTION}, {"assertion", ASSERTION},
{"assignment", ASSIGNMENT},
{"at", AT}, {"at", AT},
{"authorization", AUTHORIZATION}, {"authorization", AUTHORIZATION},
{"backward", BACKWARD}, {"backward", BACKWARD},
...@@ -67,6 +68,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -67,6 +68,7 @@ static ScanKeyword ScanKeywords[] = {
{"characteristics", CHARACTERISTICS}, {"characteristics", CHARACTERISTICS},
{"check", CHECK}, {"check", CHECK},
{"checkpoint", CHECKPOINT}, {"checkpoint", CHECKPOINT},
{"class", CLASS},
{"close", CLOSE}, {"close", CLOSE},
{"cluster", CLUSTER}, {"cluster", CLUSTER},
{"coalesce", COALESCE}, {"coalesce", COALESCE},
...@@ -77,6 +79,8 @@ static ScanKeyword ScanKeywords[] = { ...@@ -77,6 +79,8 @@ static ScanKeyword ScanKeywords[] = {
{"committed", COMMITTED}, {"committed", COMMITTED},
{"constraint", CONSTRAINT}, {"constraint", CONSTRAINT},
{"constraints", CONSTRAINTS}, {"constraints", CONSTRAINTS},
{"conversion", CONVERSION_P},
{"convert", CONVERT},
{"copy", COPY}, {"copy", COPY},
{"create", CREATE}, {"create", CREATE},
{"createdb", CREATEDB}, {"createdb", CREATEDB},
...@@ -90,6 +94,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -90,6 +94,7 @@ static ScanKeyword ScanKeywords[] = {
{"cycle", CYCLE}, {"cycle", CYCLE},
{"database", DATABASE}, {"database", DATABASE},
{"day", DAY_P}, {"day", DAY_P},
{"deallocate", DEALLOCATE},
{"dec", DEC}, {"dec", DEC},
{"decimal", DECIMAL}, {"decimal", DECIMAL},
{"declare", DECLARE}, {"declare", DECLARE},
...@@ -98,6 +103,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -98,6 +103,7 @@ static ScanKeyword ScanKeywords[] = {
{"deferred", DEFERRED}, {"deferred", DEFERRED},
{"definer", DEFINER}, {"definer", DEFINER},
{"delete", DELETE_P}, {"delete", DELETE_P},
{"delimiter", DELIMITER},
{"delimiters", DELIMITERS}, {"delimiters", DELIMITERS},
{"desc", DESC}, {"desc", DESC},
{"distinct", DISTINCT}, {"distinct", DISTINCT},
...@@ -129,6 +135,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -129,6 +135,7 @@ static ScanKeyword ScanKeywords[] = {
{"from", FROM}, {"from", FROM},
{"full", FULL}, {"full", FULL},
{"function", FUNCTION}, {"function", FUNCTION},
{"get", GET},
{"global", GLOBAL}, {"global", GLOBAL},
{"grant", GRANT}, {"grant", GRANT},
{"group", GROUP_P}, {"group", GROUP_P},
...@@ -138,7 +145,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -138,7 +145,7 @@ static ScanKeyword ScanKeywords[] = {
{"ilike", ILIKE}, {"ilike", ILIKE},
{"immediate", IMMEDIATE}, {"immediate", IMMEDIATE},
{"immutable", IMMUTABLE}, {"immutable", IMMUTABLE},
{"implicit", IMPLICIT}, {"implicit", IMPLICIT_P},
{"in", IN_P}, {"in", IN_P},
{"increment", INCREMENT}, {"increment", INCREMENT},
{"index", INDEX}, {"index", INDEX},
...@@ -218,6 +225,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -218,6 +225,7 @@ static ScanKeyword ScanKeywords[] = {
{"pendant", PENDANT}, {"pendant", PENDANT},
{"position", POSITION}, {"position", POSITION},
{"precision", PRECISION}, {"precision", PRECISION},
{"prepare", PREPARE},
{"primary", PRIMARY}, {"primary", PRIMARY},
{"prior", PRIOR}, {"prior", PRIOR},
{"privileges", PRIVILEGES}, {"privileges", PRIVILEGES},
...@@ -225,6 +233,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -225,6 +233,7 @@ static ScanKeyword ScanKeywords[] = {
{"procedure", PROCEDURE}, {"procedure", PROCEDURE},
{"read", READ}, {"read", READ},
{"real", REAL}, {"real", REAL},
{"recheck", RECHECK},
{"references", REFERENCES}, {"references", REFERENCES},
{"reindex", REINDEX}, {"reindex", REINDEX},
{"relative", RELATIVE}, {"relative", RELATIVE},
...@@ -251,6 +260,8 @@ static ScanKeyword ScanKeywords[] = { ...@@ -251,6 +260,8 @@ static ScanKeyword ScanKeywords[] = {
{"setof", SETOF}, {"setof", SETOF},
{"share", SHARE}, {"share", SHARE},
{"show", SHOW}, {"show", SHOW},
{"similar", SIMILAR},
{"simple", SIMPLE},
{"smallint", SMALLINT}, {"smallint", SMALLINT},
{"some", SOME}, {"some", SOME},
{"stable", STABLE}, {"stable", STABLE},
...@@ -274,6 +285,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -274,6 +285,7 @@ static ScanKeyword ScanKeywords[] = {
{"toast", TOAST}, {"toast", TOAST},
{"trailing", TRAILING}, {"trailing", TRAILING},
{"transaction", TRANSACTION}, {"transaction", TRANSACTION},
{"treat", TREAT},
{"trigger", TRIGGER}, {"trigger", TRIGGER},
{"trim", TRIM}, {"trim", TRIM},
{"true", TRUE_P}, {"true", TRUE_P},
...@@ -304,6 +316,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -304,6 +316,7 @@ static ScanKeyword ScanKeywords[] = {
{"with", WITH}, {"with", WITH},
{"without", WITHOUT}, {"without", WITHOUT},
{"work", WORK}, {"work", WORK},
{"write", WRITE},
{"year", YEAR_P}, {"year", YEAR_P},
{"zone", ZONE}, {"zone", ZONE},
}; };
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.99 2002/09/02 06:11:42 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.100 2002/10/21 13:09:31 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -117,7 +117,7 @@ xbcat {quote}{whitespace_with_newline}{quote} ...@@ -117,7 +117,7 @@ xbcat {quote}{whitespace_with_newline}{quote}
*/ */
xhstart [xX]{quote} xhstart [xX]{quote}
xhstop {quote} xhstop {quote}
xhinside [^']+ xhinside [^']*
xhcat {quote}{whitespace_with_newline}{quote} xhcat {quote}{whitespace_with_newline}{quote}
/* National character /* National character
...@@ -333,7 +333,7 @@ cppline {space}*#(.*\\{space})*.* ...@@ -333,7 +333,7 @@ cppline {space}*#(.*\\{space})*.*
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0') if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input."); mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input.");
yylval.str = literalbuf; yylval.str = literalbuf;
return BITCONST; return BCONST;
} }
<xh>{xhinside} | <xh>{xhinside} |
...@@ -346,23 +346,11 @@ cppline {space}*#(.*\\{space})*.* ...@@ -346,23 +346,11 @@ cppline {space}*#(.*\\{space})*.*
token_start = yytext; token_start = yytext;
BEGIN(xh); BEGIN(xh);
startlit(); startlit();
addlitchar('x');
} }
<xh>{xhstop} { <xh>{xhstop} {
long val; yylval.str = literalbuf;
char* endptr; return XCONST;
BEGIN(SQL);
errno = 0;
val = strtol(literalbuf, &endptr, 16);
if (*endptr != '\0' || errno == ERANGE
#ifdef HAVE_LONG_INT_64
/* if long > 32 bits, check for overflow of int4 */
|| val != (long) ((int32) val)
#endif
)
mmerror(PARSE_ERROR, ET_ERROR, "Bad hexadecimal integer input");
yylval.ival = val;
return ICONST;
} }
<xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); } <xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); }
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment