|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
One node inside the type graph. More...
#include <Compiler_Types.H>
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. | |
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.
|
inlinenoexcept |
Returns whether this node represents a built-in type.
Definition at line 160 of file Compiler_Types.H.
References Aleph::Builtin, and kind.
|
inlinenoexcept |
Returns whether this node represents a nominal enum type.
Definition at line 178 of file Compiler_Types.H.
References Aleph::Enum, and kind.
|
inlinenoexcept |
Returns whether this node represents a nominal struct type.
Definition at line 172 of file Compiler_Types.H.
References kind, and Aleph::Struct.
|
inlinenoexcept |
Returns whether this node represents a type variable.
Definition at line 166 of file Compiler_Types.H.
References kind, and Aleph::Type_Variable.
| 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().
| 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().
| 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().
| Compiler_Type_Kind Aleph::Compiler_Type::kind = Compiler_Type_Kind::Builtin |
Node category.
Definition at line 151 of file Compiler_Types.H.
Referenced by Aleph::Compiler_Type_Context::initialize_builtins(), is_builtin(), Aleph::Compiler_Type_Context::is_builtin(), is_enum(), Aleph::Compiler_Type_Context::is_enum(), is_struct(), Aleph::Compiler_Type_Context::is_struct(), is_type_variable(), Aleph::Compiler_Type_Context::is_type_variable(), Aleph::Compiler_Type_Context::make_enum_type(), Aleph::Compiler_Type_Context::make_function_type(), Aleph::Compiler_Type_Context::make_struct_type(), Aleph::Compiler_Type_Context::make_tuple_type(), and Aleph::Compiler_Type_Context::make_type_variable().
| std::string Aleph::Compiler_Type::label |
Display label for type variables or nominal type names.
Definition at line 156 of file Compiler_Types.H.
| DynArray<std::string> Aleph::Compiler_Type::member_names |
Struct field names or enum variant names.
Definition at line 155 of file Compiler_Types.H.
| 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().
Whether the type variable is rigid.
Definition at line 157 of file Compiler_Types.H.