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§
- Arithmetic
Expression 🔒 - Represents an arithmetic expression.
- Comma
Delimited 🔒Fragment - A component (usually a number) of an assembly-language instruction with possible leading or trailing commas.
- Config
Value 🔒 - An expression used to specify the configuration bits of an instruction.
- Equality 🔒
- An “Equality” (modern term: assignment).
- Equality
Value 🔒 - The right-hand-side of an
Equality
. - Fragment
With 🔒Hold - Part of a TX-2 instruction, convertible to a 36-bit value.
- Instruction
Sequence 🔒 - Literal
Value 🔒 - Eventually we will support symbolic expressions.
- Registers
Containing 🔒 - Signed
Atom 🔒 - Spanned
Symbol 🔒OrLiteral - 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].
- Tagged
Program 🔒Instruction - A TX-2 instruction with zero or more
Tag
s. - Untagged
Program 🔒Instruction - An instruction word in a TX-2 program.
Enums§
- Atom 🔒
- A component of an arithmetic expression.
- Commas 🔒
- One, two or three commas.
- Commas
OrInstruction 🔒 - An instruction fragment (
FragmentWithHold
) or one or more commas. - HoldBit 🔒
- Indicates whether the hold bit is set, cleared or unspecified.
- Instruction
Fragment 🔒 - Part of a TX-2 instruction.
- Local
Symbol 🔒Table Build Failure - We failed to build a local symbol table.
- OnUnbound
Macro 🔒Parameter - 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.
- Register
Containing 🔒 - An RC-word.
- Symbol
OrLiteral 🔒 - A symbol name or a numeric literal, or
#
. - Symbol
Substitution 🔒 - Indicates how some particular macro parameter should be processed.
- Symbol
Use 🔒 - 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.