Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
5420ed3a
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5420ed3a
编写于
7月 20, 2004
作者:
M
Michael Meskes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Synced parser and keyword list.
Fixed handling of cyclic defines.
上级
45995219
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
47 addition
and
36 deletion
+47
-36
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/ecpg.c
src/interfaces/ecpg/preproc/ecpg.c
+4
-3
src/interfaces/ecpg/preproc/keywords.c
src/interfaces/ecpg/preproc/keywords.c
+1
-4
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+26
-20
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+10
-9
src/interfaces/ecpg/preproc/type.h
src/interfaces/ecpg/preproc/type.h
+1
-0
未找到文件。
src/interfaces/ecpg/ChangeLog
浏览文件 @
5420ed3a
...
...
@@ -1845,6 +1845,11 @@ Mon, 5 Jul 2004 10:41:54 +0200
Mon Jul 5 20:50:09 CEST 2004
- Added free() calls against memory leak in interval.c.
Tue Jul 20 09:15:21 CEST 2004
- Synced parser and keyword list.
- Fixed handling of cyclic defines.
- Set pgtypes library version to 1.2.
- Set ecpg version to 3.2.0.
- Set compat library version to 1.2.
...
...
src/interfaces/ecpg/preproc/ecpg.c
浏览文件 @
5420ed3a
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.8
8 2004/06/10 22:26:23 momjian
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.8
9 2004/07/20 18:06:41 meskes
Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
...
...
@@ -96,7 +96,7 @@ add_preprocessor_define(char *define)
{
char
*
tmp
;
/* symbol
get
s a value */
/* symbol
ha
s a value */
for
(
tmp
=
ptr
-
1
;
*
tmp
==
' '
;
tmp
--
);
tmp
[
1
]
=
'\0'
;
defines
->
old
=
define_copy
;
...
...
@@ -105,9 +105,10 @@ add_preprocessor_define(char *define)
else
{
defines
->
old
=
define_copy
;
defines
->
new
=
mm_strdup
(
""
);
defines
->
new
=
mm_strdup
(
"
1
"
);
}
defines
->
pertinent
=
true
;
defines
->
used
=
NULL
;
defines
->
next
=
pd
;
}
...
...
src/interfaces/ecpg/preproc/keywords.c
浏览文件 @
5420ed3a
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.6
3 2004/06/20 10:45:47
meskes Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.6
4 2004/07/20 18:06:41
meskes Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -233,8 +233,6 @@ static ScanKeyword ScanKeywords[] = {
{
"owner"
,
OWNER
},
{
"partial"
,
PARTIAL
},
{
"password"
,
PASSWORD
},
{
"path"
,
PATH_P
},
{
"pendant"
,
PENDANT
},
{
"position"
,
POSITION
},
{
"precision"
,
PRECISION
},
{
"prepare"
,
PREPARE
},
...
...
@@ -327,7 +325,6 @@ static ScanKeyword ScanKeywords[] = {
{
"varchar"
,
VARCHAR
},
{
"varying"
,
VARYING
},
{
"verbose"
,
VERBOSE
},
{
"version"
,
VERSION
},
{
"view"
,
VIEW
},
{
"volatile"
,
VOLATILE
},
{
"when"
,
WHEN
},
...
...
src/interfaces/ecpg/preproc/pgc.l
浏览文件 @
5420ed3a
...
...
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.1
29 2004/06/30 15:01:57
meskes Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.1
30 2004/07/20 18:06:41
meskes Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -598,11 +598,11 @@ cppline {space}*#(.*\\{space})+.*
<SQL>{identifier} {
ScanKeyword *keyword;
struct _defines *ptr;
/* How about a DEFINE? */
for (ptr = defines; ptr; ptr = ptr->next)
{
if (strcmp(yytext, ptr->old) == 0)
if (strcmp(yytext, ptr->old) == 0
&& ptr->used == NULL
)
{
struct _yy_buffer *yb;
...
...
@@ -611,15 +611,14 @@ cppline {space}*#(.*\\{space})+.*
yb->buffer = YY_CURRENT_BUFFER;
yb->lineno = yylineno;
yb->filename = mm_strdup(input_filename);
yb->next = yy_buffer;
ptr->used =
yb->next = yy_buffer;
yy_buffer = yb;
yy_scan_string(ptr->new);
break;
}
}
if (ptr == NULL)
{
/* Is it an SQL keyword? */
...
...
@@ -640,16 +639,13 @@ cppline {space}*#(.*\\{space})+.*
/*
* None of the above. Return it as an identifier.
*
* The backend w
ould
attempt to truncate and case-fold
* The backend w
ill
attempt to truncate and case-fold
* the identifier, but I see no good reason for ecpg
* to do so; that's just another way that ecpg could get
* out of step with the backend.
*/
if (ptr == NULL)
{
yylval.str = mm_strdup(yytext);
return IDENT;
}
yylval.str = mm_strdup(yytext);
return IDENT;
}
}
<SQL>{other} { return yytext[0]; }
...
...
@@ -700,7 +696,7 @@ cppline {space}*#(.*\\{space})+.*
/* is it a define? */
for (ptr = defines; ptr; ptr = ptr->next)
{
if (strcmp(yytext, ptr->old) == 0)
if (strcmp(yytext, ptr->old) == 0
&& ptr->used == NULL
)
{
struct _yy_buffer *yb;
...
...
@@ -709,7 +705,7 @@ cppline {space}*#(.*\\{space})+.*
yb->buffer = YY_CURRENT_BUFFER;
yb->lineno = yylineno;
yb->filename = mm_strdup(input_filename);
yb->next = yy_buffer;
ptr->used =
yb->next = yy_buffer;
yy_buffer = yb;
...
...
@@ -739,7 +735,7 @@ cppline {space}*#(.*\\{space})+.*
<C>"-" { return('-'); }
<C>"(" { return('('); }
<C>")" { return(')'); }
<C
>{space}
{ ECHO; }
<C
,xskip>{space}
{ ECHO; }
<C>\{ { return('{'); }
<C>\} { return('}'); }
<C>\[ { return('['); }
...
...
@@ -975,12 +971,13 @@ cppline {space}*#(.*\\{space})+.*
}
if (ptr == NULL)
{
this = (struct _defines *) mm_alloc(sizeof(struct _defines));
this = (struct _defines *) mm_alloc(sizeof(struct _defines));
/* initial definition */
this->old = old;
this->new = mm_strdup(literalbuf);
/* initial definition */
this->old = old;
this->new = mm_strdup(literalbuf);
this->next = defines;
this->used = NULL;
defines = this;
}
...
...
@@ -993,7 +990,7 @@ cppline {space}*#(.*\\{space})+.*
<incl>[^;\<\>\"]+";" { parse_include(); }
<<EOF>> {
if (yy_buffer == NULL) {
if (yy_buffer == NULL) {
if ( preproc_tos > 0 )
{
preproc_tos = 0;
...
...
@@ -1005,7 +1002,15 @@ cppline {space}*#(.*\\{space})+.*
{
struct _yy_buffer *yb = yy_buffer;
int i;
struct _defines *ptr;
for (ptr = defines; ptr; ptr = ptr->next)
if (ptr->used == yy_buffer)
{
ptr->used = NULL;
break;
}
if (yyin != NULL)
fclose(yyin);
...
...
@@ -1025,6 +1030,7 @@ cppline {space}*#(.*\\{space})+.*
if (i != 0)
output_line_number();
}
}
%%
...
...
src/interfaces/ecpg/preproc/preproc.y
浏览文件 @
5420ed3a
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.29
2 2004/07/05 09:45:53
meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.29
3 2004/07/20 18:06:41
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -385,7 +385,7 @@ add_additional_variables(char *name, bool insert)
OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OR ORDER
OUT_P OUTER_P OVERLAPS OVERLAY OWNER
PARTIAL PASSWORD P
ATH_P PENDANT P
LACING POSITION
PARTIAL PASSWORD PLACING POSITION
PRECISION PRESERVE PREPARE PRIMARY PRIOR PRIVILEGES PROCEDURAL PROCEDURE
QUOTE
...
...
@@ -403,7 +403,7 @@ add_additional_variables(char *name, bool insert)
UNCOMMITTED UNENCRYPTED UNION UNIQUE UNKNOWN UNLISTEN UNTIL UPDATE USAGE
USER USING
VACUUM VALID VALUES VARCHAR VARYING VERBOSE V
ERSION V
IEW VOLATILE
VACUUM VALID VALUES VARCHAR VARYING VERBOSE VIEW VOLATILE
WHEN WHERE WITH WITHOUT WORK WRITE
YEAR_P
ZONE
...
...
@@ -414,7 +414,7 @@ add_additional_variables(char *name, bool insert)
*/
%token UNIONJOIN
/* Special
keywords, not in the query language
- see the "lex" file */
/* Special
token types, not actually keywords
- see the "lex" file */
%token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE IP BCONST XCONST
%token <ival> ICONST PARAM
%token <dval> FCONST
...
...
@@ -1232,6 +1232,9 @@ alter_table_cmd:
/* ALTER TABLE <name> SET WITHOUT CLUSTER */
| SET WITHOUT CLUSTER
{ $$ = make_str("set without cluster"); }
/* ALTER TABLE <name> SET TABLESPACE <tablespacename> */
| SET TABLESPACE name
{ $$ = cat_str(2, make_str("set tablespace"), $3); }
;
alter_column_default:
...
...
@@ -1590,8 +1593,8 @@ CreateAsElement: ColId { $$ = $1; }
*
*****************************************************************************/
CreateSeqStmt: CREATE OptTemp SEQUENCE qualified_name OptSeqList
OptTableSpace
{ $$ = cat_str(
5, make_str("create"), $2, make_str("sequence"), $4, $5, $6
); }
CreateSeqStmt: CREATE OptTemp SEQUENCE qualified_name OptSeqList
{ $$ = cat_str(
4, make_str("create"), $2, make_str("sequence"), $4, $5
); }
;
AlterSeqStmt: ALTER SEQUENCE qualified_name OptSeqList
...
...
@@ -5857,6 +5860,7 @@ ECPGunreserved: ABORT_P { $$ = make_str("abort"); }
| ADD { $$ = make_str("add"); }
| AFTER { $$ = make_str("after"); }
| AGGREGATE { $$ = make_str("aggregate"); }
| ALSO { $$ = make_str("also"); }
| ALTER { $$ = make_str("alter"); }
| ASSERTION { $$ = make_str("assertion"); }
| ASSIGNMENT { $$ = make_str("assignment"); }
...
...
@@ -5957,8 +5961,6 @@ ECPGunreserved: ABORT_P { $$ = make_str("abort"); }
| OWNER { $$ = make_str("owner"); }
| PARTIAL { $$ = make_str("partial"); }
| PASSWORD { $$ = make_str("password"); }
| PATH_P { $$ = make_str("path"); }
| PENDANT { $$ = make_str("pendant"); }
| PREPARE { $$ = make_str("prepare"); }
| PRESERVE { $$ = make_str("preserver"); }
| PRIOR { $$ = make_str("prior"); }
...
...
@@ -6021,7 +6023,6 @@ ECPGunreserved: ABORT_P { $$ = make_str("abort"); }
| VALID { $$ = make_str("valid"); }
| VALUES { $$ = make_str("values"); }
| VARYING { $$ = make_str("varying"); }
| VERSION { $$ = make_str("version"); }
| VIEW { $$ = make_str("view"); }
| WITH { $$ = make_str("with"); }
| WITHOUT { $$ = make_str("without"); }
...
...
src/interfaces/ecpg/preproc/type.h
浏览文件 @
5420ed3a
...
...
@@ -135,6 +135,7 @@ struct _defines
char
*
old
;
char
*
new
;
int
pertinent
;
void
*
used
;
struct
_defines
*
next
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录