Module ast

Module ast 

Source
Expand description

Abstract syntax representation. It’s mostly not actually a tree.

In the AST, terminology follows the TX-2 assembler’s documentation, and this doesn’t always match modern usage. In particular, “block” is used to refer to a contiguously-allocated sequence of instructions which share an origin statement. Such as the RC-block. This is not the same as a block in a language like C, where “block” is also a declaration-scoping construct.

Instead, in the TX-2 assembler, scopes are introduced by macro expansion. So, a “block” may contain some instructions followed by a macro-expansion (which has an associated scope) which itself might contain a macro-expansion, with another scope.

Modules§

asteval 🔒
Evaluate (i.e. generate binary data from) parts of the AST.

Structs§

ArithmeticExpression 🔒
Represents an arithmetic expression.
CommaDelimitedFragment 🔒
A component (usually a number) of an assembly-language instruction with possible leading or trailing commas.
ConfigValue 🔒
An expression used to specify the configuration bits of an instruction.
Equality 🔒
An “Equality” (modern term: assignment).
EqualityValue 🔒
The right-hand-side of an Equality.
FragmentWithHold 🔒
Part of a TX-2 instruction, convertible to a 36-bit value.
InstructionSequence 🔒
LiteralValue 🔒
Eventually we will support symbolic expressions.
RegistersContaining 🔒
SignedAtom 🔒
SpannedSymbolOrLiteral 🔒
Tag 🔒
A “Tag” is a symex used as a name for a place in a program. A tag is always terminated by an arrow (“->”) and [in the symbol table] it set to the numerical location of the word that it tags. [from section 6-2.2 of the User’s Handbook].
TaggedProgramInstruction 🔒
A TX-2 instruction with zero or more Tags.
UntaggedProgramInstruction 🔒
An instruction word in a TX-2 program.

Enums§

Atom 🔒
A component of an arithmetic expression.
Commas 🔒
One, two or three commas.
CommasOrInstruction 🔒
An instruction fragment (FragmentWithHold) or one or more commas.
HoldBit 🔒
Indicates whether the hold bit is set, cleared or unspecified.
InstructionFragment 🔒
Part of a TX-2 instruction.
LocalSymbolTableBuildFailure 🔒
We failed to build a local symbol table.
OnUnboundMacroParameter 🔒
Indicates the action to be taken when a macro invocation does not specify a value for one of its dummy parameters.
Operator 🔒
The Users Handbook specifies that the operators are the four arithmetic operators (+-×/) and the logical operators ∧ (AND), ∨ (OR), and a circled ∨ meaning XOR.
Origin 🔒
Represents the origin of a block of program code.
RegisterContaining 🔒
An RC-word.
SymbolOrLiteral 🔒
A symbol name or a numeric literal, or #.
SymbolSubstitution 🔒
Indicates how some particular macro parameter should be processed.
SymbolUse 🔒
Records a reference to or definition of a symbol.

Traits§

RcUpdater 🔒
Allows updates to the values of RC-words.

Functions§

block_items_with_offset 🔒
Enumerate a sequence of items, decorating each with an Unsigned18Bit offset value.
elevated_string 🔒
Convert a normal string to subscript or superscript (or leave it as-is).
format_elevated_chars 🔒
Format a string in super/sub/normal script, using @...@ where necessary.
write_glyph_name 🔒
Write the name of a glyph with optional superscript / subscript indicator.