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

Commit3223374

Browse files
author
Michael Meskes
committed
Synced parser.
1 parentaa7fdbe commit3223374

File tree

3 files changed

+96
-34
lines changed

3 files changed

+96
-34
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,12 @@ Sun Aug 18 16:09:06 CEST 2002
12861286

12871287
Tue Aug 20 14:13:34 CEST 2002
12881288

1289-
- Removed ',' from preproc.y to bit bison 1.49b.
1289+
- Removed ',' from preproc.y for bison 1.49b.
1290+
1291+
Sun Sep 1 11:13:04 CEST 2002
1292+
1293+
- Synced preproc.y with gram.y.
1294+
- Synced keywords.c.
12901295
- Set ecpg version to 2.10.0.
12911296
- Set library version to 3.4.0.
12921297

‎src/interfaces/ecpg/preproc/keywords.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.50.2.3 2002/08/18 14:32:21 meskes Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.50.2.4 2002/09/01 09:31:58 meskes Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -94,6 +94,7 @@ static ScanKeyword ScanKeywords[] = {
9494
{"cycle",CYCLE},
9595
{"database",DATABASE},
9696
{"day",DAY_P},
97+
{"deallocate",DEALLOCATE},
9798
{"dec",DEC},
9899
{"decimal",DECIMAL},
99100
{"declare",DECLARE},
@@ -223,6 +224,7 @@ static ScanKeyword ScanKeywords[] = {
223224
{"pendant",PENDANT},
224225
{"position",POSITION},
225226
{"precision",PRECISION},
227+
{"prepare",PREPARE},
226228
{"primary",PRIMARY},
227229
{"prior",PRIOR},
228230
{"privileges",PRIVILEGES},

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 87 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.4 2002/08/20 12:23:36 meskes Exp $*/
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.190.2.5 2002/09/01 09:31:58 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -191,8 +191,9 @@ make_name(void)
191191
CREATE CREATEDB CREATEUSER CROSS CURRENT_DATE CURRENT_TIME
192192
CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
193193

194-
DATABASE DAY_P DEC DECIMAL DECLARE DEFAULT DEFERRABLE DEFERRED
195-
DEFINER DELETE_P DELIMITER DELIMITERS DESC DISTINCT DO DOMAIN_P DOUBLE DROP
194+
DATABASE DAY_P DEALLOCATE DEC DECIMAL DECLARE DEFAULT
195+
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
196+
DESC DISTINCT DO DOMAIN_P DOUBLE DROP
196197
EACH ELSE ENCODING ENCRYPTED END_TRANS ESCAPE EXCEPT EXCLUSIVE
197198
EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
198199

@@ -221,8 +222,8 @@ make_name(void)
221222
OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OR ORDER
222223
OUT_P OUTER_P OVERLAPS OVERLAY OWNER
223224

224-
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION PRECISIONPRIMARY
225-
PRIOR PRIVILEGES PROCEDURE PROCEDURAL
225+
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION PRECISIONPREPARE
226+
PRIMARYPRIOR PRIVILEGES PROCEDURE PROCEDURAL
226227

227228
READ REAL RECHECK REFERENCES REINDEX RELATIVE RENAME REPLACE
228229
RESET RESTRICT RETURNS REVOKE RIGHT ROLLBACK ROW RULE
@@ -287,9 +288,9 @@ make_name(void)
287288
%type<str>CreateAsElementOptCreateAsCreateAsListCreateAsStmt
288289
%type<str>comment_textConstraintDeferrabilitySpecTableElementList
289290
%type<str>key_matchColLabelSpecialRuleRelationColIdcolumnDef
290-
%type<str>ColConstraintColConstraintElemdrop_typeBconst
291-
%type<str>TableConstraintOptTableElementListXconst
292-
%type<str>ConstraintElemkey_actionsColQualListtype_name
291+
%type<str>ColConstraintColConstraintElemdrop_typeBconst
292+
%type<str>TableConstraintOptTableElementListXconstprep_type_clause
293+
%type<str>ConstraintElemkey_actionsColQualListtype_namePrepareStmt
293294
%type<str>target_listtarget_elupdate_target_listalias_clause
294295
%type<str>update_target_elopt_idqualified_namedatabase_name
295296
%type<str>access_methodattr_nameindex_namenamefunc_name
@@ -300,7 +301,7 @@ make_name(void)
300301
%type<str>trim_listin_exprsubstr_forattrsTableFuncElement
301302
%type<str>TypenameSimpleTypenameNumericopt_floatopt_numeric
302303
%type<str>opt_decimalCharactercharacteropt_varyingopt_charset
303-
%type<str>opt_collateopt_timezoneopt_intervaltable_ref
304+
%type<str>opt_collateopt_timezoneopt_intervaltable_refDeallocateStmt
304305
%type<str>row_descriptorrow_listConstDatetimetrans_options
305306
%type<str>SelectStmtinto_clauseOptTempConstraintAttributeSpec
306307
%type<str>opt_tableopt_allsort_clausesortby_listConstraintAttr
@@ -321,7 +322,7 @@ make_name(void)
321322
%type<str>def_elemdef_listdefinitionDefineStmtselect_with_parens
322323
%type<str>opt_insteadeventRuleActionListopt_usingCreateAssertStmt
323324
%type<str>RuleActionStmtOrEmptyRuleActionMultifunc_asreindex_type
324-
%type<str>RuleStmtopt_columnopt_nameoper_argtypesNumConst
325+
%type<str>RuleStmtopt_columnopt_nameoper_argtypesNumConstExecuteStmt
325326
%type<str>MathOpRemoveFuncStmtaggr_argtypefor_update_clause
326327
%type<str>RemoveAggrStmtopt_proceduralselect_no_parensCreateCastStmt
327328
%type<str>RemoveOperStmtRenameStmtall_Opopt_Trustedopt_lancompiler
@@ -363,10 +364,11 @@ make_name(void)
363364
%type<str>opt_oidsTableLikeClausekey_actionopt_definition
364365
%type<str>opt_assignmentrowr_exprqual_Opqual_all_Opopt_default
365366
%type<str>CreateConversionStmtany_operatoropclass_item_list
366-
%type<str>iso_levelOptTableFuncElementListconvert_list
367+
%type<str>iso_levelconvert_listprep_type_list
367368
%type<str>convert_argstype_listCharacterWithLengthConstCharacter
368369
%type<str>CharacterWithoutLengthBitWithLengthBitWithoutLength
369-
%type<str>ConstBitGenericTypeTableFuncElementList
370+
%type<str>ConstBitGenericTypeTableFuncElementListexecute_param_clause
371+
%type<str>execute_param_listopt_sort_clause
370372

371373
%type<str>ECPGWheneverECPGConnectconnection_targetECPGOpen
372374
%type<str>indicatorECPGExecuteECPGPrepareecpg_usingecpg_into
@@ -454,6 +456,7 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
454456
|CreateTrigStmt{ output_statement($1,0, connection); }
455457
|CreateUserStmt{ output_statement($1,0, connection); }
456458
|ClusterStmt{ output_statement($1,0, connection); }
459+
|DeallocateStmt{ output_statement($1,0, connection); }
457460
|DefineStmt{ output_statement($1,0, connection); }
458461
|DropStmt{ output_statement($1,0, connection); }
459462
|TruncateStmt{ output_statement($1,0, connection); }
@@ -466,13 +469,15 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); }
466469
|DropRuleStmt{ output_statement($1,0, connection); }
467470
|DropUserStmt{ output_statement($1,0, connection); }
468471
|ExplainStmt{ output_statement($1,0, connection); }
472+
|ExecuteStmt{ output_statement($1,0, connection); }
469473
|FetchStmt{ output_statement($1,1, connection); }
470474
|GrantStmt{ output_statement($1,0, connection); }
471475
|IndexStmt{ output_statement($1,0, connection); }
472476
|ListenStmt{ output_statement($1,0, connection); }
473477
|UnlistenStmt{ output_statement($1,0, connection); }
474478
|LockStmt{ output_statement($1,0, connection); }
475479
|NotifyStmt{ output_statement($1,0, connection); }
480+
|PrepareStmt{ output_statement($1,0, connection); }
476481
|ReindexStmt{ output_statement($1,0, connection); }
477482
|RemoveAggrStmt{ output_statement($1,0, connection); }
478483
|RemoveOperStmt{ output_statement($1,0, connection); }
@@ -1122,10 +1127,10 @@ OptTableElementList: TableElementList
11221127
|/*EMPTY*/
11231128
{$$ = EMPTY; }
11241129
;
1125-
TableElementList:TableElementList','TableElement
1126-
{$$ = cat_str(3,$1, make_str(","),$3); }
1127-
|TableElement
1130+
TableElementList:TableElement
11281131
{$$ =$1; }
1132+
|TableElementList','TableElement
1133+
{$$ = cat_str(3,$1, make_str(","),$3); }
11291134
;
11301135

11311136
TableElement:columnDef{$$ =$1; }
@@ -2358,6 +2363,54 @@ ExplainStmt: EXPLAIN opt_verbose OptimizableStmt
23582363
{$$ = cat_str(4, make_str("explain"),$2,$3,$4); }
23592364
;
23602365

2366+
/*****************************************************************************
2367+
*
2368+
* QUERY:
2369+
* PREPARE <plan_name> [(args, ...)] AS <query>
2370+
*
2371+
*****************************************************************************/
2372+
2373+
PrepareStmt:PREPAREnameprep_type_clauseASOptimizableStmt
2374+
{$$ = cat_str(5, make_str("prepare"),$2,$3, make_str("as"),$5); }
2375+
;
2376+
2377+
prep_type_clause:'('prep_type_list')'{$$ = cat_str(3, make_str("("),$2, make_str(")")); }
2378+
|/* EMPTY*/{$$ = EMPTY; }
2379+
;
2380+
2381+
prep_type_list:Typename{$$ =$1; }
2382+
|prep_type_list','Typename{$$ = cat_str(3,$1, make_str(","),$3); }
2383+
;
2384+
2385+
/*****************************************************************************
2386+
*
2387+
* QUERY:
2388+
* EXECUTE <plan_name> [(params, ...)] [INTO ...]
2389+
*
2390+
*****************************************************************************/
2391+
2392+
ExecuteStmt:EXECUTEnameexecute_param_clauseinto_clause
2393+
{$$ = cat_str(4, make_str("execute"),$2,$3,$4); }
2394+
;
2395+
2396+
execute_param_clause:'('execute_param_list')'{$$ = cat_str(3, make_str("("),$2, make_str(")")); }
2397+
|/* EMPTY*/{$$ = EMPTY; }
2398+
;
2399+
2400+
execute_param_list:a_expr{$$ =$1; }
2401+
|execute_param_list','a_expr{$$ = cat_str(3,$1, make_str(","),$3); }
2402+
;
2403+
2404+
/*****************************************************************************
2405+
*
2406+
* QUERY:
2407+
* DEALLOCATE [PREPARE] <plan_name>
2408+
*
2409+
*****************************************************************************/
2410+
2411+
DeallocateStmt:DEALLOCATEname{$$ = cat2_str(make_str("deallocate"),$2); }
2412+
|DEALLOCATEPREPAREname{$$ = cat2_str(make_str("deallocate prepare"),$3); }
2413+
;
23612414

23622415
/*****************************************************************************
23632416
* *
@@ -2523,12 +2576,12 @@ select_with_parens: '(' select_no_parens ')'
25232576

25242577
select_no_parens:simple_select
25252578
{$$ =$1; }
2526-
|select_clausesort_clauseopt_for_update_clauseopt_select_limit
2527-
{$$ = cat_str(4,$1,$2,$3,$4); }
2528-
|select_clausefor_update_clauseopt_select_limit
2529-
{$$ = cat_str(3,$1,$2,$3); }
2530-
|select_clauseselect_limit
2579+
|select_clausesort_clause
25312580
{$$ = cat2_str($1,$2); }
2581+
|select_clauseopt_sort_clausefor_update_clauseopt_select_limit
2582+
{$$ = cat_str(4,$1,$2,$3,$4); }
2583+
|select_clauseopt_sort_clauseselect_limitopt_for_update_clause
2584+
{$$ = cat_str(4,$1,$2,$3,$4); }
25322585
;
25332586

25342587
select_clause:simple_select{$$ =$1; }
@@ -2605,6 +2658,10 @@ opt_distinct: DISTINCT
26052658
{$$ = EMPTY; }
26062659
;
26072660

2661+
opt_sort_clause:sort_clause{$$ =$1; }
2662+
|/* EMPTY*/{$$ = EMPTY; }
2663+
;
2664+
26082665
sort_clause:ORDERBYsortby_list
26092666
{$$ = cat2_str(make_str("order by"),$3); }
26102667
;
@@ -2720,14 +2777,14 @@ table_ref:relation_expr
27202777
{$$= cat2_str($1,$2); }
27212778
|func_table
27222779
{$$ =$1; }
2723-
|func_tableAS'('OptTableFuncElementList')'
2780+
|func_tablealias_clause
2781+
{$$= cat2_str($1,$2); }
2782+
|func_tableAS'('TableFuncElementList')'
27242783
{$$=cat_str(4,$1, make_str("as ("),$4, make_str(")")); }
2725-
|func_tableASColId'('OptTableFuncElementList')'
2784+
|func_tableASColId'('TableFuncElementList')'
27262785
{$$=cat_str(6,$1, make_str("as"),$3, make_str("("),$5, make_str(")")); }
2727-
|func_tableColId'('OptTableFuncElementList')'
2786+
|func_tableColId'('TableFuncElementList')'
27282787
{$$=cat_str(5,$1,$2, make_str("("),$4, make_str(")")); }
2729-
|func_tablealias_clause
2730-
{$$= cat2_str($1,$2); }
27312788
|select_with_parens
27322789
{mmerror(PARSE_ERROR, ET_ERROR,"sub-SELECT in FROM must have an alias");}
27332790
|select_with_parensalias_clause
@@ -2825,14 +2882,10 @@ where_clause: WHERE a_expr{ $$ = cat2_str(make_str("where"), $2); }
28252882
|/*EMPTY*/{$$ = EMPTY;/* no qualifiers*/ }
28262883
;
28272884

2828-
OptTableFuncElementList:TableFuncElementList{$$ =$1; }
2829-
|/* EMPTY*/{$$ = EMPTY; }
2830-
;
2831-
2832-
TableFuncElementList:TableFuncElementList','TableFuncElement
2885+
TableFuncElementList:TableFuncElement
2886+
{$$ =$1; }
2887+
|TableFuncElementList','TableFuncElement
28332888
{$$ = cat_str(3,$1,',',$3); }
2834-
|TableFuncElement
2835-
{$$ =$1; }
28362889
;
28372890

28382891
TableFuncElement:ColIdTypename{$$ = cat2_str($1,$2); }
@@ -5102,6 +5155,7 @@ unreserved_keyword:
51025155
|CYCLE{$$ = make_str("cycle"); }
51035156
|DATABASE{$$ = make_str("database"); }
51045157
|DAY_P{$$ = make_str("day"); }
5158+
|DEALLOCATE{$$ = make_str("deallocate"); }
51055159
|DECLARE{$$ = make_str("declare"); }
51065160
|DEFERRED{$$ = make_str("deferred"); }
51075161
|DELETE_P{$$ = make_str("delete"); }
@@ -5169,6 +5223,7 @@ unreserved_keyword:
51695223
|PATH_P{$$ = make_str("path"); }
51705224
|PENDANT{$$ = make_str("pendant"); }
51715225
|PRECISION{$$ = make_str("precision"); }
5226+
|PREPARE{$$ = make_str("prepare"); }
51725227
|PRIOR{$$ = make_str("prior"); }
51735228
|PRIVILEGES{$$ = make_str("privileges"); }
51745229
|PROCEDURAL{$$ = make_str("procedural"); }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp