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.

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.

InstructionInvocation

Represents an invocation of an instruction.

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.

Function

Represents a function.

Macro

Represents a macro.

Object

Represents an object.

ScopeEntity

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.

BaseExpression

Abstract base class for all expressions.

ArgumentExpression

This is a placeholder for arguments, so they can be resolved in macro and function bodies.

BinaryExpression

Expression representing a binary operation.

ConstantExpression

Represents an expression referring to a constant.

CurrentObjectExpression

Represents an expression referring to the current object.

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.

LabelOffsetExpression

Represents a label expression, which refers to a label in an object.

MemoryInfoExpression

Represents an expression that provides information about memory.

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.

ScopeExpression

Represents an expression that introduces a new scope for its contained expression.

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.

NameExpression

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

Abstract 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.

LabelBody

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

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

Abstract base class for 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.

SimpleRepeatBody

Represents a body that repeats a block of code a specified number of times, not using a variable.

VariableRepeatBody

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

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.

LibraryParser

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

Represents a token corresponding to punctuation or keyword in the instruction notation.

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.

AbortTraversalException

Exception used to abort traversal.

Base

Base class for class hierarchies.

BaseEncoder

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

CallableArguments

CloneContext

Constant

EvaluationContext

EvaluationOrder

Class for determining the evaluation order of entities based on their dependencies.

ExpressionNode

Represents an expression corresponding to an argument for the instruction.

ExpressionParser

LibraryLinker

Linker

The base class to translate a program or library.

Module

Node

Represents a node in instruction notation. It can be an expression, keyword, or punctuation.

Output

ProgramLinker

Range

Class representing an integer range.

Scope

Represents a scope used for name resolution. It can be contained in other scopes.

SizeRange

Represents a possibly unbounded range of sizes.

StructuredArray

Represents an array of structured values.

StructuredBody

Represents a body as part of a structured value.

StructuredDictionary

Represents a dictionary of structured values. Keys are tokens and values are structured values.

StructuredScalar

Represents a scalar value, which can be a single token or a list of tokens.

StructuredValue

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

Target

UnnamedLabelList

Visibility