compiler/stage2_l0/src/symbols.l0
Module symbols
Overview Symbols grouped by source file: compiler/stage2_l0/src/symbols.l0
Module: symbols
Source: compiler/stage2_l0/src/symbols.l0 Language: Dea/L0
Imports / Includes
typesast
Symbols
Enum SymbolKind
SymbolKind
Defines the SymbolKind enumeration.
Variants:
SYM_FUNCSYM_STRUCTSYM_ENUMSYM_ENUM_VARIANTSYM_TYPE_ALIASSYM_LET
Function symbol_create
func symbol_create(name: string, kind: SymbolKind, module_name: string, owner_name: string, decl_ptr: void*, span: Span) -> Symbol*
Create a new symbol with the given properties.
Parameters:
name: Name of the symbol.kind: Kind of the symbol.module_name: Name of the module where the symbol is defined.owner_name: Name of the owner (e.g., function or struct) of the symbol.decl_ptr: Pointer to the AST node where the symbol is declared.span: Source code span for error reporting.
Returns: A new Symbol instance with cloned string fields and null resolved type.
Function symbol_set_type_clone
func symbol_set_type_clone(self: Symbol*, resolved_type: Type*)
Replace a symbol's resolved type with a cloned copy.
Parameters:
self: Symbol to update.resolved_type: Resolved type to clone into the symbol.
Function symbol_kind_name
func symbol_kind_name(kind: SymbolKind) -> string
Return the printable name for a symbol kind.
Parameters:
kind: Symbol kind to format.
Returns: Uppercase display name for kind.
Function symbol_free
func symbol_free(self: Symbol*)
Free a symbol and any owned resolved type.
Parameters:
self: Symbol to free.
Struct Symbol
Represents the Symbol structure.
Symbol Field name
name: string
Symbol Field kind
kind: SymbolKind
Symbol Field module_name
module_name: string
Symbol Field owner_name
owner_name: string
Symbol Field decl_ptr
decl_ptr: void*
Symbol Field span
span: Span
Symbol Field resolved_type
resolved_type: Type*?