Recursive Functions
Assemble:
TreeRecursiveFunction [ Tree ]
Returns [ EncodingSequence.program, Table.all, INT.nextAddress ];
the primary (synthesis) operation of the assembler, produces a code sequence, a symbol table, and the length of the code sequence (represented as start+len=last+1). Note that this is a two pass operations where the symbol table is constructed in pass 1, and the code sequence is produced in pass 2 (where children recieve the symbol table as an inherited value).
SymbolTable:
TreeRecursiveFunction [ Tree, Table.old, INT.first ]
Returns [ Table.new, INT.next ];
the operation which produces values for symbols by synthesizing representations (virtual addresses in INT's) as values for symbolic labels
NotePosition:
TreeRecursiveFunction [ Tree, INT.address, INT.definedAt ]
Returns [ LabelInstance.id ];
a noop which provides us with the ability to recognize positions of GenericTokens(id)
CodeSequence:
TreeRecursiveFunction [ Tree, Table ]
Returns [ EncodingSequence.list ];
the gradual synthesis of the module/program via concatenation of Instruction Sequences.
Instruction:
TreeRecursiveFunction [ Tree ]
Returns [ Encoding.instr ];
the encoding of a primitive operation for the "machine".
InstructionRand:
TreeRecursiveFunction [ Tree, LabelInstance.id ]
Returns [ Encoding.instr ];
the encoding of a primitive operation (with operand) for the "machine".
Index:
TreeRecursiveFunction [ Tree, Table ]
Returns [ LabelInstance.index ];
the virtual program counter for instructions.