Cthulhu  0.2.10
Cthulhu compiler collection
tree.h File Reference
#include "core/text.h"
#include "cthulhu/tree/context.h"
#include "cthulhu/tree/attrib.h"
#include "cthulhu/tree/cookie.h"
#include <stdbool.h>
#include <gmp.h>
Include dependency graph for tree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tree_attribs_t
 
struct  tree_resolve_info_t
 
struct  tree_t
 

Typedefs

typedef void(* tree_resolve_t) (tree_t *sema, tree_t *self, void *user)
 
typedef void(* tree_resolve_type_t) (tree_t *sema, tree_t *self, void *user)
 

Enumerations

enum  sema_tags_t {
  eSemaValues , eSemaTypes , eSemaProcs , eSemaModules ,
  eSemaCount
}
 

Functions

CT_TREE_API tree_ttree_error (const node_t *node, const diagnostic_t *diagnostic, const char *message,...)
 
CT_TREE_API tree_ttree_raise (const node_t *node, logger_t *reports, const diagnostic_t *diagnostic, const char *message,...)
 
CT_TREE_API void tree_report (logger_t *reports, const tree_t *error)
 
CT_TREE_API tree_ttree_type_empty (const node_t *node, const char *name)
 create an empty type, this is a type that has no values and can never be created in a well defined program More...
 
CT_TREE_API tree_ttree_type_unit (const node_t *node, const char *name)
 create a unit type, this is a type that has only one value. equivilent to void More...
 
CT_TREE_API tree_ttree_type_bool (const node_t *node, const char *name)
 create a bool type, this is a type that has only two values, true and false More...
 
CT_TREE_API tree_ttree_type_opaque (const node_t *node, const char *name)
 create an opaque pointer type More...
 
CT_TREE_API tree_ttree_type_digit (const node_t *node, const char *name, digit_t digit, sign_t sign)
 create a digit type More...
 
CT_TREE_API tree_ttree_type_closure (const node_t *node, const char *name, const tree_t *result, const vector_t *params, tree_arity_t arity)
 create a function pointer type More...
 
CT_TREE_API tree_ttree_type_pointer (const node_t *node, const char *name, const tree_t *pointer, size_t length)
 create a pointer type More...
 
CT_TREE_API tree_ttree_type_reference (const node_t *node, const char *name, const tree_t *reference)
 create a reference type More...
 
CT_TREE_API tree_ttree_type_array (const node_t *node, const char *name, const tree_t *array, size_t length)
 create a new array type More...
 
CT_TREE_API tree_ttree_expr_empty (const node_t *node, const tree_t *type)
 
CT_TREE_API tree_ttree_expr_unit (const node_t *node, const tree_t *type)
 
CT_TREE_API tree_ttree_expr_bool (const node_t *node, const tree_t *type, bool value)
 
CT_TREE_API tree_ttree_expr_digit (const node_t *node, const tree_t *type, const mpz_t value)
 
CT_TREE_API tree_ttree_expr_digit_int (const node_t *node, const tree_t *type, int value)
 
CT_TREE_API tree_ttree_expr_string (const node_t *node, const tree_t *type, const char *value, size_t length)
 create a string expression More...
 
CT_TREE_API tree_ttree_expr_cast (const node_t *node, const tree_t *type, const tree_t *expr, tree_cast_t cast)
 create a cast expression More...
 
CT_TREE_API tree_ttree_expr_load (const node_t *node, tree_t *expr)
 load a value from a pointer or storage More...
 
CT_TREE_API tree_ttree_expr_address (const node_t *node, tree_t *expr)
 create a reference to an object More...
 
CT_TREE_API tree_ttree_expr_unary (const node_t *node, unary_t unary, tree_t *expr)
 
CT_TREE_API tree_ttree_expr_binary (const node_t *node, const tree_t *type, binary_t binary, const tree_t *lhs, const tree_t *rhs)
 
CT_TREE_API tree_ttree_expr_compare (const node_t *node, const tree_t *type, compare_t compare, const tree_t *lhs, const tree_t *rhs)
 
CT_TREE_API tree_ttree_expr_field (const node_t *node, const tree_t *type, tree_t *object, tree_t *field)
 
CT_TREE_API tree_ttree_expr_offset (const node_t *node, const tree_t *type, tree_t *object, tree_t *offset)
 
CT_TREE_API tree_ttree_expr_call (const node_t *node, const tree_t *callee, const vector_t *args)
 
CT_TREE_API tree_ttree_stmt_block (const node_t *node, const vector_t *stmts)
 create a block statement More...
 
CT_TREE_API tree_ttree_stmt_return (const node_t *node, const tree_t *value)
 create a return statement More...
 
CT_TREE_API tree_ttree_stmt_assign (const node_t *node, tree_t *dst, const tree_t *src)
 
CT_TREE_API tree_ttree_stmt_init (const node_t *node, tree_t *dst, tree_t *src)
 
CT_TREE_API tree_ttree_stmt_loop (const node_t *node, tree_t *cond, tree_t *body, tree_t *other)
 
CT_TREE_API tree_ttree_stmt_branch (const node_t *node, tree_t *cond, tree_t *then, tree_t *other)
 
CT_TREE_API tree_ttree_stmt_jump (const node_t *node, tree_t *label, tree_jump_t jump)
 
CT_TREE_API tree_ttree_resolve (tree_cookie_t *cookie, const tree_t *decl)
 
CT_TREE_API tree_ttree_resolve_type (tree_cookie_t *cookie, const tree_t *decl)
 
CT_TREE_API tree_ttree_open_decl (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_decl (tree_t *self, const tree_t *other)
 
CT_TREE_API tree_ttree_decl_global (const node_t *node, const char *name, tree_storage_t storage, const tree_t *type, tree_t *initial)
 
CT_TREE_API tree_ttree_open_global (const node_t *node, const char *name, const tree_t *type, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_global (tree_t *self, tree_t *value)
 
CT_TREE_API tree_ttree_decl_function (const node_t *node, const char *name, const tree_t *signature, const vector_t *params, vector_t *locals, tree_t *body)
 
CT_TREE_API tree_ttree_open_function (const node_t *node, const char *name, const tree_t *signature, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_function (tree_t *self, tree_t *body)
 
CT_TREE_API tree_ttree_decl_struct (const node_t *node, const char *name, vector_t *fields)
 
CT_TREE_API tree_ttree_open_struct (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_struct (tree_t *self, vector_t *fields)
 
CT_TREE_API tree_ttree_decl_union (const node_t *node, const char *name, vector_t *fields)
 
CT_TREE_API tree_ttree_open_union (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_union (tree_t *self, vector_t *fields)
 
CT_TREE_API tree_ttree_decl_enum (const node_t *node, const char *name, const tree_t *underlying, vector_t *fields, tree_t *default_case)
 
CT_TREE_API tree_ttree_open_enum (const node_t *node, const char *name, tree_resolve_info_t resolve)
 
CT_TREE_API void tree_close_enum (tree_t *self, const tree_t *underlying, vector_t *fields, tree_t *default_case)
 
CT_TREE_API tree_ttree_decl_param (const node_t *node, const char *name, const tree_t *type)
 
CT_TREE_API tree_ttree_decl_field (const node_t *node, const char *name, const tree_t *type)
 
CT_TREE_API tree_ttree_decl_local (const node_t *node, const char *name, tree_storage_t storage, const tree_t *type)
 
CT_TREE_API tree_ttree_decl_case (const node_t *node, const char *name, const tree_t *type, tree_t *expr)
 
CT_TREE_API void tree_add_local (tree_t *self, tree_t *decl)
 
CT_TREE_API void tree_add_enum (tree_t *self, tree_t *decl)
 
CT_TREE_API void tree_set_attrib (tree_t *self, const tree_attribs_t *attrib)
 
CT_TREE_API void tree_set_type (tree_t *self, const tree_t *type)
 
CT_TREE_API tree_ttree_alias (const tree_t *tree, const char *name)
 
CT_TREE_API tree_ttree_type_alias (const node_t *node, const char *name, const tree_t *type, tree_quals_t quals)
 
CT_TREE_API const tree_ttree_follow_type (const tree_t *type)
 
CT_TREE_API tree_ttree_module_root (logger_t *reports, tree_cookie_t *cookie, const node_t *node, const char *name, size_t decls, const size_t *sizes, arena_t *arena)
 
CT_TREE_API tree_ttree_module (tree_t *parent, const node_t *node, const char *name, size_t decls, const size_t *sizes)
 create a new module More...
 
CT_TREE_API void * tree_module_get (tree_t *self, size_t tag, const char *name)
 recursively search for a declaration in a module More...
 
CT_TREE_API void * tree_module_find (tree_t *sema, size_t tag, const char *name, tree_t **module)
 search for a declaration in a module also returns the module that the declaration was found in More...
 
CT_TREE_API void * tree_module_set (tree_t *self, size_t tag, const char *name, void *value)
 set a declaration in the current module More...
 
CT_TREE_API map_ttree_module_tag (const tree_t *self, size_t tag)
 
CT_TREE_API tree_cookie_ttree_get_cookie (tree_t *sema)
 return a resolution cookie More...