From 70dfc8c11e16fb3c23f73395220dc21c34dcca80 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Thu, 10 Jun 1999 19:11:33 +0000 Subject: [PATCH] *** empty log message *** --- src/interfaces/ecpg/ChangeLog | 5 ++++ src/interfaces/ecpg/preproc/pgc.l | 43 +++++++++++++++++++++++++-- src/interfaces/ecpg/preproc/preproc.y | 2 +- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 8895cfab4c..e77ecf377b 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -590,5 +590,10 @@ Fri May 21 18:13:44 CEST 1999 Sun May 23 11:19:32 CEST 1999 - Add braces around each statement so that a simple if/else works. + +Thu Jun 10 21:09:12 CEST 1999 + + - Fixed typo in preproc.y. + - Synced pgc.l with scan.l. - Set library version to 3.0.0 - Set ecpg version to 2.6.0 diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 44542cb83b..d942a65b3e 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -146,10 +146,11 @@ operator {op_and_self}+ xmstop - integer [\-]?{digit}+ +decimal [\-]?(({digit}*\.{digit}+)|({digit}+\.{digit}*)) +real [\-]?((({digit}*\.{digit}+)|({digit}+\.{digit}*)|({digit}+))([Ee][-+]?{digit}+)) /* -real [\-]?{digit}+\.{digit}+([Ee][-+]?{digit}+)? -*/ real [\-]?(((({digit}*\.{digit}+)|({digit}+\.{digit}*))([Ee][-+]?{digit}+)?)|({digit}+[Ee][-+]?{digit}+)) +*/ param \${integer} @@ -391,14 +392,34 @@ cppline {space}*#.*(\\{space}*\n)*\n* if (*endptr != '\0' || errno == ERANGE) { errno = 0; +#if 0 yylval.dval = strtod(((char *)yytext),&endptr); if (*endptr != '\0' || errno == ERANGE) yyerror("ERROR: Bad integer input"); yyerror("WARNING: Integer input is out of range; promoted to float"); return FCONST; +#endif + yylval.str = mm_strdup((char*)yytext); + return SCONST; } return ICONST; } +{decimal}/{space}*-{number} { + char* endptr; + + BEGIN(xm); + if (strlen((char *)yytext) <= 17) + { + errno = 0; + yylval.dval = strtod(((char *)yytext),&endptr); + if (*endptr != '\0' || errno == ERANGE) + yyerror("ERROR: Bad float8 input"); + return FCONST; + } + yylval.str = mm_strdup((char*)yytext); + return SCONST; + } + {real}/{space}*-{number} { char* endptr; @@ -417,14 +438,32 @@ cppline {space}*#.*(\\{space}*\n)*\n* if (*endptr != '\0' || errno == ERANGE) { errno = 0; +#if 0 yylval.dval = strtod(((char *)yytext),&endptr); if (*endptr != '\0' || errno == ERANGE) yyerror("ERROR: Bad integer input"); yyerror("WARNING: Integer input is out of range; promoted to float"); return FCONST; +#endif + yylval.str = mm_strdup((char*)yytext); + return SCONST; } return ICONST; } +{decimal} { + char* endptr; + + if (strlen((char *)yytext) <= 17) + { + errno = 0; + yylval.dval = strtod((char *)yytext,&endptr); + if (*endptr != '\0' || errno == ERANGE) + yyerror("ERROR: Bad float8 input"); + return FCONST; + } + yylval.str = mm_strdup((char*)yytext); + return SCONST; + } {real} { char* endptr; diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index bb1bc14cd0..d541dbf0c8 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -2918,7 +2918,7 @@ name_list: name { $$ = cat3_str($1, make1_str(","), $3); } ; -group_clause: GROUP BY expr_list { $$ = cat2_str(make1_str("groub by"), $3); } +group_clause: GROUP BY expr_list { $$ = cat2_str(make1_str("group by"), $3); } | /*EMPTY*/ { $$ = make1_str(""); } ;