Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
b703c127
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,发现更多精彩内容 >>
提交
b703c127
编写于
11月 03, 2000
作者:
M
Michael Meskes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Parser sync.
上级
94d8bbe5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
25 deletion
+29
-25
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+20
-23
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+4
-2
未找到文件。
src/interfaces/ecpg/ChangeLog
浏览文件 @
b703c127
...
...
@@ -1004,5 +1004,10 @@ Tue Oct 31 16:09:55 CET 2000
- Added patch by Christof Petig <christof.petig@wtal.de> fixing some
parser bugs.
Fri Nov 3 11:34:43 CET 2000
- Synced pgc.l with scan.l.
- Synced gram.y and preproc.y.
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
src/interfaces/ecpg/preproc/pgc.l
浏览文件 @
b703c127
...
...
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.6
6 2000/10/25 07:00:33
meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.6
7 2000/11/03 10:47:54
meskes Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -21,8 +21,6 @@
#include <limits.h>
#include <errno.h>
#include "postgres.h"
#include "miscadmin.h"
#include "nodes/parsenodes.h"
#include "nodes/pg_list.h"
...
...
@@ -89,14 +87,14 @@ static struct _if_value {
* We use exclusive states for quoted strings, extended comments,
* and to eliminate parsing troubles for numeric strings.
* Exclusive states:
* <xb
> binary numeric string - thomas 1997-11-16
* <xb
it> bit string literal
* <xc> extended C-style comments - thomas 1997-07-12
* <xd> delimited identifiers (double-quoted identifiers) - thomas 1997-10-27
* <xh> hexadecimal numeric string - thomas 1997-11-16
* <xq> quoted strings - thomas 1997-07-30
*/
%x xb
%x xb
it
%x xc
%x xd
%x xdc
...
...
@@ -106,12 +104,12 @@ static struct _if_value {
%x xcond
%x xskip
/* Bi
nary number
/* Bi
t string
*/
xb
start
[bB]{quote}
xb
stop
{quote}
xbi
nside [^']+
xbcat {quote}{whitespace_with_newline}{quote}
xb
itstart
[bB]{quote}
xb
itstop
{quote}
xbi
tinside [^']*
xb
it
cat {quote}{whitespace_with_newline}{quote}
/* Hexadecimal number
*/
...
...
@@ -192,7 +190,7 @@ typecast "::"
* If you change either set, adjust the character lists appearing in the
* rule for "operator"!
*/
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=
\|
]
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=]
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+
...
...
@@ -313,30 +311,29 @@ cppline {space}*#(.*\\{line_end})*.*
<xc><<EOF>> { mmerror(ET_ERROR, "Unterminated /* comment"); }
<SQL>{xbstart} {
BEGIN(xb);
<SQL>{xb
it
start} {
BEGIN(xb
it
);
startlit();
}
<xb
>{xbstop}
{
<xb
it>{xbitstop}
{
char* endptr;
BEGIN(SQL);
errno = 0;
yylval.ival = strtol(literalbuf, &endptr, 2);
if (*endptr != '\0' || errno == ERANGE)
mmerror(ET_ERROR, "Bad binary integer input!");
return ICONST;
if (literalbuf[strspn(literalbuf, "01") + 1] != '\0')
mmerror(ET_ERROR, "invalid bit string input.");
yylval.str = literalbuf;
return BITCONST;
}
<xh>{xhinside} |
<xb
>{xb
inside} {
<xb
it>{xbit
inside} {
addlit(yytext, yyleng);
}
<xh>{xhcat} |
<xb
>{xb
cat} {
<xb
it>{xbit
cat} {
/* ignore */
}
<xb
><<EOF>> { mmerror(ET_ERROR, "Unterminated binary integer
"); }
<xb
it><<EOF>> { mmerror(ET_ERROR, "Unterminated bit string
"); }
<SQL>{xhstart} {
BEGIN(xh);
...
...
@@ -490,7 +487,7 @@ cppline {space}*#(.*\\{line_end})*.*
* that the "self" rule would have.
*/
if (nchars == 1 &&
strchr(",()[].;$:+-*/%^<>=
|
", yytext[0]))
strchr(",()[].;$:+-*/%^<>=", yytext[0]))
return yytext[0];
}
...
...
src/interfaces/ecpg/preproc/preproc.y
浏览文件 @
b703c127
...
...
@@ -242,7 +242,7 @@ make_name(void)
%token UNIONJOIN
/* Special keywords, not in the query language - see the "lex" file */
%token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE IP
%token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE IP
BITCONST
%token <ival> ICONST PARAM
%token <dval> FCONST
...
...
@@ -281,7 +281,7 @@ make_name(void)
%type <str> CreateAsElement OptCreateAs CreateAsList CreateAsStmt
%type <str> OptUnder key_reference comment_text ConstraintDeferrabilitySpec
%type <str> key_match ColLabel SpecialRuleRelation ColId columnDef
%type <str> ColConstraint ColConstraintElem drop_type
%type <str> ColConstraint ColConstraintElem drop_type
Bitconst
%type <str> OptTableElementList OptTableElement TableConstraint
%type <str> ConstraintElem key_actions ColQualList TokenId DropSchemaStmt
%type <str> target_list target_el update_target_list alias_clause
...
...
@@ -3790,6 +3790,7 @@ ParamNo: PARAM opt_indirection
Iconst: ICONST { $$ = make_name();};
Fconst: FCONST { $$ = make_name();};
Bitconst: BITCONST { $$ = make_name();};
Sconst: SCONST {
$$ = (char *)mm_alloc(strlen($1) + 3);
$$[0]='\'';
...
...
@@ -3825,6 +3826,7 @@ AllConst: Sconst { $$ = $1; }
PosAllConst: Sconst { $$ = $1; }
| Fconst { $$ = $1; }
| Iconst { $$ = $1; }
| Bitconst { $$ = $1; }
| civar { $$ = make_str("?"); }
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录