Merged ecpg_big_bison back into HEAD

This commit is contained in:
Michael Meskes 2002-10-21 13:09:31 +00:00
parent 79382cb91f
commit cf8da4e9f0
7 changed files with 549 additions and 279 deletions

View File

@ -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
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 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.
- Deactivated backend functions PREPARE, EXECUTE and DEALLOCATE for
the time being.
- Set ecpg version to 2.10.0.
- Set library version to 3.4.0.

View File

@ -1,4 +1,4 @@
/* $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.
@ -89,7 +89,7 @@ quote_postgres(char *arg, int lineno)
res[ri++] = '\'';
res[ri] = '\0';
return res;
}

View File

@ -1,4 +1,4 @@
# $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
top_builddir = ../../../..
@ -18,7 +18,8 @@ override CFLAGS += -Wno-error
endif
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

View File

@ -4,7 +4,7 @@
* lexical token lookup for reserved words in postgres embedded SQL
*
* 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[] = {
{"data", SQL_DATA},
{"datetime_interval_code", SQL_DATETIME_INTERVAL_CODE},
{"datetime_interval_precision", SQL_DATETIME_INTERVAL_PRECISION},
{"deallocate", SQL_DEALLOCATE},
{"descriptor", SQL_DESCRIPTOR},
{"disconnect", SQL_DISCONNECT},
{"enum", SQL_ENUM},
{"found", SQL_FOUND},
{"free", SQL_FREE},
{"get", SQL_GET},
{"go", SQL_GO},
{"goto", SQL_GOTO},
{"identified", SQL_IDENTIFIED},
@ -56,7 +54,6 @@ static ScanKeyword ScanKeywords[] = {
{"nullable", SQL_NULLABLE},
{"octet_length", SQL_OCTET_LENGTH},
{"open", SQL_OPEN},
{"prepare", SQL_PREPARE},
{"reference", SQL_REFERENCE},
{"release", SQL_RELEASE},
{"returned_length", SQL_RETURNED_LENGTH},

View File

@ -8,7 +8,7 @@
*
*
* 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[] = {
{"as", AS},
{"asc", ASC},
{"assertion", ASSERTION},
{"assignment", ASSIGNMENT},
{"at", AT},
{"authorization", AUTHORIZATION},
{"backward", BACKWARD},
@ -67,6 +68,7 @@ static ScanKeyword ScanKeywords[] = {
{"characteristics", CHARACTERISTICS},
{"check", CHECK},
{"checkpoint", CHECKPOINT},
{"class", CLASS},
{"close", CLOSE},
{"cluster", CLUSTER},
{"coalesce", COALESCE},
@ -77,6 +79,8 @@ static ScanKeyword ScanKeywords[] = {
{"committed", COMMITTED},
{"constraint", CONSTRAINT},
{"constraints", CONSTRAINTS},
{"conversion", CONVERSION_P},
{"convert", CONVERT},
{"copy", COPY},
{"create", CREATE},
{"createdb", CREATEDB},
@ -90,6 +94,7 @@ static ScanKeyword ScanKeywords[] = {
{"cycle", CYCLE},
{"database", DATABASE},
{"day", DAY_P},
{"deallocate", DEALLOCATE},
{"dec", DEC},
{"decimal", DECIMAL},
{"declare", DECLARE},
@ -98,6 +103,7 @@ static ScanKeyword ScanKeywords[] = {
{"deferred", DEFERRED},
{"definer", DEFINER},
{"delete", DELETE_P},
{"delimiter", DELIMITER},
{"delimiters", DELIMITERS},
{"desc", DESC},
{"distinct", DISTINCT},
@ -129,6 +135,7 @@ static ScanKeyword ScanKeywords[] = {
{"from", FROM},
{"full", FULL},
{"function", FUNCTION},
{"get", GET},
{"global", GLOBAL},
{"grant", GRANT},
{"group", GROUP_P},
@ -138,7 +145,7 @@ static ScanKeyword ScanKeywords[] = {
{"ilike", ILIKE},
{"immediate", IMMEDIATE},
{"immutable", IMMUTABLE},
{"implicit", IMPLICIT},
{"implicit", IMPLICIT_P},
{"in", IN_P},
{"increment", INCREMENT},
{"index", INDEX},
@ -218,6 +225,7 @@ static ScanKeyword ScanKeywords[] = {
{"pendant", PENDANT},
{"position", POSITION},
{"precision", PRECISION},
{"prepare", PREPARE},
{"primary", PRIMARY},
{"prior", PRIOR},
{"privileges", PRIVILEGES},
@ -225,6 +233,7 @@ static ScanKeyword ScanKeywords[] = {
{"procedure", PROCEDURE},
{"read", READ},
{"real", REAL},
{"recheck", RECHECK},
{"references", REFERENCES},
{"reindex", REINDEX},
{"relative", RELATIVE},
@ -251,6 +260,8 @@ static ScanKeyword ScanKeywords[] = {
{"setof", SETOF},
{"share", SHARE},
{"show", SHOW},
{"similar", SIMILAR},
{"simple", SIMPLE},
{"smallint", SMALLINT},
{"some", SOME},
{"stable", STABLE},
@ -274,6 +285,7 @@ static ScanKeyword ScanKeywords[] = {
{"toast", TOAST},
{"trailing", TRAILING},
{"transaction", TRANSACTION},
{"treat", TREAT},
{"trigger", TRIGGER},
{"trim", TRIM},
{"true", TRUE_P},
@ -304,6 +316,7 @@ static ScanKeyword ScanKeywords[] = {
{"with", WITH},
{"without", WITHOUT},
{"work", WORK},
{"write", WRITE},
{"year", YEAR_P},
{"zone", ZONE},
};

View File

@ -12,7 +12,7 @@
*
*
* 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}
*/
xhstart [xX]{quote}
xhstop {quote}
xhinside [^']+
xhinside [^']*
xhcat {quote}{whitespace_with_newline}{quote}
/* National character
@ -333,7 +333,7 @@ cppline {space}*#(.*\\{space})*.*
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string input.");
yylval.str = literalbuf;
return BITCONST;
return BCONST;
}
<xh>{xhinside} |
@ -346,23 +346,11 @@ cppline {space}*#(.*\\{space})*.*
token_start = yytext;
BEGIN(xh);
startlit();
addlitchar('x');
}
<xh>{xhstop} {
long val;
char* endptr;
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;
yylval.str = literalbuf;
return XCONST;
}
<xh><<EOF>> { mmerror(PARSE_ERROR, ET_ERROR, "Unterminated hexadecimal integer"); }

File diff suppressed because it is too large Load Diff