aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/preproc.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/preproc.y')
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y67
1 files changed, 44 insertions, 23 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 42c8799ea77..d618da6d8f9 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1,4 +1,4 @@
-/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.212 2003/03/16 10:42:54 meskes Exp $ */
+/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.213 2003/03/20 15:56:50 meskes Exp $ */
/* Copyright comment */
%{
@@ -4223,6 +4223,22 @@ single_vt_type: common_type
$$.type_index = -1;
$$.type_sizeof = NULL;
}
+ else if (strcmp($1, "date") == 0)
+ {
+ $$.type_enum = ECPGt_date;
+ $$.type_str = make_str("Date");
+ $$.type_dimension = -1;
+ $$.type_index = -1;
+ $$.type_sizeof = NULL;
+ }
+ else if (strcmp($1, "timestamp") == 0)
+ {
+ $$.type_enum = ECPGt_timestamp;
+ $$.type_str = make_str("Timestamp");
+ $$.type_dimension = -1;
+ $$.type_index = -1;
+ $$.type_sizeof = NULL;
+ }
else
{
/* this is for typedef'ed types */
@@ -4236,17 +4252,6 @@ single_vt_type: common_type
struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
}
}
- | ECPGColLabelCommon '(' precision opt_scale ')'
- {
- if (strcmp($1, "numeric") != 0 && strcmp($1, "decimal") != 0)
- mmerror(PARSE_ERROR, ET_ERROR, "Only numeric/decimal have precision/scale argument");
-
- $$.type_enum = ECPGt_numeric;
- $$.type_str = EMPTY;
- $$.type_dimension = -1;
- $$.type_index = -1;
- $$.type_sizeof = NULL;
- }
;
/*
@@ -4415,6 +4420,17 @@ common_type: simple_type
$$.type_index = -1;
$$.type_sizeof = NULL;
}
+ | ECPGColLabelCommon '(' precision opt_scale ')'
+ {
+ if (strcmp($1, "numeric") != 0 && strcmp($1, "decimal") != 0)
+ mmerror(PARSE_ERROR, ET_ERROR, "Only numeric/decimal have precision/scale argument");
+
+ $$.type_enum = ECPGt_numeric;
+ $$.type_str = EMPTY;
+ $$.type_dimension = -1;
+ $$.type_index = -1;
+ $$.type_sizeof = NULL;
+ }
;
var_type: common_type
@@ -4464,6 +4480,22 @@ var_type: common_type
$$.type_index = -1;
$$.type_sizeof = NULL;
}
+ else if (strcmp($1, "date") == 0)
+ {
+ $$.type_enum = ECPGt_date;
+ $$.type_str = make_str("Date");
+ $$.type_dimension = -1;
+ $$.type_index = -1;
+ $$.type_sizeof = NULL;
+ }
+ else if (strcmp($1, "timestamp") == 0)
+ {
+ $$.type_enum = ECPGt_timestamp;
+ $$.type_str = make_str("Timestamp");
+ $$.type_dimension = -1;
+ $$.type_index = -1;
+ $$.type_sizeof = NULL;
+ }
else
{
/* this is for typedef'ed types */
@@ -4477,17 +4509,6 @@ var_type: common_type
struct_member_list[struct_level] = ECPGstruct_member_dup(this->struct_member_list);
}
}
- | ECPGColLabelCommon '(' precision opt_scale ')'
- {
- if (strcmp($1, "numeric") != 0 && strcmp($1, "decimal") != 0)
- mmerror(PARSE_ERROR, ET_ERROR, "Only numeric/decimal have precision/scale argument");
-
- $$.type_enum = ECPGt_numeric;
- $$.type_str = EMPTY;
- $$.type_dimension = -1;
- $$.type_index = -1;
- $$.type_sizeof = NULL;
- }
;
enum_type: SQL_ENUM opt_symbol enum_definition