Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Compiler_Type Struct Reference

One node inside the type graph. More...

#include <Compiler_Types.H>

Collaboration diagram for Aleph::Compiler_Type:
[legend]

Public Member Functions

bool is_builtin () const noexcept
 Returns whether this node represents a built-in type.
 
bool is_type_variable () const noexcept
 Returns whether this node represents a type variable.
 
bool is_struct () const noexcept
 Returns whether this node represents a nominal struct type.
 
bool is_enum () const noexcept
 Returns whether this node represents a nominal enum type.
 

Public Attributes

Compiler_Type_Id id = 0
 Stable 1-based identifier.
 
Compiler_Type_Kind kind = Compiler_Type_Kind::Builtin
 Node category.
 
Compiler_Builtin_Type builtin = Compiler_Builtin_Type::Invalid
 Built-in tag.
 
DynArray< Compiler_Type_Id > components
 Tuple members, function parameters, or struct field types.
 
Compiler_Type_Id result_type = 0
 Function return type, or 0.
 
DynArray< std::string > member_names
 Struct field names or enum variant names.
 
std::string label
 Display label for type variables or nominal type names.
 
bool rigid = false
 Whether the type variable is rigid.
 

Detailed Description

One node inside the type graph.

For Tuple, components stores the tuple members.

For Function, components stores the parameter types and result_type stores the return type.

For Struct, label stores the type name, member_names stores the field names, and components stores the field types in declaration order.

For Enum, label stores the type name and member_names stores the variant names in declaration order.

For Type_Variable, label is the debug/display name and rigid controls whether a unifier is allowed to bind the variable.

Definition at line 148 of file Compiler_Types.H.

Member Function Documentation

◆ is_builtin()

bool Aleph::Compiler_Type::is_builtin ( ) const
inlinenoexcept

Returns whether this node represents a built-in type.

Definition at line 160 of file Compiler_Types.H.

References Aleph::Builtin, and kind.

◆ is_enum()

bool Aleph::Compiler_Type::is_enum ( ) const
inlinenoexcept

Returns whether this node represents a nominal enum type.

Definition at line 178 of file Compiler_Types.H.

References Aleph::Enum, and kind.

◆ is_struct()

bool Aleph::Compiler_Type::is_struct ( ) const
inlinenoexcept

Returns whether this node represents a nominal struct type.

Definition at line 172 of file Compiler_Types.H.

References kind, and Aleph::Struct.

◆ is_type_variable()

bool Aleph::Compiler_Type::is_type_variable ( ) const
inlinenoexcept

Returns whether this node represents a type variable.

Definition at line 166 of file Compiler_Types.H.

References kind, and Aleph::Type_Variable.

Member Data Documentation

◆ builtin

Compiler_Builtin_Type Aleph::Compiler_Type::builtin = Compiler_Builtin_Type::Invalid

Built-in tag.

Definition at line 152 of file Compiler_Types.H.

Referenced by Aleph::Compiler_Type_Context::initialize_builtins().

◆ components

DynArray<Compiler_Type_Id> Aleph::Compiler_Type::components

Tuple members, function parameters, or struct field types.

Definition at line 153 of file Compiler_Types.H.

Referenced by TEST().

◆ id

Compiler_Type_Id Aleph::Compiler_Type::id = 0

Stable 1-based identifier.

Definition at line 150 of file Compiler_Types.H.

Referenced by Aleph::Compiler_Type_Context::append_type().

◆ kind

◆ label

std::string Aleph::Compiler_Type::label

Display label for type variables or nominal type names.

Definition at line 156 of file Compiler_Types.H.

◆ member_names

DynArray<std::string> Aleph::Compiler_Type::member_names

Struct field names or enum variant names.

Definition at line 155 of file Compiler_Types.H.

Referenced by TEST(), and TEST().

◆ result_type

Compiler_Type_Id Aleph::Compiler_Type::result_type = 0

Function return type, or 0.

Definition at line 154 of file Compiler_Types.H.

Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::analyze_function().

◆ rigid

bool Aleph::Compiler_Type::rigid = false

Whether the type variable is rigid.

Definition at line 157 of file Compiler_Types.H.


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