Skip to main content

Module transform

Module transform 

Source
Expand description

Program transforms: host intentions expressed as changes to the program rather than as runtime behavior around it.

A host that wants to inject a value, observe a scope, or otherwise shape a run does so by rewriting the program and compiling the result. The program’s own typing, lifecycle classification, and engine selection then apply to the host’s additions exactly as they apply to the author’s.

Structs§

DeclaredWires
Every scope of a parsed program, by name.
ScopeWires
What a scope of a parsed program binds, by name.

Functions§

add_tiles
Add tiles a host built from what it holds to the program, as tile statements at its top level.
assign_values
Assign name=value text to externs and inputs by rewriting their declarations.
convert_input
Let the program’s extern name take a value of any type, converted in front of each reader by a converter node (input_variance.md §6).
declared_wires
Read DeclaredWires from a parsed program.
each_piece
Apply f to every piece of a template, then to every piece nested in a projection body or a branch arm, depth first.
each_statement
Apply f to every statement in statements, then to every statement nested in a module body or a for body, depth first.
each_tile
Apply f to every tile the subtree declares, module and for bodies included.
parse_assignment
Split name=value text into its parts.
tile_named
The tile bound to name in the subtree, for a transform qualified to one definition.