From d3571c755e4b014afcc67e9942d74d5fdb0dcf41 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Wed, 27 Oct 1999 14:36:09 +0000 Subject: [PATCH] *** empty log message *** --- src/interfaces/ecpg/ChangeLog | 9 ++++ src/interfaces/ecpg/preproc/Makefile | 2 +- src/interfaces/ecpg/preproc/preproc.y | 70 ++++++++++++++++++++++----- 3 files changed, 67 insertions(+), 14 deletions(-) diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index bd2a6f9e15..83c40f9caa 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -685,3 +685,12 @@ Fri Oct 15 17:05:25 CEST 1999 - Synced keyword.c. - Finished C parser changes, so initializers are correctly parsed. - Set ecpg version to 2.6.7 + +Mon Oct 25 09:28:17 CEST 1999 + + - Made sure Tom Lane's patches make it into my source tree. + +Wed Oct 27 18:08:09 CEST 1999 + + - Synced preproc.y with gram.y. + - Set ecpg version to 2.6.8 diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index 5a8d678ffc..713ccfe1be 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global MAJOR_VERSION=2 MINOR_VERSION=6 -PATCHLEVEL=7 +PATCHLEVEL=8 CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 06895e1979..788e37c340 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -775,7 +775,7 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim %type Iconst Fconst Sconst TransactionStmt CreateStmt UserId %type CreateAsElement OptCreateAs CreateAsList CreateAsStmt -%type OptInherit key_reference key_action +%type OptInherit key_reference key_action comment_text %type key_match ColLabel SpecialRuleRelation %type ColId ColQualifier columnDef ColQualList %type ColConstraint ColConstraintElem NumericOnly FloatOnly @@ -827,16 +827,16 @@ adjust_array(enum ECPGttype type_enum, int *dimension, int *length, int type_dim %type ViewStmt LoadStmt CreatedbStmt opt_database1 opt_database2 location %type DestroydbStmt ClusterStmt grantee RevokeStmt encoding %type GrantStmt privileges operation_commalist operation -%type opt_cursor opt_lmode ConstraintsSetStmt +%type opt_cursor opt_lmode ConstraintsSetStmt comment_tg %type case_expr when_clause_list case_default case_arg when_clause %type select_clause opt_select_limit select_limit_value %type select_offset_value table_list using_expr join_expr %type using_list from_expr table_expr join_clause join_type %type join_qual update_list join_clause join_clause_with_union %type opt_level opt_lock lock_type OptConstrTrigDeferrable, -%type OptConstrTrigInitdeferred OptConstrFromTable -%type constraints_set_list constraints_set_namelist -%type constraints_set_mode +%type OptConstrTrigInitdeferred OptConstrFromTable comment_op +%type constraints_set_list constraints_set_namelist comment_fn +%type constraints_set_mode comment_type comment_cl comment_ag %type ECPGWhenever ECPGConnect connection_target ECPGOpen opt_using %type indicator ECPGExecute ecpg_expr ECPGPrepare @@ -1895,21 +1895,65 @@ opt_portal_name: IN name { $$ = cat2_str(make1_str("in"), $2); } /***************************************************************************** * - * QUERY: - * comment on [ table | column . | AGGREGATE | FUNCTION + * (arg1, arg2, ...) | OPERATOR + * (leftoperand_typ rightoperand_typ) | TRIGGER ON + * ] IS 'text' * *****************************************************************************/ -CommentStmt: COMMENT ON COLUMN relation_name '.' attr_name IS Sconst +CommentStmt: COMMENT ON comment_type name IS comment_text { - cat2_str(cat5_str(make1_str("comment on column"), $4, make1_str(","), $6, make1_str("is")), $8); + $$ = cat5_str(make1_str("comment on"), $3, $4, make1_str("is"), $6); } - | COMMENT ON TABLE relation_name IS Sconst + | COMMENT ON comment_cl relation_name '.' attr_name IS comment_text + { + $$ = cat3_str(cat5_str(make1_str("comment on"), $3, $4, make1_str("."), $6), make1_str("is"), $8); + } + | COMMENT ON comment_ag name aggr_argtype IS comment_text + { + cat2_str(cat5_str(make1_str("comment on"), $3, $4, $5, make1_str("is")), $7); + } + | COMMENT ON comment_fn func_name func_args IS comment_text + { + cat2_str(cat5_str(make1_str("comment on"), $3, $4, $5, make1_str("is")), $7); + } + | COMMENT ON comment_op all_Op '(' oper_argtypes ')' IS comment_text + { + cat3_str(cat5_str(make1_str("comment on"), $3, $4, make1_str("("), $6), make1_str(") is"), $9); + } + | COMMENT ON comment_tg name ON relation_name IS comment_text { - cat4_str(make1_str("comment on table"), $4, make1_str("is"), $6); + cat3_str(cat5_str(make1_str("comment on"), $3, $4, make1_str("on"), $6), make1_str("is"), $8); } ; - + +comment_type: DATABASE { $$ = make1_str("database"); } + | INDEX { $$ = make1_str("idnex"); } + | RULE { $$ = make1_str("rule"); } + | SEQUENCE { $$ = make1_str("sequence"); } + | TABLE { $$ = make1_str("table"); } + | TYPE_P { $$ = make1_str("type"); } + | VIEW { $$ = make1_str("view"); } + ; + +comment_cl: COLUMN { $$ = make1_str("column"); } + +comment_ag: AGGREGATE { $$ = make1_str("aggregate"); } + +comment_fn: FUNCTION { $$ = make1_str("function"); } + +comment_op: OPERATOR { $$ = make1_str("operator"); } + +comment_tg: TRIGGER { $$ = make1_str("trigger"); } + +comment_text: Sconst { $$ = $1; } + | NULL_P { $$ = make1_str("null"); } + ; + /***************************************************************************** * * QUERY: -- 2.40.0