WONKY



LOG | FILES | OVERVIEW


#ifndef WONKY_INITIALISER_H
#define WONKY_INITIALISER_H WONKY_INITIALISER_H
#include <initialiser.hh>
#include <ast.h>
#include <denoted.h>
#include <queue.h>
#include <type.h>
#include <constraints.h>
#include <common.h>
#include <debug.h>

struct Initialiser
{
	enum Initialiser_Type kind;
};
struct Initialiser_Denoted
{
	enum Initialiser_Type kind;

	struct Denoted_Object *to_be_initialised;
	struct Initialiser *initialiser;
};
struct Initialiser_Indexed
{
	enum Initialiser_Type kind;
	struct Type *type;

	size_t index;
	struct Initialiser *initialiser;
};
struct Initialiser_Expression
{
	enum Initialiser_Type kind;

	struct AST_Expression *expression;
};
struct Initialiser_Compound
{
	enum Initialiser_Type kind;
	struct Type *type;

	size_t number_of_components;
	struct Initialiser **components;
};
struct Initialiser_Error
{
	enum Initialiser_Type kind;

	struct Initialiser *error;	
};

struct Initialiser* get_denoted_initialiser(struct Denoted_Object *to_be_initialised,struct Initialiser *initialiser,struct Translation_Data *translation_data);
struct Initialiser* get_indexed_initialiser(struct Type *type,size_t index,struct Initialiser *initialiser,struct Translation_Data *translation_data);
struct Initialiser* get_initialiser_expression(struct AST_Expression *expression,struct Type* type_of_initialised,struct Translation_Data *translation_data);
struct Initialiser* get_compound_initialiser(struct Type *type,struct Queue *components,struct Translation_Data *translation_data);
struct Initialiser* get_initialiser_error(struct Initialiser *error);

#endif