Skip to content

Commit 7f660ad

Browse files
author
Michael Meskes
committed
- Fixed some parser bugs.
- Removed some simple rules to work arounf bison limit for now. - Update c_keywords.c to reflect changes in keywords.c.
1 parent 0d7c58a commit 7f660ad

File tree

5 files changed

+81
-101
lines changed

5 files changed

+81
-101
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,12 @@ Sun May 19 19:21:34 CEST 2002
12541254
- Synced preproc.y with gram.y.
12551255
- Synced pgc.l with scan.l.
12561256
- Synced keywords.c.
1257+
1258+
Mon May 20 10:58:36 CEST 2002
1259+
1260+
- Fixed some parser bugs.
1261+
- Removed some simple rules to work arounf bison limit for now.
1262+
- Update c_keywords.c to reflect changes in keywords.c.
12571263
- Set ecpg version to 2.10.0.
12581264
- Set library version to 3.4.0.
12591265

src/interfaces/ecpg/preproc/c_keywords.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static ScanKeyword ScanKeywords[] = {
2929
{"enum", SQL_ENUM},
3030
{"extern", S_EXTERN},
3131
{"float", FLOAT},
32-
{"int", SQL_INT},
32+
{"int", INT},
3333
{"long", SQL_LONG},
3434
{"register", S_REGISTER},
3535
{"short", SQL_SHORT},

src/interfaces/ecpg/preproc/extern.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern char *descriptor_index;
1818
extern char *descriptor_name;
1919
extern char *connection;
2020
extern char *input_filename;
21-
extern char *yytext,
21+
extern char *yytext, *token_start,
2222
errortext[128];
2323

2424
#ifdef YYDEBUG

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.91 2002/05/19 20:00:53 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.92 2002/05/20 09:29:41 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -50,9 +50,8 @@ static int literalalloc; /* current allocated buffer size */
5050
#define startlit() (literalbuf[0] = '\0', literallen = 0)
5151
static void addlit(char *ytext, int yleng);
5252
static void addlitchar (unsigned char);
53-
static unsigned char unescape_single_char(unsigned char);
5453

55-
static char *token_start;
54+
char *token_start;
5655
int state_before;
5756

5857
struct _yy_buffer
@@ -307,7 +306,7 @@ cppline {space}*#(.*\\{space})*.*
307306
ECHO;
308307
if (xcdepth <= 0)
309308
{
310-
BEGIN(INITIAL);
309+
BEGIN(state_before);
311310
token_start = NULL;
312311
}
313312
else
@@ -377,7 +376,7 @@ cppline {space}*#(.*\\{space})*.*
377376
}
378377
<xq>{xqdouble} { addlitchar('\''); }
379378
<xq>{xqinside} { addlit(yytext, yyleng); }
380-
<xq>{xqescape} { addlitchar(unescape_single_char(yytext[1])); }
379+
<xq>{xqescape} { addlit(yytext, yyleng); }
381380
<xq>{xqoctesc} { unsigned char c = strtoul(yytext+1, NULL, 8);
382381
addlitchar(c); }
383382
<xq>{xqcat} { /* ignore */ }
@@ -936,22 +935,9 @@ addlitchar(unsigned char ychar)
936935
literalbuf[literallen] = '\0';
937936
}
938937

939-
unsigned char
940-
unescape_single_char(unsigned char c)
938+
int
939+
yywrap(void)
941940
{
942-
switch (c)
943-
{
944-
case 'b':
945-
return '\b';
946-
case 'f':
947-
return '\f';
948-
case 'n':
949-
return '\n';
950-
case 'r':
951-
return '\r';
952-
case 't':
953-
return '\t';
954-
default:
955-
return c;
956-
}
941+
return(1);
957942
}
943+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy