1
1
/* src/interfaces/ecpg/preproc/ecpg.addons */
2
- ECPG: stmtClosePortalStmt block
2
+ ECPG: block stmt ClosePortalStmt
3
3
{
4
4
if (INFORMIX_MODE)
5
5
{
@@ -16,23 +16,23 @@ ECPG: stmtClosePortalStmt block
16
16
17
17
output_statement(@1, 0, ECPGst_normal);
18
18
}
19
- ECPG: stmtDeallocateStmt block
19
+ ECPG: block stmt DeallocateStmt
20
20
{
21
21
output_deallocate_prepare_statement(@1);
22
22
}
23
- ECPG: stmtDeclareCursorStmt block
23
+ ECPG: block stmt DeclareCursorStmt
24
24
{
25
25
output_simple_statement(@1, (strncmp(@1, "ECPGset_var", strlen("ECPGset_var")) == 0) ? 4 : 0);
26
26
}
27
- ECPG: stmtDiscardStmt block
28
- ECPG: stmtFetchStmt block
27
+ ECPG: block stmt DiscardStmt
28
+ ECPG: block stmt FetchStmt
29
29
{ output_statement(@1, 1, ECPGst_normal); }
30
- ECPG: stmtDeleteStmt block
31
- ECPG: stmtInsertStmt block
32
- ECPG: stmtSelectStmt block
33
- ECPG: stmtUpdateStmt block
30
+ ECPG: block stmt DeleteStmt
31
+ ECPG: block stmt InsertStmt
32
+ ECPG: block stmt SelectStmt
33
+ ECPG: block stmt UpdateStmt
34
34
{ output_statement(@1, 1, ECPGst_prepnormal); }
35
- ECPG: stmtExecuteStmt block
35
+ ECPG: block stmt ExecuteStmt
36
36
{
37
37
check_declared_list($1.name);
38
38
if ($1.type == NULL || strlen($1.type) == 0)
@@ -57,7 +57,7 @@ ECPG: stmtExecuteStmt block
57
57
output_statement(cat_str(3, "execute", "$0", $1.type), 0, ECPGst_exec_with_exprlist);
58
58
}
59
59
}
60
- ECPG: stmtPrepareStmt block
60
+ ECPG: block stmt PrepareStmt
61
61
{
62
62
check_declared_list($1.name);
63
63
if ($1.type == NULL)
@@ -87,17 +87,17 @@ ECPG: stmtPrepareStmt block
87
87
output_statement(cat_str(5, "prepare", "$0", $1.type, "as", $1.stmt), 0, ECPGst_prepare);
88
88
}
89
89
}
90
- ECPG: stmtTransactionStmt block
90
+ ECPG: block stmt TransactionStmt
91
91
{
92
92
fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", @1);
93
93
whenever_action(2);
94
94
}
95
- ECPG: toplevel_stmtTransactionStmtLegacy block
95
+ ECPG: block toplevel_stmt TransactionStmtLegacy
96
96
{
97
97
fprintf(base_yyout, "{ ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", @1);
98
98
whenever_action(2);
99
99
}
100
- ECPG: stmtViewStmt rule
100
+ ECPG: rule stmt ViewStmt
101
101
| ECPGAllocateDescr
102
102
{
103
103
fprintf(base_yyout, "ECPGallocate_desc(__LINE__, %s);", @1);
@@ -231,45 +231,45 @@ ECPG: stmtViewStmt rule
231
231
232
232
output_simple_statement(@1, 0);
233
233
}
234
- ECPG: where_or_current_clauseWHERECURRENT_POFcursor_name block
234
+ ECPG: block where_or_current_clause WHERE CURRENT_P OF cursor_name
235
235
{
236
236
const char *cursor_marker = @4[0] == ':' ? "$0" : @4;
237
237
238
238
@$ = cat_str(2, "where current of", cursor_marker);
239
239
}
240
- ECPG: CopyStmtCOPYopt_binaryqualified_nameopt_column_listcopy_fromopt_programcopy_file_namecopy_delimiteropt_withcopy_optionswhere_clause addon
240
+ ECPG: addon CopyStmt COPY opt_binary qualified_name opt_column_list copy_from opt_program copy_file_name copy_delimiter opt_with copy_options where_clause
241
241
if (strcmp(@6, "from") == 0 &&
242
242
(strcmp(@7, "stdin") == 0 || strcmp(@7, "stdout") == 0))
243
243
mmerror(PARSE_ERROR, ET_WARNING, "COPY FROM STDIN is not implemented");
244
- ECPG: var_valueNumericOnly addon
244
+ ECPG: addon var_value NumericOnly
245
245
if (@1[0] == '$')
246
246
@$ = "$0";
247
- ECPG: fetch_argscursor_name addon
247
+ ECPG: addon fetch_args cursor_name
248
248
struct cursor *ptr = add_additional_variables(@1, false);
249
249
250
250
if (ptr->connection)
251
251
connection = mm_strdup(ptr->connection);
252
252
if (@1[0] == ':')
253
253
@$ = "$0";
254
- ECPG: fetch_argsfrom_incursor_name addon
254
+ ECPG: addon fetch_args from_in cursor_name
255
255
struct cursor *ptr = add_additional_variables(@2, false);
256
256
257
257
if (ptr->connection)
258
258
connection = mm_strdup(ptr->connection);
259
259
if (@2[0] == ':')
260
260
@$ = cat2_str(@1, "$0");
261
- ECPG: fetch_argsNEXTopt_from_incursor_name addon
262
- ECPG: fetch_argsPRIORopt_from_incursor_name addon
263
- ECPG: fetch_argsFIRST_Popt_from_incursor_name addon
264
- ECPG: fetch_argsLAST_Popt_from_incursor_name addon
265
- ECPG: fetch_argsALLopt_from_incursor_name addon
261
+ ECPG: addon fetch_args NEXT opt_from_in cursor_name
262
+ ECPG: addon fetch_args PRIOR opt_from_in cursor_name
263
+ ECPG: addon fetch_args FIRST_P opt_from_in cursor_name
264
+ ECPG: addon fetch_args LAST_P opt_from_in cursor_name
265
+ ECPG: addon fetch_args ALL opt_from_in cursor_name
266
266
struct cursor *ptr = add_additional_variables(@3, false);
267
267
268
268
if (ptr->connection)
269
269
connection = mm_strdup(ptr->connection);
270
270
if (@3[0] == ':')
271
271
@$ = cat_str(3, @1, @2, "$0");
272
- ECPG: fetch_argsSignedIconstopt_from_incursor_name addon
272
+ ECPG: addon fetch_args SignedIconst opt_from_in cursor_name
273
273
struct cursor *ptr = add_additional_variables(@3, false);
274
274
bool replace = false;
275
275
@@ -287,18 +287,18 @@ ECPG: fetch_argsSignedIconstopt_from_incursor_name addon
287
287
}
288
288
if (replace)
289
289
@$ = cat_str(3, @1, @2, @3);
290
- ECPG: fetch_argsFORWARDALLopt_from_incursor_name addon
291
- ECPG: fetch_argsBACKWARDALLopt_from_incursor_name addon
290
+ ECPG: addon fetch_args FORWARD ALL opt_from_in cursor_name
291
+ ECPG: addon fetch_args BACKWARD ALL opt_from_in cursor_name
292
292
struct cursor *ptr = add_additional_variables(@4, false);
293
293
294
294
if (ptr->connection)
295
295
connection = mm_strdup(ptr->connection);
296
296
if (@4[0] == ':')
297
297
@$ = cat_str(4, @1, @2, @3, "$0");
298
- ECPG: fetch_argsABSOLUTE_PSignedIconstopt_from_incursor_name addon
299
- ECPG: fetch_argsRELATIVE_PSignedIconstopt_from_incursor_name addon
300
- ECPG: fetch_argsFORWARDSignedIconstopt_from_incursor_name addon
301
- ECPG: fetch_argsBACKWARDSignedIconstopt_from_incursor_name addon
298
+ ECPG: addon fetch_args ABSOLUTE_P SignedIconst opt_from_in cursor_name
299
+ ECPG: addon fetch_args RELATIVE_P SignedIconst opt_from_in cursor_name
300
+ ECPG: addon fetch_args FORWARD SignedIconst opt_from_in cursor_name
301
+ ECPG: addon fetch_args BACKWARD SignedIconst opt_from_in cursor_name
302
302
struct cursor *ptr = add_additional_variables(@4, false);
303
303
bool replace = false;
304
304
@@ -316,19 +316,19 @@ ECPG: fetch_argsBACKWARDSignedIconstopt_from_incursor_name addon
316
316
}
317
317
if (replace)
318
318
@$ = cat_str(4, @1, @2, @3, @4);
319
- ECPG: cursor_namename block
319
+ ECPG: block cursor_name name
320
320
| char_civar
321
321
{
322
322
char *curname = loc_alloc(strlen(@1) + 2);
323
323
324
324
sprintf(curname, ":%s", @1);
325
325
@$ = curname;
326
326
}
327
- ECPG: ExplainableStmtExecuteStmt block
327
+ ECPG: block ExplainableStmt ExecuteStmt
328
328
{
329
329
@$ = $1.name;
330
330
}
331
- ECPG: PrepareStmtPREPAREprepared_nameprep_type_clauseASPreparableStmt block
331
+ ECPG: block PrepareStmt PREPARE prepared_name prep_type_clause AS PreparableStmt
332
332
{
333
333
$$.name = @2;
334
334
$$.type = @3;
@@ -340,20 +340,20 @@ ECPG: PrepareStmtPREPAREprepared_nameprep_type_clauseASPreparableStmt block
340
340
$$.type = NULL;
341
341
$$.stmt = @4;
342
342
}
343
- ECPG: ExecuteStmtEXECUTEprepared_nameexecute_param_clauseexecute_rest block
343
+ ECPG: block ExecuteStmt EXECUTE prepared_name execute_param_clause execute_rest
344
344
{
345
345
$$.name = @2;
346
346
$$.type = @3;
347
347
}
348
- ECPG: ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEprepared_nameexecute_param_clauseopt_with_dataexecute_rest block
348
+ ECPG: block ExecuteStmt CREATE OptTemp TABLE create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
349
349
{
350
350
$$.name = @$;
351
351
}
352
- ECPG: ExecuteStmtCREATEOptTempTABLEIF_PNOTEXISTScreate_as_targetASEXECUTEprepared_nameexecute_param_clauseopt_with_dataexecute_rest block
352
+ ECPG: block ExecuteStmt CREATE OptTemp TABLE IF_P NOT EXISTS create_as_target AS EXECUTE prepared_name execute_param_clause opt_with_data execute_rest
353
353
{
354
354
$$.name = @$;
355
355
}
356
- ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectStmt block
356
+ ECPG: block DeclareCursorStmt DECLARE cursor_name cursor_options CURSOR opt_hold FOR SelectStmt
357
357
{
358
358
struct cursor *ptr,
359
359
*this;
@@ -403,7 +403,7 @@ ECPG: DeclareCursorStmtDECLAREcursor_namecursor_optionsCURSORopt_holdFORSelectSt
403
403
404
404
@$ = cat2_str(adjust_outofscope_cursor_vars(this), comment);
405
405
}
406
- ECPG: ClosePortalStmtCLOSEcursor_name block
406
+ ECPG: block ClosePortalStmt CLOSE cursor_name
407
407
{
408
408
const char *cursor_marker = @2[0] == ':' ? "$0" : @2;
409
409
struct cursor *ptr = NULL;
@@ -419,14 +419,14 @@ ECPG: ClosePortalStmtCLOSEcursor_name block
419
419
}
420
420
@$ = cat2_str("close", cursor_marker);
421
421
}
422
- ECPG: opt_hold block
422
+ ECPG: block opt_hold
423
423
{
424
424
if (compat == ECPG_COMPAT_INFORMIX_SE && autocommit)
425
425
@$ = "with hold";
426
426
else
427
427
@$ = "";
428
428
}
429
- ECPG: into_clauseINTOOptTempTableName block
429
+ ECPG: block into_clause INTO OptTempTableName
430
430
{
431
431
FoundInto = 1;
432
432
@$ = cat2_str("into", @2);
@@ -435,15 +435,15 @@ ECPG: into_clauseINTOOptTempTableName block
435
435
{
436
436
@$ = "";
437
437
}
438
- ECPG: TypenameSimpleTypenameopt_array_bounds block
438
+ ECPG: block Typename SimpleTypename opt_array_bounds
439
439
{
440
440
@$ = cat2_str(@1, $2.str);
441
441
}
442
- ECPG: TypenameSETOFSimpleTypenameopt_array_bounds block
442
+ ECPG: block Typename SETOF SimpleTypename opt_array_bounds
443
443
{
444
444
@$ = cat_str(3, "setof", @2, $3.str);
445
445
}
446
- ECPG: opt_array_boundsopt_array_bounds '['']' block
446
+ ECPG: block opt_array_bounds opt_array_bounds '[' ']'
447
447
{
448
448
$$.index1 = $1.index1;
449
449
$$.index2 = $1.index2;
@@ -463,20 +463,20 @@ ECPG: opt_array_boundsopt_array_bounds'['']' block
463
463
$$.index2 = @3;
464
464
$$.str = cat_str(4, $1.str, "[", @3, "]");
465
465
}
466
- ECPG: opt_array_bounds block
466
+ ECPG: block opt_array_bounds
467
467
{
468
468
$$.index1 = "-1";
469
469
$$.index2 = "-1";
470
470
$$.str = "";
471
471
}
472
- ECPG: AexprConstNULL_P rule
472
+ ECPG: rule AexprConst NULL_P
473
473
| civar
474
474
| civarind
475
- ECPG: VariableShowStmtSHOWALL block
475
+ ECPG: block VariableShowStmt SHOW ALL
476
476
{
477
477
mmerror(PARSE_ERROR, ET_ERROR, "SHOW ALL is not implemented");
478
478
}
479
- ECPG: FetchStmtMOVEfetch_args rule
479
+ ECPG: rule FetchStmt MOVE fetch_args
480
480
| FETCH fetch_args ecpg_fetch_into
481
481
| FETCH FORWARD cursor_name opt_ecpg_fetch_into
482
482
{
@@ -558,9 +558,9 @@ ECPG: FetchStmtMOVEfetch_args rule
558
558
559
559
@$ = cat_str(2, "move backward from", cursor_marker);
560
560
}
561
- ECPG: limit_clauseLIMITselect_limit_value ','select_offset_value block
561
+ ECPG: block limit_clause LIMIT select_limit_value ',' select_offset_value
562
562
{
563
563
mmerror(PARSE_ERROR, ET_WARNING, "no longer supported LIMIT #,# syntax passed to server");
564
564
}
565
- ECPG: SignedIconstIconst rule
565
+ ECPG: rule SignedIconst Iconst
566
566
| civar
0 commit comments