# Packages
Package printer provides a human-readable printer for the semantic tree nodes.
# Functions
Add connects an Owned to its Owner.
AsUint64 converts a sized integer value to a uint64.
Integer returns a signed integer type of the given size in bytes.
IntegerSizeInBits returns the size in bits of the given integer type.
IsInteger returns true if ty is an integer type.
IsNumeric returns true if t is one of the primitive numeric types.
IsReference returns true if ty is a reference type.
IsStorageType returns true if ty can be used as a storage type.
IsUnsigned returns true if ty is an unsigned integer type.
Replace invokes visitor for all the children of the supplied node, replacing the node with the returned value.
TypeOf returns the resolved semantic type of the Type, Field or Expression.
Underlying returns the underlying type for ty by recursively traversing the pseudonym chain until reaching and returning the first non-pseudoym type.
UnsignedInteger returns an unsigned integer type of the given size in bytes.
Visit invokes visitor for all the children of the supplied node.
# Variables
Unsized primitives.
BuiltinGlobals is the list of all builtin globals.
BuiltinThreadGlobal represents the $Thread global variable.
Char is supposed to be unsized type, but is treated by the APIC templates as a synonym for u8 and the UI assumes ASCII in the memory view.
Floating point forms.
Fixed size integer forms.
InvalidType is a placeholder for an invalid type.
Size is used to represent the size_t type in C/C++.
Special types.
# Structs
Abort represents the abort statement, used to immediately terminate execution of a command, usually because of an error.
Annotation represents a single annotation on an Annotated.
API is the root of the ASG, and holds a fully resolved api.
ArrayAssign represents assigning to a static-array index expression.
ArrayIndex represents using the indexing operator on a static-array type.
ArrayInitializer represents an expression that creates a new StaticArray instance using a value list, of the form T(v0, v1, v2).
Assert represents a runtime assertion.
Assign is the only "mutating" construct.
BinaryOp represents any operator applied to two arguments.
BitTest is the "in" operator applied to a bitfield.
Block represents a collection of statements, used as the body of other nodes.
Branch represents the basic conditional execution statement.
Builtin represents one of the primitive types.
Call represents a function call.
Callable wraps a Function declaration into a function value expression, optionally binding to an object if its a method.
Case represents a possible choice in a switch.
Cast represents a type reinterpret expression.
Choice represents a possible choice in a select.
Class represents an api class construct.
ClassInitializer represents an expression that can assign values to multiple fields of a class.
Clone represents a call to clone.
Copy represents a call to copy.
Create represents a call to new on a class type.
DeclareLocal represents a local variable declaration statement.
Definition represents a named literal definition.
DefinitionUsage represents a named literal usage.
Enum represents the api enum construct.
EnumEntry represents a single entry in an Enum.
Fence is a marker to indicate the point between all statements to be executed before (pre-fence) the call to the API function and all statements to be executed after (post-fence) the call to the API function.
Field represents a field entry in a class.
FieldInitializer represents the value initialization of a class field.
Function represents function like objects in the semantic graph.
Global represents a global variable.
Ignore represents an _ expression.
Import wraps an API with it's imported name.
Invalid is a placeholder for an invalid expression or statement.
Iteration is the basic looping construct.
Length represents a length of object expression.
Local represents an immutable local storage slot, created by a DeclareLocal, and referred to by identifiers that resolve to that slot.
Make represents a call to make.
Map represents an api map type declaration, of the form map!(KeyType, ValueType).
MapAssign represents assigning to a map index expression.
MapClear represents clearing a map.
MapContains is the "in" operator applied to a map.
MapIndex represents using the indexing operator on a map type.
MapIteration is a loop over a map's key-value pairs.
Mappings is a two-way map of AST nodes to semantic nodes.
MapRemove represents removing an element from a map.
Member is an expression that looks up a field by name from an object.
MessageValue is an expression that produces a localized message.
New represents a call to new.
Null represents a default value.
Observed represents the final observed value of an output parameter.
Parameter represents a single parameter declaration for a function.
Pointer represents an api pointer type declaration, of the form To*.
PointerRange represents using the indexing operator on a pointer type with a range expression.
Print represents a call to print.
Pseudonym represents the type construct.
Read represents a call to read.
Reference represents an api reference type declaration, of the form ref!To.
Return represents return statement for a function.
Select is the expression form of a switch.
Signature represents a callable type signature.
Slice represents an api slice type declaration, of the form To[].
SliceAssign represents assigning to a slice index expression.
SliceContains is the "in" operator applied to a slice.
SliceIndex represents using the indexing operator on a slice type.
SliceRange represents using the indexing operator on a slice type with a range expression.
StaticArray represents a one-dimension fixed size array type, of the form T[8].
Switch represents a resolved ast.Switch statement.
Symbols is an object with named members and no other functionality.
UnaryOp represents an operator applied to a single expression.
Unknown represents a value that cannot be predicted.
Write represents a call to write.
# Interfaces
Annotated is the common interface to objects that can carry annotations.
Expression represents anything that can act as an expression in the api language, it must be able to correctly report the type of value it would return if executed.
NamedNode represents any semantic-tree node that carries a name.
Node represents any semantic-tree node type.
Owned is the interface to an object with a unique name and an owner.
Owner is the interface for an object that has named Members.
Statement is the interface implemented by all statement types.
Type is the interface to any object that can act as a type to the api language.
# Type aliases
Annotations is an array of Annotation objects that implements the Annotated interface.
BoolValue is a bool that implements Expression so it can be in the semantic graph.
Documentation represents the documentation strings for a type or function.
Float32Value is a float32 that implements Expression so it can be in the semantic graph.
Float64Value is a float64 that implements Expression so it can be in the semantic graph.
Int16Value is an int16 that implements Expression so it can be in the semantic graph.
Int32Value is an int32 that implements Expression so it can be in the semantic graph.
Int64Value is an int64 that implements Expression so it can be in the semantic graph.
Int8Value is an int8 that implements Expression so it can be in the semantic graph.
LogicalOrder is a bitfield describing whether a statement, block or subroutine belongs before (pre) or after (post) the command's fence.
Named is mixed in to implement the Name method of NamedNode.
Statements is a list of statements.
StringValue is a string that implements Expression so it can be in the semantic graph.
Uint16Value is a uint16 that implements Expression so it can be in the semantic graph.
Uint32Value is a uint32 that implements Expression so it can be in the semantic graph.
Uint64Value is a uint64 that implements Expression so it can be in the semantic graph.
Uint8Value is a uint8 that implements Expression so it can be in the semantic graph.