Skip to content

Internal Reference

This section contains reference documentation for the classes and functions used to implement Accelerate.

It is intended to developers who want to contribute to the project. It provides documentation of the classes and how to use them. For rationale behind their design and how they work together, see the Internal Explanations section.

Private methods and members are not documented here, since they are only relevant when working on that class, which usually require more detail than the documentation provides. They are documented in the source code itself, so IDEs should provide documentation popups for them.

Classes used from T'Pau C++ Kernal are documented in its reference section.

The table of contents in the sidebar lists the classes in alphabetical order.

This index page groups them into categories. Within a category, the base classes are listed first, the others follow in alphabetical order.

The categories are: CPU Definition, Entities, Expressions, Body Elements, Memory, Encoders, Parsers, Component Management, Utility Classes, and Unsorted.

CPU Definition

These classes represent the CPU definition, which defines the syntax of the assembly instructions and how they are encoded. They are created from a CPU definition file and used to parse and encode assembly instructions.

CPU

Represents a CPU, which defines its instruction sets, its syntax and encoding.

AddressingMode

Represents an addressing mode, which defines how an instruction's operands are specified and encoded.

AddressingModeMatcher

Determines which addressing modes match a given line in the source code.

ArgumentType

Represents an argument type, which defines the valid values for an instruction's operands.

Instruction

Represents an instruction, listing the valid addressing modes and their corresponding opcodes.

InstructionEncoder

Encodes instructions for a given CPU, translating them into machine code.

Entities

These classes represent the components of a program: objects, constants, macros, and functions. They are created from an assembler source file and used to evaluate the program.

Entity

Represents an entity in the source code, which can be a constant, object, macro, or function.

Callable

Represents a callable entity that can be invoked with arguments: a macro or function.

Function

Represents a function.

Macro

Represents a macro.

Object

Represents an object.

Expressions

These classes represent expressions, which are used in various places in a program. They are created from an expression and used to evaluate it.

Expression

Represents an expression. This is the class other parts of the program interact with. It is a wrapper around the BaseExpression hierarchy.

ExpressionNode

BaseExpression

Abstract base class for all expressions.

BinaryExpression

Expression representing a binary operation.

DefinedExpression

Represents a defined expression, which checks if a preprocessor constant is defined: .defined(USE_FEATURE).

ExistsExpression

Represents an exists expression, which checks if a name refers to a constant or object: .exists(hook_function).

FillExpression

Expression representing a sequence of repeated values: .fill(count, value).

FunctionExpression

Expression representing a function call: function_name(arg1, arg2, ...).

InRangeExpression

Expression representing a check if a value is in a certain range.

LabelExpression

Represents a label expression, which refers to a label in an object or the next/previous unnamed label: label_name, :+, :-.

MinMaxExpression

Expression representing the minimum or maximum of two sub-expressions: .min(a, b) or .max(a, b).

ObjectExpression

Represents an expression referring to an object.

ObjectNameExpression

Represents an expression referring to the name of the current object.

SizeofExpression

Represents an expression that evaluates to the size of an object: .sizeof(object).

UnaryExpression

Expression node representing a unary operation.

ValueExpression

Expression node representing a Value.

VariableExpression

Expression node representing a variable.

VoidExpression

Expression node representing a void value.

Body Elements

These classes represent body elements, which are used to define the contents of objects and macros. They are created from a body and used to evaluate it.

Body

Represents a body of an object or macro. This is the class other parts of the program interact with. It is a wrapper around the BodyElement hierarchy.

BodyElement

Base class for all Body types.

AssignmentBody

Represents an assignment, which defines a local constant or variable: name = value.

BlockBody

Represents a sequence of body elements.

ChecksumBody

Represents a body element that computes a checksum over a range of memory: .checksum algorithm start end [parameters].

DataBody

Represents a body containing data. This is used for .data statements and encoded instructions.

EmptyBody

Represents an empty body.

ErrorBody

Represents a body that reports an error when encoded. It can be used with conditional compilation to report errors when certain conditions are met: .error message.

IfBody

Represents a conditional body. Parts of this body will be discarded, based on the evaluation of the conditions.

MacroBody

Represents a macro call: macro_name(arg1, arg2, ...).

MemoryBody

Represents a body that specifies a memory range: .memory start, end. It is used in the .output definition in targets.

RepeatBody

Represents a body that repeats a block of code a specified number of times.

ScopeBody

Represents a body, that introduces a new scope for its contained body.

LabelBody

Represents a label, which is a position in the code: label: or :.

Memory

These classes manage the target machine's memory of the program, including allocation map and memory content.

Address

Represents an address, consisting of a bank and an address within that bank. The bank defaults to 0.

Memory

Represents the memory of the target system, including allocated and free blocks and data.

MemoryMap

Represents the layout of memory for a target system, including sections and segments.

Encoders

These classes represent encoders, which are used to encode values into bytes.

Encoder

Represents an encoder, which is responsible for encoding values into bytes. This is the class other parts of the program interact with. This class is a wrapper around the BaseEncoder hierarchy.

BaseEncoder

The base class for encoders, which are responsible for encoding values into bytes.

BinaryEncoder

Implements an encoder that encodes binary values.

IntegerEncoder

Implements an encoder that encodes integer values, taking into account the minimum size and byte order.

StringEncoder

Implements an encoder that encodes string values using a specific StringEncoding.

Parsers

These classes implement the various parsers.

Assembler

This class parses source files or target definitions into entities.

BodyParser

This class parses object and macro bodies.

CPUParser

This class parses CPU definitions.

FileParser

FileTokenizer

This class gets tokens from a file.

ObjectFileParser

SequenceTokenizer

This class gets tokens from a sequence of already parsed tokens.

Token

This class represents a token, which is a basic syntactic unit.

TokenGroup

A group of tokens specified by specific tokens or token types.

TokenNode

Tokenizer

The base class for tokenizers, which convert a source into a sequence of tokens.

Component Management

These classes manage the components of a program, including CPU definitions, targets, and libraries, parsing them from files and avoiding creating duplicates for the same component.

Getter

CPUGetter

Get the CPU definition by name.

LibraryGetter

TargetGetter

Utility Classes

These classes provide various utility functions and algorithms used throughout the program.

Checksum

ChecksumAlgorithm

The base class for checksum algorithm implementations.

ChecksumAlgorithmXor

Implements a checksum algorithm that computes the XOR of all bytes.

ChecksumComputation

Represents a checksum computation, which computes a checksum over a range of memory and writes the result to a specified position.

Unsorted

These classes are not yet sorted into the above categories.

Todo

Sort the classes into categories, creating new categories as needed.

Environment

EvaluationContext

EvaluationResult

ExpressionParser

LibraryLinker

Linker

Node

ObjectFile

Output

ProgramLinker

Range

Class representing an integer range.

SizeRange

StructuredValue

Represents a structured value, which can be an scalar, array, dictionary, or body.

Target

UnnamedLabelList

Unresolved

Visibility