Zen-C
Loading...
Searching...
No Matches
Type Struct Reference

Represents a formal type in the type system. More...

#include <ast.h>

Collaboration diagram for Type:

Data Fields

TypeKind kind
 The kind of type.
 
char * name
 Name of the type (for STRUCT, GENERIC, ENUM).
 
struct Typeinner
 Inner type (for POINTER, ARRAY).
 
struct Type ** args
 Generic arguments (for GENERIC instantiations).
 
int arg_count
 Count of generic arguments.
 
int is_const
 1 if const-qualified.
 
int is_explicit_struct
 1 if defined with "struct" keyword explicitly.
 
int is_raw
 
int array_size
 Size for fixed-size arrays. For TYPE_BITINT, this is the bit width.
 
union { 
 
   int   is_varargs 
 1 if function type is variadic. More...
 
   int   is_restrict 
 1 if pointer is restrict-qualified. More...
 
   struct { 
 
      int   has_drop 
 1 if type implements Drop trait (RAII). More...
 
      int   has_iterable 
 1 if type implements Iterable trait. More...
 
   }   traits 
 
   struct { 
 
      int   is_opaque_alias 
 
      char *   alias_defined_in_file 
 
   }   alias 
 
};  
 

Detailed Description

Represents a formal type in the type system.

Field Documentation

◆ [union]

union { ... } Type

◆ [struct]

struct { ... } Type::alias

◆ alias_defined_in_file

char* Type::alias_defined_in_file

◆ arg_count

int Type::arg_count

Count of generic arguments.

◆ args

struct Type** Type::args

Generic arguments (for GENERIC instantiations).

◆ array_size

int Type::array_size

Size for fixed-size arrays. For TYPE_BITINT, this is the bit width.

◆ has_drop

int Type::has_drop

1 if type implements Drop trait (RAII).

◆ has_iterable

int Type::has_iterable

1 if type implements Iterable trait.

◆ inner

struct Type* Type::inner

Inner type (for POINTER, ARRAY).

◆ is_const

int Type::is_const

1 if const-qualified.

◆ is_explicit_struct

int Type::is_explicit_struct

1 if defined with "struct" keyword explicitly.

◆ is_opaque_alias

int Type::is_opaque_alias

◆ is_raw

int Type::is_raw

◆ is_restrict

int Type::is_restrict

1 if pointer is restrict-qualified.

◆ is_varargs

int Type::is_varargs

1 if function type is variadic.

◆ kind

TypeKind Type::kind

The kind of type.

◆ name

char* Type::name

Name of the type (for STRUCT, GENERIC, ENUM).

◆ [struct]

struct { ... } Type::traits

The documentation for this struct was generated from the following file: