Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5ba16a

Browse files
committed
Get rid of last few vestiges of parsetree dependency on grammar token
codes, per discussion from last March. parse.h should now be included*only* by gram.y, scan.l, keywords.c, parser.c. This prevents surprisingmisbehavior after seemingly-trivial grammar adjustments.
1 parentb5956a2 commitc5ba16a

File tree

13 files changed

+259
-236
lines changed

13 files changed

+259
-236
lines changed

‎src/backend/nodes/copyfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.242 2003/02/09 06:56:27 tgl Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.243 2003/02/10 04:44:44 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -1198,7 +1198,7 @@ _copyAExpr(A_Expr *from)
11981198
{
11991199
A_Expr*newnode=makeNode(A_Expr);
12001200

1201-
COPY_SCALAR_FIELD(oper);
1201+
COPY_SCALAR_FIELD(kind);
12021202
COPY_NODE_FIELD(name);
12031203
COPY_NODE_FIELD(lexpr);
12041204
COPY_NODE_FIELD(rexpr);
@@ -1669,7 +1669,7 @@ _copyDefineStmt(DefineStmt *from)
16691669
{
16701670
DefineStmt*newnode=makeNode(DefineStmt);
16711671

1672-
COPY_SCALAR_FIELD(defType);
1672+
COPY_SCALAR_FIELD(kind);
16731673
COPY_NODE_FIELD(defnames);
16741674
COPY_NODE_FIELD(definition);
16751675

@@ -1869,7 +1869,7 @@ _copyTransactionStmt(TransactionStmt *from)
18691869
{
18701870
TransactionStmt*newnode=makeNode(TransactionStmt);
18711871

1872-
COPY_SCALAR_FIELD(command);
1872+
COPY_SCALAR_FIELD(kind);
18731873
COPY_NODE_FIELD(options);
18741874

18751875
returnnewnode;
@@ -2215,7 +2215,7 @@ _copyReindexStmt(ReindexStmt *from)
22152215
{
22162216
ReindexStmt*newnode=makeNode(ReindexStmt);
22172217

2218-
COPY_SCALAR_FIELD(reindexType);
2218+
COPY_SCALAR_FIELD(kind);
22192219
COPY_NODE_FIELD(relation);
22202220
COPY_STRING_FIELD(name);
22212221
COPY_SCALAR_FIELD(force);

‎src/backend/nodes/equalfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Portions Copyright (c) 1994, Regents of the University of California
1919
*
2020
* IDENTIFICATION
21-
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.185 2003/02/09 06:56:27 tgl Exp $
21+
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.186 2003/02/10 04:44:45 tgl Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -730,7 +730,7 @@ _equalCreateStmt(CreateStmt *a, CreateStmt *b)
730730
staticbool
731731
_equalDefineStmt(DefineStmt*a,DefineStmt*b)
732732
{
733-
COMPARE_SCALAR_FIELD(defType);
733+
COMPARE_SCALAR_FIELD(kind);
734734
COMPARE_NODE_FIELD(defnames);
735735
COMPARE_NODE_FIELD(definition);
736736

@@ -898,7 +898,7 @@ _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
898898
staticbool
899899
_equalTransactionStmt(TransactionStmt*a,TransactionStmt*b)
900900
{
901-
COMPARE_SCALAR_FIELD(command);
901+
COMPARE_SCALAR_FIELD(kind);
902902
COMPARE_NODE_FIELD(options);
903903

904904
return true;
@@ -1187,7 +1187,7 @@ _equalDropGroupStmt(DropGroupStmt *a, DropGroupStmt *b)
11871187
staticbool
11881188
_equalReindexStmt(ReindexStmt*a,ReindexStmt*b)
11891189
{
1190-
COMPARE_SCALAR_FIELD(reindexType);
1190+
COMPARE_SCALAR_FIELD(kind);
11911191
COMPARE_NODE_FIELD(relation);
11921192
COMPARE_STRING_FIELD(name);
11931193
COMPARE_SCALAR_FIELD(force);
@@ -1276,7 +1276,7 @@ _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
12761276
staticbool
12771277
_equalAExpr(A_Expr*a,A_Expr*b)
12781278
{
1279-
COMPARE_SCALAR_FIELD(oper);
1279+
COMPARE_SCALAR_FIELD(kind);
12801280
COMPARE_NODE_FIELD(name);
12811281
COMPARE_NODE_FIELD(lexpr);
12821282
COMPARE_NODE_FIELD(rexpr);

‎src/backend/nodes/makefuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.37 2002/12/12 15:49:28 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.38 2003/02/10 04:44:45 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -24,11 +24,11 @@
2424
*makes an A_Expr node
2525
*/
2626
A_Expr*
27-
makeA_Expr(intoper,List*name,Node*lexpr,Node*rexpr)
27+
makeA_Expr(A_Expr_Kindkind,List*name,Node*lexpr,Node*rexpr)
2828
{
2929
A_Expr*a=makeNode(A_Expr);
3030

31-
a->oper=oper;
31+
a->kind=kind;
3232
a->name=name;
3333
a->lexpr=lexpr;
3434
a->rexpr=rexpr;
@@ -40,12 +40,12 @@ makeA_Expr(int oper, List *name, Node *lexpr, Node *rexpr)
4040
*As above, given a simple (unqualified) operator name
4141
*/
4242
A_Expr*
43-
makeSimpleA_Expr(intoper,constchar*name,
43+
makeSimpleA_Expr(A_Expr_Kindkind,constchar*name,
4444
Node*lexpr,Node*rexpr)
4545
{
4646
A_Expr*a=makeNode(A_Expr);
4747

48-
a->oper=oper;
48+
a->kind=kind;
4949
a->name=makeList1(makeString((char*)name));
5050
a->lexpr=lexpr;
5151
a->rexpr=rexpr;

‎src/backend/nodes/outfuncs.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.198 2003/02/09 06:56:27 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.199 2003/02/10 04:44:45 tgl Exp $
1212
*
1313
* NOTES
1414
* Every node type that can appear in stored rules' parsetrees *must*
@@ -27,7 +27,6 @@
2727
#include"nodes/parsenodes.h"
2828
#include"nodes/plannodes.h"
2929
#include"nodes/relation.h"
30-
#include"parser/parse.h"
3130
#include"utils/datum.h"
3231

3332

@@ -1259,19 +1258,27 @@ _outAExpr(StringInfo str, A_Expr *node)
12591258
{
12601259
WRITE_NODE_TYPE("AEXPR");
12611260

1262-
switch (node->oper)
1261+
switch (node->kind)
12631262
{
1264-
caseAND:
1263+
caseAEXPR_OP:
1264+
appendStringInfo(str," ");
1265+
WRITE_NODE_FIELD(name);
1266+
break;
1267+
caseAEXPR_AND:
12651268
appendStringInfo(str," AND");
12661269
break;
1267-
caseOR:
1270+
caseAEXPR_OR:
12681271
appendStringInfo(str," OR");
12691272
break;
1270-
caseNOT:
1273+
caseAEXPR_NOT:
12711274
appendStringInfo(str," NOT");
12721275
break;
1273-
caseOP:
1274-
appendStringInfo(str," ");
1276+
caseAEXPR_DISTINCT:
1277+
appendStringInfo(str," DISTINCT ");
1278+
WRITE_NODE_FIELD(name);
1279+
break;
1280+
caseAEXPR_OF:
1281+
appendStringInfo(str," OF ");
12751282
WRITE_NODE_FIELD(name);
12761283
break;
12771284
default:

‎src/backend/parser/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for parser
44
#
5-
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.39 2003/01/31 20:58:00 tgl Exp $
5+
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.40 2003/02/10 04:44:45 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -64,7 +64,7 @@ endif
6464

6565
# Force these dependencies to be known even without dependency info built:
6666

67-
keywords.oparse_clause.oparse_expr.oparser.ogram.o:$(srcdir)/parse.h
67+
gram.okeywords.oparser.o:$(srcdir)/parse.h
6868

6969

7070
# gram.c, parse.h, and scan.c are in the distribution tarball, so they

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp