Commit 7f660ade authored by Michael Meskes's avatar Michael Meskes

- 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.
parent 0d7c58a9
......@@ -1254,6 +1254,12 @@ Sun May 19 19:21:34 CEST 2002
- Synced preproc.y with gram.y.
- Synced pgc.l with scan.l.
- Synced keywords.c.
Mon May 20 10:58:36 CEST 2002
- 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.
- Set ecpg version to 2.10.0.
- Set library version to 3.4.0.
......@@ -29,7 +29,7 @@ static ScanKeyword ScanKeywords[] = {
{"enum", SQL_ENUM},
{"extern", S_EXTERN},
{"float", FLOAT},
{"int", SQL_INT},
{"int", INT},
{"long", SQL_LONG},
{"register", S_REGISTER},
{"short", SQL_SHORT},
......
......@@ -18,7 +18,7 @@ extern char *descriptor_index;
extern char *descriptor_name;
extern char *connection;
extern char *input_filename;
extern char *yytext,
extern char *yytext, *token_start,
errortext[128];
#ifdef YYDEBUG
......
......@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.91 2002/05/19 20:00:53 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.92 2002/05/20 09:29:41 meskes Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -50,9 +50,8 @@ static int literalalloc; /* current allocated buffer size */
#define startlit() (literalbuf[0] = '\0', literallen = 0)
static void addlit(char *ytext, int yleng);
static void addlitchar (unsigned char);
static unsigned char unescape_single_char(unsigned char);
static char *token_start;
char *token_start;
int state_before;
struct _yy_buffer
......@@ -307,7 +306,7 @@ cppline {space}*#(.*\\{space})*.*
ECHO;
if (xcdepth <= 0)
{
BEGIN(INITIAL);
BEGIN(state_before);
token_start = NULL;
}
else
......@@ -377,7 +376,7 @@ cppline {space}*#(.*\\{space})*.*
}
<xq>{xqdouble} { addlitchar('\''); }
<xq>{xqinside} { addlit(yytext, yyleng); }
<xq>{xqescape} { addlitchar(unescape_single_char(yytext[1])); }
<xq>{xqescape} { addlit(yytext, yyleng); }
<xq>{xqoctesc} { unsigned char c = strtoul(yytext+1, NULL, 8);
addlitchar(c); }
<xq>{xqcat} { /* ignore */ }
......@@ -936,22 +935,9 @@ addlitchar(unsigned char ychar)
literalbuf[literallen] = '\0';
}
unsigned char
unescape_single_char(unsigned char c)
int
yywrap(void)
{
switch (c)
{
case 'b':
return '\b';
case 'f':
return '\f';
case 'n':
return '\n';
case 'r':
return '\r';
case 't':
return '\t';
default:
return c;
}
return(1);
}
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