Cthulhu  0.2.10
Cthulhu compiler collection
common.h File Reference
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TREE_TAG(ID, NAME, TAGS)   ID = (TAGS),
 
#define TREE_EXPECT(SELF, KIND)   CTASSERTF(tree_is(SELF, KIND), "expected %s, got %s", tree_kind_to_string(KIND), tree_to_string(SELF))
 
#define TREE_EXPECT_NOT(SELF, KIND)   CTASSERTF(!tree_is(SELF, KIND), "expected not %s, got %s", tree_kind_to_string(KIND), tree_to_string(SELF))
 

Enumerations

enum  tree_tags_t
 

Functions

CT_CONSTFN CT_LOCAL bool kind_has_tag (tree_kind_t kind, tree_tags_t tags)
 
CT_CONSTFN CT_LOCAL bool tree_has_tag (const tree_t *tree, tree_tags_t tags)
 
CT_LOCAL tree_ttree_new (tree_kind_t kind, const node_t *node, const tree_t *type)
 
CT_LOCAL tree_ttree_decl (tree_kind_t kind, const node_t *node, const tree_t *type, const char *name, tree_quals_t quals)
 

Macro Definition Documentation

◆ TREE_EXPECT

#define TREE_EXPECT (   SELF,
  KIND 
)    CTASSERTF(tree_is(SELF, KIND), "expected %s, got %s", tree_kind_to_string(KIND), tree_to_string(SELF))

Definition at line 22 of file common.h.

◆ TREE_EXPECT_NOT

#define TREE_EXPECT_NOT (   SELF,
  KIND 
)    CTASSERTF(!tree_is(SELF, KIND), "expected not %s, got %s", tree_kind_to_string(KIND), tree_to_string(SELF))

Definition at line 23 of file common.h.

◆ TREE_TAG

#define TREE_TAG (   ID,
  NAME,
  TAGS 
)    ID = (TAGS),

Definition at line 9 of file common.h.

Enumeration Type Documentation

◆ tree_tags_t

Definition at line 7 of file common.h.

Function Documentation

◆ kind_has_tag()

CT_CONSTFN CT_LOCAL bool kind_has_tag ( tree_kind_t  kind,
tree_tags_t  tags 
)

Definition at line 17 of file context.c.

◆ tree_decl()

CT_LOCAL tree_t* tree_decl ( tree_kind_t  kind,
const node_t node,
const tree_t type,
const char *  name,
tree_quals_t  quals 
)

Definition at line 35 of file tree.c.

◆ tree_has_tag()

CT_CONSTFN CT_LOCAL bool tree_has_tag ( const tree_t tree,
tree_tags_t  tags 
)

Definition at line 24 of file context.c.

◆ tree_new()

CT_LOCAL tree_t* tree_new ( tree_kind_t  kind,
const node_t node,
const tree_t type 
)

Definition at line 22 of file tree.c.