mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
From: Michael Meskes <meskes@topsystem.de>
Tue Apr 28 14:48:41 CEST 1998
- Put operator "->" back into parser. Note that :foo->bar means the
C term, but :foo ->bar means the operator "->".
Tue Apr 28 15:49:07 CEST 1998
- Added exec sql disconnect command.
- Allow varchar in C to be written in uppercase too.
- Added whenever option "do break;"
Wed Apr 29 09:17:53 CEST 1998
- Corrected parsing of C comments.
- Also allow C++ style comments.
- Make sure not found is only checked after commands that could
return it.
- Added error codes, see ecpgerror.h for details.
- Added "exec sql <TransactionStmt> release" as disconnect statement
for compatibility issues.
Thu Apr 30 10:42:10 CEST 1998
- Added a -t option to disable automatic transaction start.
- Added sqlerrd[] to sqlca struct.
- Give back number of tuples affect in sqlca.sqlerrd[2].
Thu Apr 30 13:36:02 CEST 1998
- Make the return code different in case of different errors.
Wed May 6 11:42:48 CEST 1998
- Free memory if possible
- Some bugfixes for bugs I found while changing the memory
allocation code
- Now able to fill complete array with one call (see test1.pgc for
an example)
- Set version to 2.3.0
- Set library version to 2.1
This commit is contained in:
@@ -39,6 +39,7 @@ int debugging = 0;
|
||||
extern YYSTYPE yylval;
|
||||
int llen;
|
||||
char literal[MAX_PARSE_BUFFER];
|
||||
int before_comment;
|
||||
|
||||
struct _yy_buffer { YY_BUFFER_STATE buffer;
|
||||
long lineno;
|
||||
@@ -153,7 +154,7 @@ space [ \t\n\f]
|
||||
other .
|
||||
|
||||
/* some stuff needed for ecpg */
|
||||
ccomment \/\*([^*]|\*[^/]|\*\*[^/])*\*\/
|
||||
ccomment "//".*\n
|
||||
exec [eE][xX][eE][cC]
|
||||
include [iI][nN][cC][lL][uU][dD][eE]
|
||||
sql [sS][qQ][lL]
|
||||
@@ -174,12 +175,18 @@ sql [sS][qQ][lL]
|
||||
%%
|
||||
<SQL>{comment} { /* ignore */ }
|
||||
|
||||
<SQL>{xcline} { /* ignore */ }
|
||||
{xcline} { /* ignore */ }
|
||||
|
||||
<xc>{xcstar} |
|
||||
<SQL>{xcstart} { BEGIN(xc); }
|
||||
<xc>{xcstar} { /* ignore */ }
|
||||
{xcstart} {
|
||||
fprintf(stderr,"ys = %d %d\n", YYSTATE, before_comment);
|
||||
before_comment = YYSTATE;
|
||||
BEGIN(xc);
|
||||
fprintf(stderr,"ys = %d %d\n", YYSTATE,
|
||||
before_comment);
|
||||
}
|
||||
|
||||
<xc>{xcstop} { BEGIN(SQL); }
|
||||
<xc>{xcstop} { fprintf(stderr,"ys = %d %d\n", YYSTATE, before_comment);BEGIN(before_comment); }
|
||||
|
||||
<xc>{xcinside} { /* ignore */ }
|
||||
|
||||
@@ -306,7 +313,6 @@ sql [sS][qQ][lL]
|
||||
return (yytext[0]);
|
||||
}
|
||||
<SQL>{self} { return (yytext[0]); }
|
||||
<SQL>"->" { return S_STRUCTPOINTER; }
|
||||
<SQL>{operator}/-[\.0-9] {
|
||||
yylval.str = strdup((char*)yytext);
|
||||
return (Op);
|
||||
@@ -402,7 +408,7 @@ sql [sS][qQ][lL]
|
||||
return (FCONST);
|
||||
}
|
||||
|
||||
<SQL>:{identifier} {
|
||||
<SQL>:{identifier}(("->"|\.){identifier})* {
|
||||
yylval.str = strdup((char*)yytext+1);
|
||||
return(CVARIABLE);
|
||||
}
|
||||
@@ -436,6 +442,7 @@ sql [sS][qQ][lL]
|
||||
<SQL>{other} { return (yytext[0]); }
|
||||
|
||||
<C>{exec}{space}{sql} { BEGIN SQL; return SQL_START; }
|
||||
<C>{ccomment} { /* ignore */ }
|
||||
<C>{identifier} {
|
||||
ScanKeyword *keyword;
|
||||
|
||||
@@ -501,7 +508,7 @@ sql [sS][qQ][lL]
|
||||
if (!yyin)
|
||||
{
|
||||
fprintf(stderr, "Error: Cannot open include file %s in line %d\n", yytext, yylineno);
|
||||
exit(1);
|
||||
exit(NO_INCLUDE_FILE);
|
||||
}
|
||||
|
||||
input_filename = strdup(inc_file);
|
||||
|
||||
Reference in New Issue
Block a user