WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_DENOTED_H
#define WONKY_DENOTED_H WONKY_DENOTED_H
#include <denoted.hh>

#include <map.h>
#include <lexer.h>
#include <identifier.h>
#include <type.h>
#include <scope.h>
#include <evaluation.h>
#include <linkage.h>
#include <object.h>
#include <common.h>
#include <memory_location.h>

struct Denoted
{
	enum Denotation_Type denotation;
};
struct Denoted_Error
{
	enum Denotation_Type denotation;
	struct Denoted *error;
};
struct Denoted_Base
{
	enum Denotation_Type denotation;
	struct identifier *id;
	struct Type *type;
};
struct Denoted_Function
{
	enum Denotation_Type denotation;
	enum Linkage_Type linkage;
	struct identifier *id;
	struct Type *type;
	struct Memory_Location *location;

	enum Function_Specifier function_specifier;
	struct Function_Scope *function_scope;
};
struct Denoted_Object
{
	enum Denotation_Type denotation;
	enum Linkage_Type linkage;

	struct identifier *id;

	struct Object *object;
};
struct Denoted_Type
{
	enum Denotation_Type denotation;
	struct identifier *id;
	struct Type *type;

};
struct Denoted_Enum
{
	enum Denotation_Type denotation;
	struct Enum *enumeration;
};
struct Denoted_Enum_Const
{
	enum Denotation_Type denotation;
	struct identifier *id;

	struct Enum *parent;
	int value;
	struct AST* expression;
};

struct Denoted_Struct_Union
{
	enum Denotation_Type denotation;
	struct Struct_Union *struct_union;
};
struct Denoted_Statement
{
	enum Denotation_Type denotation;
	
	struct identifier *label;
	struct AST *statement;

	struct Queue *gotos_jumping_to_this_statement;

	struct Denoted_Object *previous_denoted_object;
};
struct Denotation_Prototype
{
	enum Denotation_Type denotation;
	struct Type *type;
	struct Map *node;


	enum Storage_Class_Specifier storage_class;
	enum Type_Specifier specifier;
	enum Type_Constraint constraint;
	enum Type_Signedness sign;
	enum Function_Specifier function_specifier;

	struct Struct_Union *struct_union;
	struct Enum *enumerator;

	size_t size;
	_Bool is_const:1;
	_Bool is_volatile:1;
	_Bool is_variadic_function:1;
};


struct Denoted_Base* get_denoted_base(struct Denotation_Prototype *prototype);
struct Denoted* get_denoted_error(struct Denoted *error);
struct Denoted* get_denoted_function(struct identifier *id,struct Type *type,enum Function_Specifier fs);
struct Denoted* get_denoted_object(struct identifier *id, enum Storage_Class_Specifier sc,struct Type *type,struct AST *initializer);
struct Denoted* get_denoted_typedef(struct Denoted_Base *base);
struct Denoted* get_denoted_enum_const_expr(struct identifier *id,struct Enum *parent,struct AST* expression,struct Translation_Data *translation_data);
struct Denoted* get_denoted_enum_const_num(struct identifier *id,struct Enum *parent,int value);
struct Denoted* get_denoted_enum(struct Enum *enumerator);
struct Denoted* get_denoted_struct_union(struct Struct_Union *struct_union);

struct Denoted* extract_denoted(struct Denoted_Base *base,struct Denotation_Prototype *prototype,_Bool allow_abstract);
struct Denoted* get_denoted_statement(struct identifier *id,struct AST *statement,struct Denoted_Object *previous_denoted_object);
struct Denoted* get_denotation_prototype(struct Program *program);


void delete_denoted_wrapper(void *denoted);
void delete_denoted_with_no_linkage_wrapper(void *denoted);
void delete_denoted(struct Denoted *denoted);
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_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);
void delete_denoted_prototype(struct Denotation_Prototype *prototype);
void delete_denoted_base(struct Denoted_Base *base);
void delete_denoted_statement(struct Denoted_Statement *statement);

enum Storage_Class_Specifier get_denoted_function_storage_class(struct Denoted_Function *function);

_Bool denoted_statement_is_declared(struct Denoted_Statement *statement);
#endif