Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
5a5f0a61
Commit
5a5f0a61
authored
Sep 23, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Changed struct definition handling so "struct foo {}" always gets defined.
parent
2ec8ee0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
64 deletions
+45
-64
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+40
-64
No files found.
src/interfaces/ecpg/ChangeLog
View file @
5a5f0a61
...
...
@@ -1651,6 +1651,11 @@ Mon Sep 22 15:13:02 CEST 2003
- Fixed order mismatch in processing "using" arguments.
- Fixed some minor things in test cases.
- Use defines for Informix error codes.
Tue Sep 23 14:50:45 CEST 2003
- Changed struct definition handling so "struct foo {}" always gets
defined.
- Set ecpg version to 3.0.0
- Set ecpg library to 4.0.0
- Set pgtypes library to 1.0.0
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
5a5f0a61
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.25
8 2003/09/22 13:19:39
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.25
9 2003/09/23 12:56:35
meskes Exp $ */
/* Copyright comment */
%{
...
...
@@ -540,7 +540,7 @@ add_additional_variables(char *name, bool insert)
%type <str> col_name_keyword func_name_keyword precision opt_scale
%type <str> ECPGTypeName using_list ECPGColLabelCommon UsingConst
%type <str> inf_val_list inf_col_list using_descriptor into_descriptor
%type <str> ecpg_into_using prepared_name
%type <str> ecpg_into_using prepared_name
struct_union_type_with_symbol
%type <struct_union> s_struct_union_symbol
...
...
@@ -551,7 +551,6 @@ add_additional_variables(char *name, bool insert)
%type <dtype_enum> descriptor_item desc_header_item
%type <type> var_type common_type single_vt_type
%type <type> struct_union_type_with_symbol
%type <action> action
...
...
@@ -4441,34 +4440,7 @@ single_var_declaration: storage_declaration
}
| struct_union_type_with_symbol ';'
{
/* this is essantially a typedef but needs the keyword struct/union as well */
struct typedefs *ptr, *this;
for (ptr = types; ptr != NULL; ptr = ptr->next)
{
if (strcmp($1.type_str, ptr->name) == 0)
{
/* re-definition is a bug */
snprintf(errortext, sizeof(errortext), "Type %s already defined", $1.type_str);
mmerror(PARSE_ERROR, ET_ERROR, errortext);
}
}
this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
/* initial definition */
this->next = types;
this->name = $1.type_str;
this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
this->type->type_enum = $1.type_enum;
this->type->type_str = mm_strdup($1.type_str);
this->type->type_dimension = make_str("-1"); /* dimension of array */
this->type->type_index = make_str("-1"); /* length of string */
this->type->type_sizeof = ECPGstruct_sizeof;
this->struct_member_list = struct_member_list[struct_level];
types = this;
$$ = cat2_str($1.type_sizeof, make_str(";"));
$$ = cat2_str($1, make_str(";"));
}
;
...
...
@@ -4658,6 +4630,7 @@ type_declaration: S_TYPEDEF
char * dimension = $6.index1;
char * length = $6.index2;
printf("MM: %s\n", $5);
if (($3.type_enum == ECPGt_struct ||
$3.type_enum == ECPGt_union) &&
initializer == 1)
...
...
@@ -4735,34 +4708,7 @@ var_declaration: storage_declaration
}
| struct_union_type_with_symbol ';'
{
/* this is essantially a typedef but needs the keyword struct/union as well */
struct typedefs *ptr, *this;
for (ptr = types; ptr != NULL; ptr = ptr->next)
{
if (strcmp($1.type_str, ptr->name) == 0)
{
/* re-definition is a bug */
snprintf(errortext, sizeof(errortext), "Type %s already defined", $1.type_str);
mmerror(PARSE_ERROR, ET_ERROR, errortext);
}
}
this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
/* initial definition */
this->next = types;
this->name = $1.type_str;
this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
this->type->type_enum = $1.type_enum;
this->type->type_str = mm_strdup($1.type_str);
this->type->type_dimension = make_str("-1"); /* dimension of array */
this->type->type_index = make_str("-1"); /* length of string */
this->type->type_sizeof = ECPGstruct_sizeof;
this->struct_member_list = struct_member_list[struct_level];
types = this;
$$ = cat2_str($1.type_sizeof, make_str(";"));
$$ = cat2_str($1, make_str(";"));
}
;
...
...
@@ -4996,21 +4942,51 @@ struct_union_type_with_symbol: s_struct_union_symbol
}
'{' variable_declarations '}'
{
struct typedefs *ptr, *this;
struct this_type su_type;
ECPGfree_struct_member(struct_member_list[struct_level]);
struct_member_list[struct_level] = NULL;
free(actual_storage[struct_level--]);
if (strncmp($1.su, "struct", sizeof("struct")-1) == 0)
$$
.type_enum = ECPGt_struct;
su_type
.type_enum = ECPGt_struct;
else
$$.type_enum = ECPGt_union;
$$.type_str = cat2_str($1.su, $1.symbol);
$$.type_sizeof = cat_str(4, mm_strdup($$.type_str), make_str("{"), $4, make_str("}"));
su_type.type_enum = ECPGt_union;
su_type.type_str = cat2_str($1.su, $1.symbol);
free(forward_name);
forward_name = NULL;
/* This is essantially a typedef but needs the keyword struct/union as well.
* So we create the typedef for each struct definition with symbol */
for (ptr = types; ptr != NULL; ptr = ptr->next)
{
if (strcmp(su_type.type_str, ptr->name) == 0)
{
/* re-definition is a bug */
snprintf(errortext, sizeof(errortext), "Type %s already defined", su_type.type_str);
mmerror(PARSE_ERROR, ET_ERROR, errortext);
}
}
this = (struct typedefs *) mm_alloc(sizeof(struct typedefs));
/* initial definition */
this->next = types;
this->name = mm_strdup(su_type.type_str);
this->type = (struct this_type *) mm_alloc(sizeof(struct this_type));
this->type->type_enum = su_type.type_enum;
this->type->type_str = mm_strdup(su_type.type_str);
this->type->type_dimension = make_str("-1"); /* dimension of array */
this->type->type_index = make_str("-1"); /* length of string */
this->type->type_sizeof = ECPGstruct_sizeof;
this->struct_member_list = struct_member_list[struct_level];
types = this;
$$ = cat_str(4, su_type.type_str, make_str("{"), $4, make_str("}"));
}
;
struct_union_type: struct_union_type_with_symbol { $$ = $1
.type_sizeof
; }
struct_union_type: struct_union_type_with_symbol { $$ = $1; }
| s_struct_union
{
struct_member_list[struct_level++] = NULL;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment