F diff --git a/src/backend/print/print.c b/src/backend/print/print.c
--- a/src/backend/print/print.c
+++ b/src/backend/print/print.c
return;
case DT_Typedef:
fprintf(out,"typedef ");
- print_token(out,((struct Denoted_Typedef*)denoted)->id);
+ print_token(out,((struct Denoted_Type*)denoted)->id);
fprintf(out," to ");
- print_type(out,((struct Denoted_Typedef*)denoted)->type,0);
+ print_type(out,((struct Denoted_Type*)denoted)->type,0);
return;
case DT_Function:
print_token(out,((struct Denoted_Function*)denoted)->id);
F diff --git a/src/frontend/parse/parse_declaration.c b/src/frontend/parse/parse_declaration.c
--- a/src/frontend/parse/parse_declaration.c
+++ b/src/frontend/parse/parse_declaration.c
Queue_Push(where_to_push,get_function_declaration_tree(scope,(struct Denoted_Function*)hold));
}else if(hold->denotation==DT_Typedef)
{
- Queue_Push(where_to_push,get_type_definition_tree((struct Denoted_Typedef*)hold));
+ Queue_Push(where_to_push,get_type_definition_tree((struct Denoted_Type*)hold));
}else if(hold->denotation==DT_Object)
{
Queue_Push(where_to_push,get_object_declaration_tree((struct Denoted_Object*)hold));
hold=check_ordinary(scope,(struct token*)translation_data->tokens->first->data);
if(hold!=NULL && hold->denotation==DT_Typedef)
{
- ret->type=((struct Denoted_Typedef*)hold)->type;
+ ret->type=((struct Denoted_Type*)hold)->type;
chomp(translation_data);
return ret;
}
F diff --git a/src/semantics/ast.c b/src/semantics/ast.c
--- a/src/semantics/ast.c
+++ b/src/semantics/ast.c
- struct AST_Type_Definition* get_type_definition_tree(struct Denoted_Typedef *definition)
+ struct AST_Type_Definition* get_type_definition_tree(struct Denoted_Type *definition)
{
struct AST_Type_Definition *ret;
ret=malloc(sizeof(struct AST_Type_Definition));
F diff --git a/src/semantics/ast.h b/src/semantics/ast.h
--- a/src/semantics/ast.h
+++ b/src/semantics/ast.h
struct AST_Type_Definition
{
enum AST_Type type;
- struct Denoted_Typedef *definition;
+ struct Denoted_Type *definition;
};
struct AST_Object_Declaration
{
struct AST_Return_Statement* get_return_statement_tree(struct AST* return_expression);
struct AST_Goto_Statement* get_goto_statement_tree(struct token *label,struct Scope *scope);
struct AST* get_nop_tree();
- struct AST_Type_Definition* get_type_definition_tree(struct Denoted_Typedef *definition);
+ struct AST_Type_Definition* get_type_definition_tree(struct Denoted_Type *definition);
struct AST_Object_Declaration* get_object_declaration_tree(struct Denoted_Object *object);
struct AST_Function_Declaration* get_function_declaration_tree(struct Scope *scope,struct Denoted_Function *function);
struct AST_Function_Definition* get_function_definition_tree(struct Scope *scope,struct Denoted_Function *function);
F diff --git a/src/semantics/identifiers/denoted.c b/src/semantics/identifiers/denoted.c
--- a/src/semantics/identifiers/denoted.c
+++ b/src/semantics/identifiers/denoted.c
struct Denoted* get_denoted_typedef(struct Denoted_Base *base)
{
- struct Denoted_Typedef *ret;
- ret=malloc(sizeof(struct Denoted_Typedef));
+ struct Denoted_Type *ret;
+ ret=malloc(sizeof(struct Denoted_Type));
ret->denotation=DT_Typedef;
ret->type=base->type;
ret->id=base->id;
delete_denoted_object((struct Denoted_Object*)denoted);
break;
case DT_Typedef:
- delete_denoted_typedef((struct Denoted_Typedef*)denoted);
+ delete_denoted_typedef((struct Denoted_Type*)denoted);
break;
case DT_Function:
delete_denoted_function((struct Denoted_Function*)denoted);
delete_ast(object->initializer);
free(object);
}
- void delete_denoted_typedef(struct Denoted_Typedef *typedefed)
+ void delete_denoted_typedef(struct Denoted_Type *typedefed)
{
if(typedefed->id!=NULL)
free(typedefed->id);
F diff --git a/src/semantics/identifiers/denoted.h b/src/semantics/identifiers/denoted.h
--- a/src/semantics/identifiers/denoted.h
+++ b/src/semantics/identifiers/denoted.h
#include <linkage.h>
#include <object.h>
-
- enum Denotation_Type;
- enum Function_Specifier;
+ /*
+ todo : delete these if nothing subtle breaks
+ enum Denotation_Type;
+ enum Function_Specifier;
+ */
struct Denoted
enum Linkage_Type linkage;
struct token *id;
+
struct Object *object;
+
struct AST *initializer;
};
- struct Denoted_Typedef
+ struct Denoted_Type
{
enum Denotation_Type denotation;
struct token *id;
void delete_denoted_error(struct Denoted_Error *error);
void delete_denoted_function(struct Denoted_Function *function);
void delete_denoted_object(struct Denoted_Object *object);
- void delete_denoted_typedef(struct Denoted_Typedef *typedefed);
+ void delete_denoted_typedef(struct Denoted_Type *typedefed);
void delete_denoted_enum(struct Denoted_Enum *enumeration);
void delete_denoted_enum_constant(struct Denoted_Enum_Const *enum_const);
void delete_denoted_struct_union(struct Denoted_Struct_Union *su);
F diff --git a/src/semantics/identifiers/denoted.hh b/src/semantics/identifiers/denoted.hh
--- a/src/semantics/identifiers/denoted.hh
+++ b/src/semantics/identifiers/denoted.hh
#define AS_DENOTED_OBJECT_PTR(x) ((struct Denoted_Object*)x)
#define AS_DENOTED_FUNCTION(x) ((struct Denoted_Function*)x)
- #define AS_DENOTED_TYPEDEF(x) ((struct Denoted_Typedef*)x)
+ #define AS_DENOTED_TYPEDEF(x) ((struct Denoted_Type*)x)
#define AS_DENOTED_ENUM(x) ((struct Denoted_Enum*)x)
#define AS_DENOTED_ENUM_CONST(x) ((struct Denoted_Enum_Const*)x)
#define AS_DENOTED_STRUCT_UNION(x) ((struct Denoted_Struct_Union*)x)
struct Denoted_Base;
struct Denoted_Function;
struct Denoted_Object;
- struct Denoted_Typedef;
+ struct Denoted_Type;
struct Denoted_Enum;
struct Denoted_Enum_Const;
struct Denoted_Struct_Union;
F diff --git a/src/semantics/identifiers/scope.c b/src/semantics/identifiers/scope.c
--- a/src/semantics/identifiers/scope.c
+++ b/src/semantics/identifiers/scope.c
#undef PF_ERROR
}
- void push_typedef(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Typedef *denoted_typedef)
+ void push_typedef(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Type *denoted_typedef)
{
struct Denoted *hold_denotated;
hold_denotated=CHECK_AND_PUSH(denoted_typedef,&AS_NORMAL_SCOPE(current)->ordinary);
F diff --git a/src/semantics/identifiers/scope.h b/src/semantics/identifiers/scope.h
--- a/src/semantics/identifiers/scope.h
+++ b/src/semantics/identifiers/scope.h
void push_label(struct Scope *current,struct token *id);/*TODO*/
void push_object(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Object *denoted_object);
void push_function(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Function *denoted_function);
- void push_typedef(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Typedef *denoted_typedef);
+ void push_typedef(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Type *denoted_typedef);
void push_denoted_enum_tag(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Enum *denoted_enum);
void push_denoted_enum_constant(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Enum_Const *denoted_enum_constant);
void push_denoted_struct_union_tag(struct Scope *current,struct Translation_Data *translation_data,struct Denoted_Struct_Union *denoted_struct_union);
F diff --git a/src/semantics/memory/object.h b/src/semantics/memory/object.h
--- a/src/semantics/memory/object.h
+++ b/src/semantics/memory/object.h
#include <type.h>
#include <location.h>
-
- enum Storage_Class_Specifier;
+ /*
+ todo : delete this if nothing subtle breaks
+ enum Storage_Class_Specifier;
+ */
struct Object
{
F diff --git a/src/semantics/memory/object.hh b/src/semantics/memory/object.hh
--- a/src/semantics/memory/object.hh
+++ b/src/semantics/memory/object.hh
SCS_NONE
};
+
struct Object;
#endif